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

Function routeTarget

__tests__/codeigniter.test.ts:122–126  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

120 };
121
122 const routeTarget = (name: string): string | undefined => {
123 const route = cg.getNodesByKind('route').find((n) => n.name === name);
124 if (!route) throw new Error(`no route ${name}`);
125 return cg.getOutgoingEdges(route.id).filter((e) => e.kind === 'references').map((e) => cg.getNode(e.target)?.qualifiedName)[0];
126 };
127
128 beforeAll(async () => {
129 dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-codeigniter-'));

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected