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

Function callersOf

__tests__/extraction.test.ts:1257–1265  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

1255export const exported = { handler: () => target() };
1256`;
1257 const callersOf = (name: string) => {
1258 const result = extractFromSource('app.ts', code);
1259 const byId = new Map(result.nodes.map((n) => [n.id, n]));
1260 return result.unresolvedReferences
1261 .filter((u) => u.referenceKind === 'calls' && u.referenceName === name)
1262 .map((u) => byId.get(u.fromNodeId))
1263 .map((n) => (n ? `${n.kind}:${n.qualifiedName}` : '?'))
1264 .sort();
1265 };
1266
1267 it("a plain call initializer names the CONSTANT as caller, not the file", () => {
1268 // The walk ran with only the file on the stack, so `load` recorded the

Callers 1

extraction.test.tsFile · 0.70

Calls 3

extractFromSourceFunction · 0.90
mapMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected