@@ -620,9 +620,9 @@ namespace ts {
620620 */
621621 function loadModuleFromFile ( candidate : string , extensions : string [ ] , failedLookupLocation : string [ ] , onlyRecordFailures : boolean , state : ModuleResolutionState ) : string {
622622 // First try to keep/add an extension: importing "./foo.ts" can be matched by a file "./foo.ts", and "./foo" by "./foo.d.ts"
623- const keepOrAddExtension = loadModuleFromFileWorker ( candidate , extensions , failedLookupLocation , onlyRecordFailures , state ) ;
624- if ( keepOrAddExtension ) {
625- return keepOrAddExtension ;
623+ const resolvedByAddingOrKeepingExtension = loadModuleFromFileWorker ( candidate , extensions , failedLookupLocation , onlyRecordFailures , state ) ;
624+ if ( resolvedByAddingOrKeepingExtension ) {
625+ return resolvedByAddingOrKeepingExtension ;
626626 }
627627 // Then try stripping a ".js" or ".jsx" extension and replacing it with a TypeScript one, e.g. "./foo.js" can be matched by "./foo.ts" or "./foo.d.ts"
628628 if ( hasJavaScriptFileExtension ( candidate ) ) {
@@ -634,9 +634,10 @@ namespace ts {
634634 return loadModuleFromFileWorker ( extensionless , extensions , failedLookupLocation , onlyRecordFailures , state ) ;
635635 }
636636 }
637+
637638 function loadModuleFromFileWorker ( candidate : string , extensions : string [ ] , failedLookupLocation : string [ ] , onlyRecordFailures : boolean , state : ModuleResolutionState ) : string {
638639 if ( ! onlyRecordFailures ) {
639- // check if containig folder exists - if it doesn't then just record failures for all supported extensions without disk probing
640+ // check if containing folder exists - if it doesn't then just record failures for all supported extensions without disk probing
640641 const directory = getDirectoryPath ( candidate ) ;
641642 if ( directory ) {
642643 onlyRecordFailures = ! directoryProbablyExists ( directory , state . host ) ;
0 commit comments