The file that declares the namespace a module exports as `name`, through its re-exports, and the name it declares it under.
( file: string, name: string, language: Language, context: ResolutionContext, depth = 0, )
| 3260 | |
| 3261 | /** The file that declares the namespace a module exports as `name`, through its re-exports, and the name it declares it under. */ |
| 3262 | function namespaceDeclaringFile( |
| 3263 | file: string, |
| 3264 | name: string, |
| 3265 | language: Language, |
| 3266 | context: ResolutionContext, |
| 3267 | depth = 0, |
| 3268 | ): { file: string; name: string } | undefined { |
| 3269 | if (depth > REEXPORT_MAX_DEPTH) return undefined; |
| 3270 | if (namespaceBlocks(file, context).some((b) => b.path === name || b.path.startsWith(`${name}.`))) return { file, name }; |
| 3271 | for (const rex of context.getReExports?.(file, language) ?? []) { |
| 3272 | if (rex.kind !== 'wildcard' && !(rex.kind === 'named' && rex.exportedName === name)) continue; |
| 3273 | const next = resolveImportPath(rex.source, file, language, context); |
| 3274 | const found = next ? namespaceDeclaringFile(next, rex.kind === 'named' ? rex.originalName : name, language, context, depth + 1) : undefined; |
| 3275 | if (found) return found; |
| 3276 | } |
| 3277 | return undefined; |
| 3278 | } |
| 3279 | |
| 3280 | /** |
| 3281 | * The module whose namespace object `file` exports as `name`, when that |
no test coverage detected