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

Function into

__tests__/import-default-as.test.ts:172–180  ·  view source on GitHub ↗
(target: { id: string }, kinds: Edge['kind'][])

Source from the content-addressed store, hash-verified

170 };
171 /** The edges into `target`, as `kind source-name resolvedBy`. */
172 const into = (target: { id: string }, kinds: Edge['kind'][]) =>
173 cg
174 .getIncomingEdges(target.id)
175 .filter((e) => kinds.includes(e.kind))
176 .map((e) => {
177 const meta = (e.metadata ?? {}) as { resolvedBy?: string; synthesizedBy?: string };
178 return `${e.kind} ${cg.getNode(e.source)!.name} ${meta.resolvedBy ?? meta.synthesizedBy}`;
179 })
180 .sort();
181 const route = (name: string) => {
182 const found = cg.getNodesByKind('route').find((r) => r.name === name);
183 expect(found, `route ${name}`).toBeDefined();

Callers 1

Calls 3

mapMethod · 0.80
getNodeMethod · 0.80
getIncomingEdgesMethod · 0.65

Tested by

no test coverage detected