File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -78,11 +78,14 @@ exports.removeGlobalNodeModuleLookupPaths = function () {
7878 // @ts -ignore
7979 Module . _resolveLookupPaths = function ( moduleName , parent ) {
8080 const paths = originalResolveLookupPaths ( moduleName , parent ) ;
81- let commonSuffixLength = 0 ;
82- while ( commonSuffixLength < paths . length && paths [ paths . length - 1 - commonSuffixLength ] === globalPaths [ globalPaths . length - 1 - commonSuffixLength ] ) {
83- commonSuffixLength ++ ;
81+ if ( Array . isArray ( paths ) ) {
82+ let commonSuffixLength = 0 ;
83+ while ( commonSuffixLength < paths . length && paths [ paths . length - 1 - commonSuffixLength ] === globalPaths [ globalPaths . length - 1 - commonSuffixLength ] ) {
84+ commonSuffixLength ++ ;
85+ }
86+ return paths . slice ( 0 , paths . length - commonSuffixLength ) ;
8487 }
85- return paths . slice ( 0 , paths . length - commonSuffixLength ) ;
88+ return paths ;
8689 } ;
8790} ;
8891
You can’t perform that action at this time.
0 commit comments