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

Function callersOf

__tests__/sync.test.ts:469–474  ·  view source on GitHub ↗
(fnName: string, kind: string = 'function')

Source from the content-addressed store, hash-verified

467 }
468
469 function callersOf(fnName: string, kind: string = 'function'): string[] {
470 const results = cg.searchNodes(fnName);
471 const def = results.map((r) => r.node).find((n) => n.kind === kind && n.name === fnName);
472 if (!def) return [];
473 return cg.getCallers(def.id).map((c) => c.node.name);
474 }
475
476 beforeEach(async () => {
477 testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-1240-'));

Callers 1

sync.test.tsFile · 0.70

Calls 2

searchNodesMethod · 0.45
getCallersMethod · 0.45

Tested by

no test coverage detected