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

Method sameNamedTypeOfValue

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

Source from the content-addressed store, hash-verified

5166 }
5167
5168 private sameNamedTypeOfValue(value: Node): Node | null {
5169 if (value.kind !== 'constant' && value.kind !== 'variable') return null;
5170 if (value.language !== 'typescript' && value.language !== 'tsx') return null;
5171 const types = this.context
5172 .getNodesInFile(value.filePath)
5173 .filter((n) => n.name === value.name && isSupertypeTarget(n));
5174 return types.length === 1 ? types[0]! : null;
5175 }
5176
5177 private gateLanguage(result: ResolvedRef | null, ref: UnresolvedRef): ResolvedRef | null {
5178 if (!result) return result;

Callers 1

gateTargetKindMethod · 0.95

Calls 2

isSupertypeTargetFunction · 0.90
getNodesInFileMethod · 0.65

Tested by

no test coverage detected