8000 Probably works · weswigham/TypeScript@bf03421 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf03421

Browse files
committed
Probably works
1 parent d962091 commit bf03421

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/moduleNameResolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,9 +1498,9 @@ namespace ts {
14981498
}
14991499

15001500
function loadJSOrExactTSFileName(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined {
1501-
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && fileExtensionIsOneOf(candidate, [Extension.Dts, Extension.Dcts, Extension.Dmts])) {
1501+
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && fileExtensionIsOneOf(candidate, supportedTSExtensionsFlat)) {
15021502
const result = tryFile(candidate, onlyRecordFailures, state);
1503-
return result !== undefined ? { path: candidate, ext: forEach([Extension.Dts, Extension.Dcts, Extension.Dmts], e => fileExtensionIs(candidate, e) ? e : undefined)! } : undefined;
1503+
return result !== undefined ? { path: candidate, ext: tryExtractTSExtension(candidate) as Extension } : undefined;
15041504
}
15051505

15061506
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);

0 commit comments

Comments
 (0)
0