Skip to content

Commit 48bd124

Browse files
nodejs-github-botMoLow
authored andcommitted
deps: update minimatch to 9.0.1
PR-URL: #48094 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent d4572d3 commit 48bd124

File tree

8 files changed

+59
-72
lines changed

8 files changed

+59
-72
lines changed

deps/minimatch/index.js

+14-19
Original file line numberDiff line numberDiff line change
@@ -1405,26 +1405,21 @@ var Minimatch = class {
14051405
matchOne(file, pattern, partial = false) {
14061406
const options = this.options;
14071407
if (this.isWindows) {
1408-
const fileUNC = file[0] === "" && file[1] === "" && file[2] === "?" && typeof file[3] === "string" && /^[a-z]:$/i.test(file[3]);
1409-
const patternUNC = pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
1410-
if (fileUNC && patternUNC) {
1411-
const fd = file[3];
1412-
const pd = pattern[3];
1408+
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
1409+
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
1410+
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
1411+
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
1412+
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
1413+
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
1414+
if (typeof fdi === "number" && typeof pdi === "number") {
1415+
const [fd, pd] = [file[fdi], pattern[pdi]];
14131416
if (fd.toLowerCase() === pd.toLowerCase()) {
1414-
file[3] = pd;
1415-
}
1416-
} else if (patternUNC && typeof file[0] === "string") {
1417-
const pd = pattern[3];
1418-
const fd = file[0];
1419-
if (pd.toLowerCase() === fd.toLowerCase()) {
1420-
pattern[3] = fd;
1421-
pattern = pattern.slice(3);
1422-
}
1423-
} else if (fileUNC && typeof pattern[0] === "string") {
1424-
const fd = file[3];
1425-
if (fd.toLowerCase() === pattern[0].toLowerCase()) {
1426-
pattern[0] = fd;
1427-
file = file.slice(3);
1417+
pattern[pdi] = fd;
1418+
if (pdi > fdi) {
1419+
pattern = pattern.slice(pdi);
1420+
} else if (fdi > pdi) {
1421+
file = file.slice(fdi);
1422+
}
14281423
}
14291424
}
14301425
}

deps/minimatch/src/dist/cjs/index.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

deps/minimatch/src/dist/cjs/index.js

+20-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/minimatch/src/dist/cjs/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/minimatch/src/dist/mjs/index.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

deps/minimatch/src/dist/mjs/index.js

+20-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/minimatch/src/dist/mjs/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)