File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed 
packages/open-next/src/utils Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ type  Options  =  { 
2+   escape ?: boolean ; 
3+   flags ?: string ; 
4+ } ; 
5+ 
16/** 
27 * Constructs a regular expression for a path that supports separators for multiple platforms 
38 *  - Uses posix separators (`/`) as the input that should be made cross-platform. 
1217 */ 
1318export  function  getCrossPlatformPathRegex ( 
1419  regex : string , 
15-   opts :  {  escape : boolean   }   =   {   escape :  true   } , 
20+   {  escape : shouldEscape   =   true ,  flags  =   "g"   } :  Options   =   { } , 
1621)  { 
1722  const  newExpr  =  ( 
18-     opts . escape  ? regex . replace ( / ( [ [ \] ( ) . * + ? ^ $ | { } \\ ] ) / g,  "\\$1" )  : regex 
23+     shouldEscape  ? regex . replace ( / ( [ [ \] ( ) . * + ? ^ $ | { } \\ ] ) / g,  "\\$1" )  : regex 
1924  ) . replaceAll ( "/" ,  String . raw `(?:\/|\\)` ) ; 
2025
21-   return  new  RegExp ( newExpr ,  "g" ) ; 
26+   return  new  RegExp ( newExpr ,  flags ) ; 
2227} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments