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

Function callersOf

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

Source from the content-addressed store, hash-verified

554 }
555
556 function callersOf(fnName: string, kind: string = 'function'): string[] {
557 const results = cg.searchNodes(fnName);
558 const def = results.map((r) => r.node).find((n) => n.kind === kind && n.name === fnName);
559 if (!def) return [];
560 return cg.getCallers(def.id).map((c) => c.node.name);
561 }
562
563 beforeEach(async () => {
564 testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-1240-'));

Callers 2

sync.test.tsFile · 0.70
editAndSyncFunction · 0.70

Calls 5

mapMethod · 0.80
searchNodesMethod · 0.65
getNodesByNameMethod · 0.65
getCallersMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected