* 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)
| 1581 | * (indexedSpelling). |
| 1582 | */ |
| 1583 | function tryWithExtensions(basePath: string, language: Language, context: ResolutionContext): string | null { |
| 1584 | for (const ext of EXTENSION_RESOLUTION[language] || []) { |
| 1585 | const candidate = indexedSpelling(basePath + ext, language); |
| 1586 | if (context.fileExists(candidate)) return candidate; |
| 1587 | } |
| 1588 | const asIs = indexedSpelling(basePath, language); |
| 1589 | if (context.fileExists(asIs)) return asIs; |
| 1590 | return findSourceForEmittedSpecifier(asIs, language, context); |
| 1591 | } |
| 1592 | |
| 1593 | /** |
| 1594 | * A path as the index keys its files. The alias, workspace and direct-path |
no test coverage detected