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

Method sameNamedTypeOfValue

src/resolution/index.ts:4777–4784  ·  view source on GitHub ↗
(value: Node)

Source from the content-addressed store, hash-verified

4775 }
4776
4777 private sameNamedTypeOfValue(value: Node): Node | null {
4778 if (value.kind !== 'constant' && value.kind !== 'variable') return null;
4779 if (value.language !== 'typescript' && value.language !== 'tsx') return null;
4780 const types = this.context
4781 .getNodesInFile(value.filePath)
4782 .filter((n) => n.name === value.name && isSupertypeTarget(n));
4783 return types.length === 1 ? types[0]! : null;
4784 }
4785
4786 private gateLanguage(result: ResolvedRef | null, ref: UnresolvedRef): ResolvedRef | null {
4787 if (!result) return result;

Callers 1

gateTargetKindMethod · 0.95

Calls 2

isSupertypeTargetFunction · 0.90
getNodesInFileMethod · 0.65

Tested by

no test coverage detected