fix(core): correct return type of getIncomers & getOutgoers

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-03-24 14:35:46 +01:00
committed by Braks
parent fad894d9a1
commit 0501151e94
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ const getConnectedElements = (node: GraphNode, elements: Elements, dir: 'source'
if (!isNode(node)) return []
const origin = dir === 'source' ? 'target' : 'source'
const ids = elements.filter((e) => isEdge(e) && e[origin] === node.id).map((e) => isEdge(e) && e[dir])
return elements.filter((e) => ids.includes(e.id))
return elements.filter((e) => ids.includes(e.id)) as GraphEdge[]
}
export const getOutgoers = (node: GraphNode, elements: Elements) => getConnectedElements(node, elements, 'target')