File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -643,15 +643,13 @@ namespace ts {
643643 onlyRecordFailures = ! directoryProbablyExists ( directory , state . host ) ;
644644 }
645645 }
646+ return forEach ( extensions , tryLoad ) ;
646647
647- return forEach ( extensions , ext => {
648+ function tryLoad ( ext : string ) : string {
648649 if ( state . skipTsx && ( ext === ".jsx" || ext === ".tsx" ) ) {
649- return ;
650+ return undefined ;
650651 }
651- return tryLoad ( fileExtensionIs ( candidate , ext ) ? candidate : candidate + ext ) ;
652- } ) ;
653-
654- function tryLoad ( fileName : string ) : string {
652+ const fileName = fileExtensionIs ( candidate , ext ) ? candidate : candidate + ext ;
655653 if ( ! onlyRecordFailures && state . host . fileExists ( fileName ) ) {
656654 if ( state . traceEnabled ) {
657655 trace ( state . host , Diagnostics . File_0_exist_use_it_as_a_name_resolution_result , fileName ) ;
You can’t perform that action at this time.
0 commit comments