mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
deps: update minimatch to 10.2.6
PR-URL: https://github.com/nodejs/node/pull/64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
21f79ce140
commit
51d413150a
3 files changed
+814
-1203
No files matched your search
Vendored
+128
-71
@@ -1,7 +1,11 @@
|
||||
"use strict";
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
try {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
} catch (e) {
|
||||
throw mod = 0, e;
|
||||
}
|
||||
};
|
||||
|
||||
// node_modules/balanced-match/dist/commonjs/index.js
|
||||
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
|
||||
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.EXPANSION_MAX = void 0;
|
||||
exports2.EXPANSION_MAX_LENGTH = exports2.EXPANSION_MAX = void 0;
|
||||
exports2.expand = expand;
|
||||
var balanced_match_1 = require_commonjs();
|
||||
var escSlash = "\0SLASH" + Math.random() + "\0";
|
||||
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
|
||||
var commaPattern = /\\,/g;
|
||||
var periodPattern = /\\\./g;
|
||||
exports2.EXPANSION_MAX = 1e5;
|
||||
exports2.EXPANSION_MAX_LENGTH = 4e6;
|
||||
function numeric(str) {
|
||||
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
||||
}
|
||||
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
|
||||
if (!str) {
|
||||
return [];
|
||||
}
|
||||
const { max = exports2.EXPANSION_MAX } = options;
|
||||
const { max = exports2.EXPANSION_MAX, maxLength = exports2.EXPANSION_MAX_LENGTH } = options;
|
||||
if (str.slice(0, 2) === "{}") {
|
||||
str = "\\{\\}" + str.slice(2);
|
||||
}
|
||||
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
|
||||
return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
|
||||
}
|
||||
function embrace(str) {
|
||||
return "{" + str + "}";
|
||||
@@ -142,19 +147,88 @@ var require_commonjs2 = __commonJS({
|
||||
function gte(i, y) {
|
||||
return i >= y;
|
||||
}
|
||||
function expand_(str, max, isTop) {
|
||||
const expansions = [];
|
||||
const m = (0, balanced_match_1.balanced)("{", "}", str);
|
||||
if (!m)
|
||||
return [str];
|
||||
const pre = m.pre;
|
||||
const post = m.post.length ? expand_(m.post, max, false) : [""];
|
||||
if (/\$$/.test(m.pre)) {
|
||||
for (let k = 0; k < post.length && k < max; k++) {
|
||||
const expansion = pre + "{" + m.body + "}" + post[k];
|
||||
expansions.push(expansion);
|
||||
function combine(acc, pre, values, max, maxLength, dropEmpties) {
|
||||
const out = [];
|
||||
let length = 0;
|
||||
for (let a = 0; a < acc.length; a++) {
|
||||
for (let v = 0; v < values.length; v++) {
|
||||
if (out.length >= max)
|
||||
return out;
|
||||
const expansion = acc[a] + pre + values[v];
|
||||
if (dropEmpties && !expansion)
|
||||
continue;
|
||||
if (length + expansion.length > maxLength)
|
||||
return out;
|
||||
out.push(expansion);
|
||||
length += expansion.length;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
function expandSequence(body, isAlphaSequence, max, maxLength) {
|
||||
const n = body.split(/\.\./);
|
||||
const N = [];
|
||||
if (n[0] === void 0 || n[1] === void 0) {
|
||||
return N;
|
||||
}
|
||||
const x = numeric(n[0]);
|
||||
const y = numeric(n[1]);
|
||||
const width = Math.max(n[0].length, n[1].length);
|
||||
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
||||
let test = lte;
|
||||
const reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
const pad = n.some(isPadded);
|
||||
let length = 0;
|
||||
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
||||
let c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === "\\") {
|
||||
c = "";
|
||||
}
|
||||
} else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
const need = width - c.length;
|
||||
if (need > 0) {
|
||||
const z = new Array(need + 1).join("0");
|
||||
if (i < 0) {
|
||||
c = "-" + z + c.slice(1);
|
||||
} else {
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (length + c.length > maxLength)
|
||||
break;
|
||||
N.push(c);
|
||||
length += c.length;
|
||||
}
|
||||
return N;
|
||||
}
|
||||
function expand_(str, max, maxLength, isTop) {
|
||||
let acc = [""];
|
||||
let dropEmpties = false;
|
||||
let firstGroup = true;
|
||||
for (; ; ) {
|
||||
const m = (0, balanced_match_1.balanced)("{", "}", str);
|
||||
if (!m) {
|
||||
return combine(acc, str, [""], max, maxLength, dropEmpties);
|
||||
}
|
||||
const pre = m.pre;
|
||||
if (/\$$/.test(pre)) {
|
||||
acc = combine(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length);
|
||||
firstGroup = false;
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isSequence = isNumericSequence || isAlphaSequence;
|
||||
@@ -162,75 +236,58 @@ var require_commonjs2 = __commonJS({
|
||||
if (!isSequence && !isOptions) {
|
||||
if (m.post.match(/,(?!,).*\}/)) {
|
||||
str = m.pre + "{" + m.body + escClose + m.post;
|
||||
return expand_(str, max, true);
|
||||
isTop = true;
|
||||
continue;
|
||||
}
|
||||
return [str];
|
||||
return combine(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties);
|
||||
}
|
||||
let n;
|
||||
if (firstGroup) {
|
||||
dropEmpties = isTop && !isSequence;
|
||||
firstGroup = false;
|
||||
}
|
||||
let values;
|
||||
if (isSequence) {
|
||||
n = m.body.split(/\.\./);
|
||||
values = expandSequence(m.body, isAlphaSequence, max, maxLength);
|
||||
} else {
|
||||
n = parseCommaParts(m.body);
|
||||
let n = parseCommaParts(m.body);
|
||||
if (n.length === 1 && n[0] !== void 0) {
|
||||
n = expand_(n[0], max, false).map(embrace);
|
||||
n = expand_(n[0], max, maxLength, false).map(embrace);
|
||||
if (n.length === 1) {
|
||||
return post.map((p) => m.pre + n[0] + p);
|
||||
acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
let N;
|
||||
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
|
||||
const x = numeric(n[0]);
|
||||
const y = numeric(n[1]);
|
||||
const width = Math.max(n[0].length, n[1].length);
|
||||
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
||||
let test = lte;
|
||||
const reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
let dropsEmpties = dropEmpties && !m.post.length && !pre;
|
||||
for (let d = 0; dropsEmpties && d < acc.length; d++) {
|
||||
if (acc[d]) {
|
||||
dropsEmpties = false;
|
||||
}
|
||||
}
|
||||
const pad = n.some(isPadded);
|
||||
N = [];
|
||||
for (let i = x; test(i, y); i += incr) {
|
||||
let c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === "\\") {
|
||||
c = "";
|
||||
values = [];
|
||||
let valuesLength = 0;
|
||||
outer: for (let j = 0; j < n.length; j++) {
|
||||
const expanded = expand_(n[j], max, maxLength, false);
|
||||
for (let k = 0; k < expanded.length; k++) {
|
||||
const v = expanded[k];
|
||||
if (dropsEmpties && !v)
|
||||
continue;
|
||||
if (values.length >= max || valuesLength + v.length > maxLength) {
|
||||
break outer;
|
||||
}
|
||||
} else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
const need = width - c.length;
|
||||
if (need > 0) {
|
||||
const z = new Array(need + 1).join("0");
|
||||
if (i < 0) {
|
||||
c = "-" + z + c.slice(1);
|
||||
} else {
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
N.push(c);
|
||||
}
|
||||
} else {
|
||||
N = [];
|
||||
for (let j = 0; j < n.length; j++) {
|
||||
N.push.apply(N, expand_(n[j], max, false));
|
||||
}
|
||||
}
|
||||
for (let j = 0; j < N.length; j++) {
|
||||
for (let k = 0; k < post.length && expansions.length < max; k++) {
|
||||
const expansion = pre + N[j] + post[k];
|
||||
if (!isTop || isSequence || expansion) {
|
||||
expansions.push(expansion);
|
||||
values.push(v);
|
||||
valuesLength += v.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
}
|
||||
return expansions;
|
||||
return acc;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+676
-1122
File diff suppressed because it is too large.
Load diff
Vendored
+10
-10
@@ -2,7 +2,7 @@
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
|
||||
"name": "minimatch",
|
||||
"description": "a glob matcher in javascript",
|
||||
"version": "10.2.5",
|
||||
"version": "10.2.6",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:isaacs/minimatch"
|
||||
@@ -46,15 +46,15 @@
|
||||
"node": "18 || 20 || >=22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.5.0",
|
||||
"esbuild": "^0.28.0",
|
||||
"@types/node": "^26.1.2",
|
||||
"esbuild": "^0.28.1",
|
||||
"mkdirp": "^3.0.1",
|
||||
"oxlint": "^1.57.0",
|
||||
"oxlint-tsgolint": "^0.18.1",
|
||||
"prettier": "^3.8.1",
|
||||
"tap": "^21.6.2",
|
||||
"tshy": "^4.0.0",
|
||||
"typedoc": "^0.28.18"
|
||||
"oxlint": "^1.76.0",
|
||||
"oxlint-tsgolint": "^7.0.2001",
|
||||
"prettier": "^3.9.6",
|
||||
"tap": "^21.7.5",
|
||||
"tshy": "^4.1.3",
|
||||
"typedoc": "^0.28.20"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
@@ -70,6 +70,6 @@
|
||||
"type": "module",
|
||||
"module": "./dist/esm/index.js",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^5.0.5"
|
||||
"brace-expansion": "^5.0.8"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user