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

Function ownDeclarations

src/resolution/frameworks/react.ts:2399–2402  ·  view source on GitHub ↗

* What `filePath` declares at its top level under `name`: a type alias, an * interface, a class, an enum, a function, a component or a value. A * declaration nested in another (`EmojiMenu::renderMenuItem`) carries its * owner in its qualified name; an import is no declaration.

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

Source from the content-addressed store, hash-verified

2397 * owner in its qualified name; an import is no declaration.
2398 */
2399function ownDeclarations(name: string, filePath: string, context: ResolutionContext): Node[] {
2400 return (context.getNodesInFileNamed?.(filePath, name) ?? context.getNodesInFile(filePath).filter((n) => n.name === name))
2401 .filter((n) => n.qualifiedName === name && n.kind !== 'import' && n.kind !== 'export' && n.kind !== 'file');
2402}
2403
2404/**
2405 * Whether a reference is written where TypeScript reads a type: what a class

Callers 1

resolveFunction · 0.85

Calls 2

getNodesInFileNamedMethod · 0.80
getNodesInFileMethod · 0.65

Tested by

no test coverage detected