Whether a node is declared inside a type of its own file.
(n: Node, context: ResolutionContext)
| 66 | |
| 67 | /** Whether a node is declared inside a type of its own file. */ |
| 68 | function 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 | } |
no test coverage detected