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

Function node

__tests__/react-own-declaration.test.ts:202–206  ·  view source on GitHub ↗
(g: CodeGraph, file: string, name: string, kind?: string)

Source from the content-addressed store, hash-verified

200});
201
202function node(g: CodeGraph, file: string, name: string, kind?: string): Node {
203 const found = g.getNodesInFile(file).filter((n) => n.name === name && (!kind || n.kind === kind));
204 expect(found, `${kind ?? 'node'} ${name} in ${file}`).toHaveLength(1);
205 return found[0]!;
206}
207
208/** Where a node's references named `name` go, `kind:name@file`, and which strategy resolved each. */
209function referencesFrom(g: CodeGraph, from: Node, name: string, edgeKind = 'references') {

Callers 1

Calls 1

getNodesInFileMethod · 0.65

Tested by

no test coverage detected