diff options
Diffstat (limited to 'fs/globrex.ts')
-rw-r--r-- | fs/globrex.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/globrex.ts b/fs/globrex.ts index 56def02f8..32a129a67 100644 --- a/fs/globrex.ts +++ b/fs/globrex.ts @@ -76,7 +76,8 @@ export function globrex( if (split) { if (last) segment += str; if (segment !== "") { - if (!flags.includes("g")) segment = `^${segment}$`; // change it 'includes' + // change it 'includes' + if (!flags.includes("g")) segment = `^${segment}$`; path.segments.push(new RegExp(segment, flags)); } segment = ""; @@ -265,8 +266,10 @@ export function globrex( // globstar is enabled, so determine if this is a globstar segment let isGlobstar = starCount > 1 && // multiple "*"'s - (prevChar === "/" || prevChar === undefined) && // from the start of the segment - (nextChar === "/" || nextChar === undefined); // to the end of the segment + // from the start of the segment + (prevChar === "/" || prevChar === undefined) && + // to the end of the segment + (nextChar === "/" || nextChar === undefined); if (isGlobstar) { // it's a globstar, so match zero or more path segments add(GLOBSTAR, { only: "regex" }); |