MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / groupNodeIdentities

Function groupNodeIdentities

src/extraction/index.ts:1803–1815  ·  view source on GitHub ↗
(
  nodes: readonly NodeIdentity[],
  key: (n: NodeIdentity) => string
)

Source from the content-addressed store, hash-verified

1801];
1802
1803function groupNodeIdentities(
1804 nodes: readonly NodeIdentity[],
1805 key: (n: NodeIdentity) => string
1806): Map<string, NodeIdentity[]> {
1807 const groups = new Map<string, NodeIdentity[]>();
1808 for (const n of nodes) {
1809 const k = key(n);
1810 const group = groups.get(k);
1811 if (group) group.push(n);
1812 else groups.set(k, [n]);
1813 }
1814 return groups;
1815}
1816
1817/**
1818 * Pair each node a file had before a re-index with the node that replaces it,

Callers 1

pairGroupsFunction · 0.85

Calls 4

pushMethod · 0.80
getMethod · 0.65
keyFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected