chore(core): cleanup

This commit is contained in:
braks
2023-05-25 20:48:26 +02:00
committed by Braks
parent f9462d16a9
commit 1a083fc861
+3 -3
View File
@@ -1,11 +1,11 @@
import { unref } from 'vue' import { toValue } from '@vueuse/core'
import { ErrorCode, VueFlowError, connectionExists, getEdgeId, isEdge, parseEdge, parseNode } from '.' import { ErrorCode, VueFlowError, connectionExists, getEdgeId, isEdge, isNode, parseEdge, parseNode } from '.'
import type { Actions, Connection, Edge, GraphEdge, GraphNode, Node, State } from '~/types' import type { Actions, Connection, Edge, GraphEdge, GraphNode, Node, State } from '~/types'
type NonUndefined<T> = T extends undefined ? never : T type NonUndefined<T> = T extends undefined ? never : T
export function isDef<T>(val: T): val is NonUndefined<T> { export function isDef<T>(val: T): val is NonUndefined<T> {
const unrefVal = unref(val) const unrefVal = toValue(val)
return typeof unrefVal !== 'undefined' return typeof unrefVal !== 'undefined'
} }