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

Function declaredValue

src/resolution/frameworks/react.ts:729–732  ·  view source on GitHub ↗

The module-level `const`, `let` or `var` `filePath` declares as `name`.

(name: string, filePath: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

727
728/** The module-level `const`, `let` or `var` `filePath` declares as `name`. */
729function declaredValue(name: string, filePath: string, context: ResolutionContext): Node | undefined {
730 return (context.getNodesInFileNamed?.(filePath, name) ?? context.getNodesInFile(filePath).filter((n) => n.name === name))
731 .find((n) => (n.kind === 'constant' || n.kind === 'variable') && n.qualifiedName === name);
732}
733
734/**
735 * The module a value's initializer hands a lazy loader, and the export the

Callers 2

declaredComponentFunction · 0.85
declaredLoaderFunction · 0.85

Calls 2

getNodesInFileNamedMethod · 0.80
getNodesInFileMethod · 0.65

Tested by

no test coverage detected