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
@@ -11,7 +11,6 @@ import {
getConnectedEdges,
getXYZPos,
handleNodeClick,
isNumber,
} from '~/utils'
interface Props {
@@ -153,7 +152,7 @@ const NodeWrapper = defineComponent({
z: nodeZIndex + (elevateNodesOnSelect.value ? (node.value.selected ? 1000 : 0) : 0),
}
if (isNumber(parentX) && isNumber(parentY)) {
if (typeof parentX !== 'undefined' && typeof parentY !== 'undefined') {
node.value.computedPosition = getXYZPos({ x: parentX, y: parentY, z: parentZ! }, xyzPos)
} else {
node.value.computedPosition = xyzPos