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

Function proxyEdges

__tests__/nextjs-proxy.test.ts:218–219  ·  view source on GitHub ↗
(cg: CodeGraph)

Source from the content-addressed store, hash-verified

216 const manifest = (next: string): string => JSON.stringify({ name: 'web', dependencies: { next, react: '19.0.0' } });
217 const meta = (e: Edge): Record<string, unknown> => (e.metadata ?? {}) as Record<string, unknown>;
218 const proxyEdges = (cg: CodeGraph): Edge[] =>
219 cg.getNodesByKind('route').flatMap((r) => cg.getOutgoingEdges(r.id).filter((e) => meta(e).synthesizedBy === 'next-proxy'));
220 const routesRunning = (cg: CodeGraph, target: Node): Record<string, unknown> =>
221 Object.fromEntries(
222 proxyEdges(cg).filter((e) => e.target === target.id).map((e) => [cg.getNode(e.source)!.name, meta(e).matcher ?? null])

Callers 3

routesRunningFunction · 0.85
namesFunction · 0.85

Calls 3

metaFunction · 0.70
getNodesByKindMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected