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

Function target

__tests__/new-expression-receiver.test.ts:108–111  ·  view source on GitHub ↗
(caller: string)

Source from the content-addressed store, hash-verified

106 try {
107 await graph.indexAll();
108 const target = (caller: string) => {
109 const from = graph.getNodesByName(caller).find((n) => n.kind === 'function')!;
110 return graph.getCallees(from.id).filter(({ edge }) => edge.kind === 'calls').map(({ node: n }) => n.filePath);
111 };
112 expect(target('useA')).toEqual(['src/a/runner.ts']);
113 expect(target('useB')).toEqual(['src/b/runner.ts']);
114 } finally {

Callers 1

Calls 3

mapMethod · 0.80
getNodesByNameMethod · 0.65
getCalleesMethod · 0.45

Tested by

no test coverage detected