* The file `basePath` names: with the language's extensions or index files, as * is, or as an emitted `.js` — each spelled as the index keys it * (indexedSpelling).
(basePath: string, language: Language, context: ResolutionContext)
| 1829 | * (indexedSpelling). |
| 1830 | */ |
| 1831 | function tryWithExtensions(basePath: string, language: Language, context: ResolutionContext): string | null { |
| 1832 | for (const ext of EXTENSION_RESOLUTION[language] || []) { |
| 1833 | const candidate = indexedSpelling(basePath + ext, language); |
| 1834 | if (context.fileExists(candidate)) return candidate; |
| 1835 | } |
| 1836 | const asIs = indexedSpelling(basePath, language); |
| 1837 | if (context.fileExists(asIs)) return asIs; |
| 1838 | return findSourceForEmittedSpecifier(asIs, language, context); |
| 1839 | } |
| 1840 | |
| 1841 | /** |
| 1842 | * A path as the index keys its files. The alias, workspace and direct-path |
no test coverage detected