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

Function symIn

__tests__/react-router.test.ts:235–239  ·  view source on GitHub ↗
(name: string, file: string)

Source from the content-addressed store, hash-verified

233 // symbol of its own (#1669), so a navigation it makes is ITS edge — the same
234 // shape a `useCallback` handler has — and the screen reaches it by calling it.
235 const symIn = (name: string, file: string): Node => {
236 const n = cg.getNodesByName(name).find((n) => n.kind !== 'route' && n.kind !== 'file' && n.kind !== 'import' && n.filePath.endsWith(file));
237 if (!n) throw new Error(`no symbol ${name} in ${file}`);
238 return n;
239 };
240 const navs = (from: Node) => cg.getOutgoingEdges(from.id).filter((e) => e.kind === 'navigates');
241 const hrefs = (from: Node) =>
242 navs(from)

Callers 1

Calls 1

getNodesByNameMethod · 0.65

Tested by

no test coverage detected