chore(core): cleanup

This commit is contained in:
braks
2023-05-17 18:00:31 +02:00
committed by Braks
parent f9462d16a9
commit 1a083fc861

View File

@@ -1,11 +1,11 @@
import { unref } from 'vue'
import { ErrorCode, VueFlowError, connectionExists, getEdgeId, isEdge, parseEdge, parseNode } from '.'
import { toValue } from '@vueuse/core'
import { ErrorCode, VueFlowError, connectionExists, getEdgeId, isEdge, isNode, parseEdge, parseNode } from '.'
import type { Actions, Connection, Edge, GraphEdge, GraphNode, Node, State } from '~/types'
type NonUndefined<T> = T extends undefined ? never : T
export function isDef<T>(val: T): val is NonUndefined<T> {
const unrefVal = unref(val)
const unrefVal = toValue(val)
return typeof unrefVal !== 'undefined'
}