MCPcopy Create free account
hub / github.com/RobPruzan/react-scratch / findParentNode

Function findParentNode

src/utils.ts:152–161  ·  view source on GitHub ↗
(
  eq: (node: T) => boolean,
  tree: T
)

Source from the content-addressed store, hash-verified

150};
151
152export const findParentNode = <T extends { id: string; childNodes: Array<T> }>(
153 eq: (node: T) => boolean,
154 tree: T
155): T | null => {
156 try {
157 return findParentNodeOrThrow(eq, tree);
158 } catch {
159 return null;
160 }
161};

Callers

nothing calls this directly

Calls 1

findParentNodeOrThrowFunction · 0.85

Tested by

no test coverage detected