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

Function callersOf

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

Source from the content-addressed store, hash-verified

445 }
446
447 function callersOf(fnName: string, kind: string = 'function'): string[] {
448 const results = cg.searchNodes(fnName);
449 const def = results.map((r) => r.node).find((n) => n.kind === kind && n.name === fnName);
450 if (!def) return [];
451 return cg.getCallers(def.id).map((c) => c.node.name);
452 }
453
454 beforeEach(async () => {
455 testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-1240-'));

Callers 1

sync.test.tsFile · 0.85

Calls 2

searchNodesMethod · 0.45
getCallersMethod · 0.45

Tested by

no test coverage detected