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

Function isNestedType

src/resolution/frameworks/name-heuristic.ts:68–73  ·  view source on GitHub ↗

Whether a node is declared inside a type of its own file.

(n: Node, context: ResolutionContext)

Source from the content-addressed store, hash-verified

66
67/** Whether a node is declared inside a type of its own file. */
68function isNestedType(n: Node, context: ResolutionContext): boolean {
69 const cut = n.qualifiedName.lastIndexOf('::');
70 if (cut < 0) return false;
71 const owner = n.qualifiedName.slice(0, cut);
72 return context.getNodesInFile(n.filePath).some((p) => p.qualifiedName === owner && TYPE_OWNER_KINDS.has(p.kind));
73}

Callers 1

pickByNameAndKindFunction · 0.85

Calls 2

hasMethod · 0.80
getNodesInFileMethod · 0.65

Tested by

no test coverage detected