From a575d14b6621d5464d33d52ca642f2db70c3e370 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Tue, 27 Sep 2022 15:09:17 +0200 Subject: fix: move a ton of functions to separate files --- util/isLinkRelatedToNode.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 util/isLinkRelatedToNode.ts (limited to 'util/isLinkRelatedToNode.ts') diff --git a/util/isLinkRelatedToNode.ts b/util/isLinkRelatedToNode.ts new file mode 100644 index 0000000..eeacab7 --- /dev/null +++ b/util/isLinkRelatedToNode.ts @@ -0,0 +1,7 @@ +import { NodeObject, LinkObject } from 'force-graph' + +export const isLinkRelatedToNode = (link: LinkObject, node: NodeObject | null) => { + return ( + (link.source as NodeObject)?.id! === node?.id! || (link.target as NodeObject)?.id! === node?.id! + ) +} -- cgit v1.2.3