refactor(intersections): use passed node values for calculations

This commit is contained in:
moklick
2024-03-14 16:14:48 +01:00
parent 9e30f3b2cd
commit b1c30ee653
4 changed files with 47 additions and 44 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ export const isEdgeBase = <EdgeType extends EdgeBase = EdgeBase>(element: any):
* @returns A boolean indicating whether the element is an Node
*/
export const isNodeBase = <NodeType extends NodeBase = NodeBase>(element: any): element is NodeType =>
'id' in element && !('source' in element) && !('target' in element);
'id' in element && 'position' in element && !('source' in element) && !('target' in element);
/**
* Pass in a node, and get connected nodes where edge.source === node.id