MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / getNodeAncestorPath

Function getNodeAncestorPath

app/useColumnView/index.ts:520–540  ·  view source on GitHub ↗
(
  nodeTable: NodeTable,
  nodeId?: string,
  path: string[] = []
)

Source from the content-addressed store, hash-verified

518}
519
520function getNodeAncestorPath(
521 nodeTable: NodeTable,
522 nodeId?: string,
523 path: string[] = []
524): string[] {
525 if (!nodeId) {
526 return path;
527 }
528
529 const nodeRecord = nodeTable[nodeId];
530
531 if (!nodeRecord) {
532 return path;
533 }
534
535 return getNodeAncestorPath(
536 nodeTable,
537 nodeRecord.parentId,
538 path.concat(nodeId)
539 );
540}
541
542type NodeRecord = {
543 id: string;

Callers 1

getPathToNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected