refactor(core): remove primtive typeguards

This commit is contained in:
braks
2023-10-30 13:36:07 +01:00
committed by Braks
parent 785f147236
commit 3b175a553e
10 changed files with 35 additions and 54 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { isNumber, rectToBox } from '.'
import { rectToBox } from '.'
import type { Actions, EdgePositions, GraphEdge, GraphNode, HandleElement, Rect, ViewportTransform, XYPosition } from '~/types'
import { Position } from '~/types'
@@ -132,7 +132,7 @@ export function isEdgeVisible({
}
export function getEdgeZIndex(edge: GraphEdge, findNode: Actions['findNode'], elevateEdgesOnSelect = false) {
const hasZIndex = isNumber(edge.zIndex)
const hasZIndex = typeof edge.zIndex === 'number'
let z = hasZIndex ? edge.zIndex! : 0
const source = findNode(edge.source)