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

Function targets

__tests__/cross-language-resolution.test.ts:29–35  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

27 }
28
29 function targets(name: string) {
30 const source = cg!.getNodesByName(name).find((n) => n.kind !== 'file');
31 expect(source, name).toBeDefined();
32 return cg!.getOutgoingEdges(source!.id)
33 .filter((e) => ['calls', 'instantiates', 'extends', 'implements'].includes(e.kind))
34 .map((e) => cg!.getNode(e.target)!.name);
35 }
36
37 it('rejects foreign calls, explicit constructors, extends and implements', async () => {
38 await index({

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByNameMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected