File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed 
packages/jest-haste-map/src/lib Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import * as path from 'path';
99
1010// rootDir and filename must be absolute paths (resolved) 
1111export  function  relative ( rootDir : string ,  filename : string ) : string  { 
12-   return  filename . indexOf ( rootDir  +  path . sep )   ===   0 
12+   return  filename . startsWith ( rootDir  +  path . sep ) 
1313    ? filename . slice ( rootDir . length  +  1 ) 
1414    : path . relative ( rootDir ,  filename ) ; 
1515} 
@@ -19,7 +19,7 @@ const INDIRECTION_FRAGMENT = `..${path.sep}`;
1919// rootDir must be an absolute path and relativeFilename must be simple 
2020// (e.g.: foo/bar or ../foo/bar, but never ./foo or foo/../bar) 
2121export  function  resolve ( rootDir : string ,  relativeFilename : string ) : string  { 
22-   return  relativeFilename . indexOf ( INDIRECTION_FRAGMENT )   ===   0 
22+   return  relativeFilename . startsWith ( INDIRECTION_FRAGMENT ) 
2323    ? path . resolve ( rootDir ,  relativeFilename ) 
2424    : rootDir  +  path . sep  +  relativeFilename ; 
2525} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments