Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
  • Loading branch information
tlouisse committed May 13, 2024
1 parent 841ab68 commit 864c383
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,37 @@ export function parseGlobToRegex(glob, providedOpts) {
const charsToEscape = ['/', '$', '^', '+', '.', '(', ')', '=', '!', '|'];
if (charsToEscape.includes(currentChar)) {
regexResultStr += `\\${currentChar}`;
continue;
continue; // eslint-disable-line no-continue
}

if (options.extglob) {
if (currentChar === '?') {
regexResultStr += '.';
continue;
continue; // eslint-disable-line no-continue
}
if (['[', ']'].includes(currentChar)) {
regexResultStr += currentChar;
continue;
continue; // eslint-disable-line no-continue
}
if (currentChar === '{') {
isInGroup = true;
regexResultStr += '(';
continue;
continue; // eslint-disable-line no-continue
}
if (currentChar === '}') {
isInGroup = false;
regexResultStr += ')';
continue;
continue; // eslint-disable-line no-continue
}
}

if (currentChar === ',') {
if (isInGroup) {
regexResultStr += '|';
continue;
continue; // eslint-disable-line no-continue
}
regexResultStr += `\\${currentChar}`;
continue;
continue; // eslint-disable-line no-continue
}

if (currentChar === '*') {
Expand All @@ -104,7 +104,7 @@ export function parseGlobToRegex(glob, providedOpts) {
regexResultStr += '([^/]*)';
}
}
continue;
continue; // eslint-disable-line no-continue
}

regexResultStr += currentChar;
Expand Down Expand Up @@ -266,7 +266,7 @@ export async function optimisedGlob(globOrGlobs, providedOptions = {}) {
filteredPaths = filteredPaths.map(f => `${driveLetter}:${f}`);
}
}
console.debug({ filteredPaths });
console.debug({ filteredPathsAfterAbso: filteredPaths });

if (options.deep !== Infinity) {
filteredPaths = filteredPaths.filter(f => f.split('/').length <= options.deep + 2);
Expand Down

0 comments on commit 864c383

Please sign in to comment.