Skip to content

Commit fb450ab

Browse files
committed
deps: minimatch@10.2.5
(cherry picked from commit 87bb9d0)
1 parent 7c4bbbf commit fb450ab

12 files changed

Lines changed: 112 additions & 92 deletions

File tree

node_modules/brace-expansion/dist/commonjs/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ function expand_(str, max, isTop) {
144144
const x = numeric(n[0]);
145145
const y = numeric(n[1]);
146146
const width = Math.max(n[0].length, n[1].length);
147-
let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1;
147+
let incr = n.length === 3 && n[2] !== undefined ?
148+
Math.max(Math.abs(numeric(n[2])), 1)
149+
: 1;
148150
let test = lte;
149151
const reverse = y < x;
150152
if (reverse) {

node_modules/brace-expansion/dist/esm/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ function expand_(str, max, isTop) {
140140
const x = numeric(n[0]);
141141
const y = numeric(n[1]);
142142
const width = Math.max(n[0].length, n[1].length);
143-
let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1;
143+
let incr = n.length === 3 && n[2] !== undefined ?
144+
Math.max(Math.abs(numeric(n[2])), 1)
145+
: 1;
144146
let test = lte;
145147
const reverse = y < x;
146148
if (reverse) {

node_modules/brace-expansion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "brace-expansion",
33
"description": "Brace expansion as known from sh/bash",
4-
"version": "5.0.4",
4+
"version": "5.0.5",
55
"files": [
66
"dist"
77
],

node_modules/minimatch/dist/commonjs/ast.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,14 @@ class AST {
192192
}
193193
// reconstructs the pattern
194194
toString() {
195-
if (this.#toString !== undefined)
196-
return this.#toString;
197-
if (!this.type) {
198-
return (this.#toString = this.#parts.map(p => String(p)).join(''));
199-
}
200-
else {
201-
return (this.#toString =
202-
this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
203-
}
195+
return (this.#toString !== undefined ? this.#toString
196+
: !this.type ?
197+
(this.#toString = this.#parts.map(p => String(p)).join(''))
198+
: (this.#toString =
199+
this.type +
200+
'(' +
201+
this.#parts.map(p => String(p)).join('|') +
202+
')'));
204203
}
205204
#fillNegs() {
206205
/* c8 ignore start */
@@ -480,7 +479,7 @@ class AST {
480479
}
481480
#canUsurpType(c) {
482481
const m = usurpMap.get(this.type);
483-
return !!(m?.has(c));
482+
return !!m?.has(c);
484483
}
485484
#canUsurp(child) {
486485
if (!child ||

node_modules/minimatch/dist/commonjs/index.js

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const minimatch = (p, pattern, options = {}) => {
1616
};
1717
exports.minimatch = minimatch;
1818
// Optimized checking for the most common glob patterns.
19-
const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
19+
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
2020
const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
2121
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
2222
const starDotExtTestNocase = (ext) => {
@@ -35,7 +35,7 @@ const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
3535
const starRE = /^\*+$/;
3636
const starTest = (f) => f.length !== 0 && !f.startsWith('.');
3737
const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
38-
const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
38+
const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
3939
const qmarksTestNocase = ([$0, ext = '']) => {
4040
const noext = qmarksTestNoExt([$0]);
4141
if (!ext)
@@ -267,6 +267,7 @@ class Minimatch {
267267
// step 2: expand braces
268268
this.globSet = [...new Set(this.braceExpand())];
269269
if (options.debug) {
270+
//oxlint-disable-next-line no-console
270271
this.debug = (...args) => console.error(...args);
271272
}
272273
this.debug(this.pattern, this.globSet);
@@ -329,10 +330,10 @@ class Minimatch {
329330
preprocess(globParts) {
330331
// if we're not in globstar mode, then turn ** into *
331332
if (this.options.noglobstar) {
332-
for (let i = 0; i < globParts.length; i++) {
333-
for (let j = 0; j < globParts[i].length; j++) {
334-
if (globParts[i][j] === '**') {
335-
globParts[i][j] = '*';
333+
for (const partset of globParts) {
334+
for (let j = 0; j < partset.length; j++) {
335+
if (partset[j] === '**') {
336+
partset[j] = '*';
336337
}
337338
}
338339
}
@@ -420,7 +421,11 @@ class Minimatch {
420421
let dd = 0;
421422
while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
422423
const p = parts[dd - 1];
423-
if (p && p !== '.' && p !== '..' && p !== '**') {
424+
if (p &&
425+
p !== '.' &&
426+
p !== '..' &&
427+
p !== '**' &&
428+
!(this.isWindows && /^[a-z]:$/i.test(p))) {
424429
didSomething = true;
425430
parts.splice(dd - 1, 2);
426431
dd -= 2;
@@ -669,15 +674,17 @@ class Minimatch {
669674
// split the pattern up into globstar-delimited sections
670675
// the tail has to be at the end, and the others just have
671676
// to be found in order from the head.
672-
const [head, body, tail] = partial ? [
673-
pattern.slice(patternIndex, firstgs),
674-
pattern.slice(firstgs + 1),
675-
[],
676-
] : [
677-
pattern.slice(patternIndex, firstgs),
678-
pattern.slice(firstgs + 1, lastgs),
679-
pattern.slice(lastgs + 1),
680-
];
677+
const [head, body, tail] = partial ?
678+
[
679+
pattern.slice(patternIndex, firstgs),
680+
pattern.slice(firstgs + 1),
681+
[],
682+
]
683+
: [
684+
pattern.slice(patternIndex, firstgs),
685+
pattern.slice(firstgs + 1, lastgs),
686+
pattern.slice(lastgs + 1),
687+
];
681688
// check the head, from the current file/pattern index.
682689
if (head.length) {
683690
const fileHead = file.slice(fileIndex, fileIndex + head.length);
@@ -1023,7 +1030,7 @@ class Minimatch {
10231030
this.regexp = new RegExp(re, [...flags].join(''));
10241031
/* c8 ignore start */
10251032
}
1026-
catch (ex) {
1033+
catch {
10271034
// should be impossible
10281035
this.regexp = false;
10291036
}
@@ -1038,7 +1045,7 @@ class Minimatch {
10381045
if (this.preserveMultipleSlashes) {
10391046
return p.split('/');
10401047
}
1041-
else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
1048+
else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
10421049
// add an extra '' for the one we lose
10431050
return ['', ...p.split(/\/+/)];
10441051
}
@@ -1080,8 +1087,7 @@ class Minimatch {
10801087
filename = ff[i];
10811088
}
10821089
}
1083-
for (let i = 0; i < set.length; i++) {
1084-
const pattern = set[i];
1090+
for (const pattern of set) {
10851091
let file = ff;
10861092
if (options.matchBase && pattern.length === 1) {
10871093
file = [filename];

node_modules/minimatch/dist/commonjs/unescape.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ exports.unescape = void 0;
2323
const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
2424
if (magicalBraces) {
2525
return windowsPathsNoEscape ?
26-
s.replace(/\[([^\/\\])\]/g, '$1')
26+
s.replace(/\[([^/\\])\]/g, '$1')
2727
: s
28-
.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
29-
.replace(/\\([^\/])/g, '$1');
28+
.replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
29+
.replace(/\\([^/])/g, '$1');
3030
}
3131
return windowsPathsNoEscape ?
32-
s.replace(/\[([^\/\\{}])\]/g, '$1')
32+
s.replace(/\[([^/\\{}])\]/g, '$1')
3333
: s
34-
.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
35-
.replace(/\\([^\/{}])/g, '$1');
34+
.replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
35+
.replace(/\\([^/{}])/g, '$1');
3636
};
3737
exports.unescape = unescape;
3838
//# sourceMappingURL=unescape.js.map

node_modules/minimatch/dist/esm/ast.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,14 @@ export class AST {
189189
}
190190
// reconstructs the pattern
191191
toString() {
192-
if (this.#toString !== undefined)
193-
return this.#toString;
194-
if (!this.type) {
195-
return (this.#toString = this.#parts.map(p => String(p)).join(''));
196-
}
197-
else {
198-
return (this.#toString =
199-
this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
200-
}
192+
return (this.#toString !== undefined ? this.#toString
193+
: !this.type ?
194+
(this.#toString = this.#parts.map(p => String(p)).join(''))
195+
: (this.#toString =
196+
this.type +
197+
'(' +
198+
this.#parts.map(p => String(p)).join('|') +
199+
')'));
201200
}
202201
#fillNegs() {
203202
/* c8 ignore start */
@@ -477,7 +476,7 @@ export class AST {
477476
}
478477
#canUsurpType(c) {
479478
const m = usurpMap.get(this.type);
480-
return !!(m?.has(c));
479+
return !!m?.has(c);
481480
}
482481
#canUsurp(child) {
483482
if (!child ||

node_modules/minimatch/dist/esm/index.js

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const minimatch = (p, pattern, options = {}) => {
1212
return new Minimatch(pattern, options).match(p);
1313
};
1414
// Optimized checking for the most common glob patterns.
15-
const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
15+
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
1616
const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
1717
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
1818
const starDotExtTestNocase = (ext) => {
@@ -31,7 +31,7 @@ const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
3131
const starRE = /^\*+$/;
3232
const starTest = (f) => f.length !== 0 && !f.startsWith('.');
3333
const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
34-
const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
34+
const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
3535
const qmarksTestNocase = ([$0, ext = '']) => {
3636
const noext = qmarksTestNoExt([$0]);
3737
if (!ext)
@@ -258,6 +258,7 @@ export class Minimatch {
258258
// step 2: expand braces
259259
this.globSet = [...new Set(this.braceExpand())];
260260
if (options.debug) {
261+
//oxlint-disable-next-line no-console
261262
this.debug = (...args) => console.error(...args);
262263
}
263264
this.debug(this.pattern, this.globSet);
@@ -320,10 +321,10 @@ export class Minimatch {
320321
preprocess(globParts) {
321322
// if we're not in globstar mode, then turn ** into *
322323
if (this.options.noglobstar) {
323-
for (let i = 0; i < globParts.length; i++) {
324-
for (let j = 0; j < globParts[i].length; j++) {
325-
if (globParts[i][j] === '**') {
326-
globParts[i][j] = '*';
324+
for (const partset of globParts) {
325+
for (let j = 0; j < partset.length; j++) {
326+
if (partset[j] === '**') {
327+
partset[j] = '*';
327328
}
328329
}
329330
}
@@ -411,7 +412,11 @@ export class Minimatch {
411412
let dd = 0;
412413
while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
413414
const p = parts[dd - 1];
414-
if (p && p !== '.' && p !== '..' && p !== '**') {
415+
if (p &&
416+
p !== '.' &&
417+
p !== '..' &&
418+
p !== '**' &&
419+
!(this.isWindows && /^[a-z]:$/i.test(p))) {
415420
didSomething = true;
416421
parts.splice(dd - 1, 2);
417422
dd -= 2;
@@ -660,15 +665,17 @@ export class Minimatch {
660665
// split the pattern up into globstar-delimited sections
661666
// the tail has to be at the end, and the others just have
662667
// to be found in order from the head.
663-
const [head, body, tail] = partial ? [
664-
pattern.slice(patternIndex, firstgs),
665-
pattern.slice(firstgs + 1),
666-
[],
667-
] : [
668-
pattern.slice(patternIndex, firstgs),
669-
pattern.slice(firstgs + 1, lastgs),
670-
pattern.slice(lastgs + 1),
671-
];
668+
const [head, body, tail] = partial ?
669+
[
670+
pattern.slice(patternIndex, firstgs),
671+
pattern.slice(firstgs + 1),
672+
[],
673+
]
674+
: [
675+
pattern.slice(patternIndex, firstgs),
676+
pattern.slice(firstgs + 1, lastgs),
677+
pattern.slice(lastgs + 1),
678+
];
672679
// check the head, from the current file/pattern index.
673680
if (head.length) {
674681
const fileHead = file.slice(fileIndex, fileIndex + head.length);
@@ -1014,7 +1021,7 @@ export class Minimatch {
10141021
this.regexp = new RegExp(re, [...flags].join(''));
10151022
/* c8 ignore start */
10161023
}
1017-
catch (ex) {
1024+
catch {
10181025
// should be impossible
10191026
this.regexp = false;
10201027
}
@@ -1029,7 +1036,7 @@ export class Minimatch {
10291036
if (this.preserveMultipleSlashes) {
10301037
return p.split('/');
10311038
}
1032-
else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
1039+
else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
10331040
// add an extra '' for the one we lose
10341041
return ['', ...p.split(/\/+/)];
10351042
}
@@ -1071,8 +1078,7 @@ export class Minimatch {
10711078
filename = ff[i];
10721079
}
10731080
}
1074-
for (let i = 0; i < set.length; i++) {
1075-
const pattern = set[i];
1081+
for (const pattern of set) {
10761082
let file = ff;
10771083
if (options.matchBase && pattern.length === 1) {
10781084
file = [filename];

node_modules/minimatch/dist/esm/unescape.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
2121
if (magicalBraces) {
2222
return windowsPathsNoEscape ?
23-
s.replace(/\[([^\/\\])\]/g, '$1')
23+
s.replace(/\[([^/\\])\]/g, '$1')
2424
: s
25-
.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
26-
.replace(/\\([^\/])/g, '$1');
25+
.replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
26+
.replace(/\\([^/])/g, '$1');
2727
}
2828
return windowsPathsNoEscape ?
29-
s.replace(/\[([^\/\\{}])\]/g, '$1')
29+
s.replace(/\[([^/\\{}])\]/g, '$1')
3030
: s
31-
.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
32-
.replace(/\\([^\/{}])/g, '$1');
31+
.replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
32+
.replace(/\\([^/{}])/g, '$1');
3333
};
3434
//# sourceMappingURL=unescape.js.map

0 commit comments

Comments
 (0)