Skip to content

Commit

Permalink
remove group names
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Sep 16, 2024
1 parent a4cfa77 commit d0f4f5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export function globSync(patternsOrOptions: string | string[] | GlobOptions, opt
*/
const UNESCAPED_GLOB_SYMBOLS_RE =
os.platform() === 'win32'
? /(?<escape>\\?)(?<symbols>[()[\]{}]|^!|[!+@](?=\())/g
: /(?<escape>\\?)(?<symbols>[()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
? /(\\?)([()[\]{}]|^!|[!+@](?=\())/g
: /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;

export const escapePath = (pattern: string): string => pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');

0 comments on commit d0f4f5e

Please sign in to comment.