* 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)
| 1520 | * (indexedSpelling). |
| 1521 | */ |
| 1522 | function tryWithExtensions(basePath: string, language: Language, context: ResolutionContext): string | null { |
| 1523 | for (const ext of EXTENSION_RESOLUTION[language] || []) { |
| 1524 | const candidate = indexedSpelling(basePath + ext, language); |
| 1525 | if (context.fileExists(candidate)) return candidate; |
| 1526 | } |
| 1527 | const asIs = indexedSpelling(basePath, language); |
| 1528 | if (context.fileExists(asIs)) return asIs; |
| 1529 | return findSourceForEmittedSpecifier(asIs, language, context); |
| 1530 | } |
| 1531 | |
| 1532 | /** |
| 1533 | * A path as the index keys its files. The alias, workspace and direct-path |
no test coverage detected