Skip to content

Commit eca02c7

Browse files
committed
deps: minimatch@10.1.2 @isaacs/brace-expansion@5.0.1
1 parent 2242f25 commit eca02c7

File tree

5 files changed

+37
-50
lines changed

5 files changed

+37
-50
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.EXPANSION_MAX = void 0;
34
exports.expand = expand;
45
const balanced_match_1 = require("@isaacs/balanced-match");
56
const escSlash = '\0SLASH' + Math.random() + '\0';
@@ -17,6 +18,7 @@ const openPattern = /\\{/g;
1718
const closePattern = /\\}/g;
1819
const commaPattern = /\\,/g;
1920
const periodPattern = /\\./g;
21+
exports.EXPANSION_MAX = 100_000;
2022
function numeric(str) {
2123
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
2224
}
@@ -62,10 +64,11 @@ function parseCommaParts(str) {
6264
parts.push.apply(parts, p);
6365
return parts;
6466
}
65-
function expand(str) {
67+
function expand(str, options = {}) {
6668
if (!str) {
6769
return [];
6870
}
71+
const { max = exports.EXPANSION_MAX } = options;
6972
// I don't know why Bash 4.3 does this, but it does.
7073
// Anything starting with {} will have the first two bytes preserved
7174
// but *only* at the top level, so {},a}b will not expand to anything,
@@ -75,7 +78,7 @@ function expand(str) {
7578
if (str.slice(0, 2) === '{}') {
7679
str = '\\{\\}' + str.slice(2);
7780
}
78-
return expand_(escapeBraces(str), true).map(unescapeBraces);
81+
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
7982
}
8083
function embrace(str) {
8184
return '{' + str + '}';
@@ -89,17 +92,17 @@ function lte(i, y) {
8992
function gte(i, y) {
9093
return i >= y;
9194
}
92-
function expand_(str, isTop) {
95+
function expand_(str, max, isTop) {
9396
/** @type {string[]} */
9497
const expansions = [];
9598
const m = (0, balanced_match_1.balanced)('{', '}', str);
9699
if (!m)
97100
return [str];
98101
// no need to expand pre, since it is guaranteed to be free of brace-sets
99102
const pre = m.pre;
100-
const post = m.post.length ? expand_(m.post, false) : [''];
103+
const post = m.post.length ? expand_(m.post, max, false) : [''];
101104
if (/\$$/.test(m.pre)) {
102-
for (let k = 0; k < post.length; k++) {
105+
for (let k = 0; k < post.length && k < max; k++) {
103106
const expansion = pre + '{' + m.body + '}' + post[k];
104107
expansions.push(expansion);
105108
}
@@ -113,7 +116,7 @@ function expand_(str, isTop) {
113116
// {a},b}
114117
if (m.post.match(/,(?!,).*\}/)) {
115118
str = m.pre + '{' + m.body + escClose + m.post;
116-
return expand_(str);
119+
return expand_(str, max, true);
117120
}
118121
return [str];
119122
}
@@ -125,7 +128,7 @@ function expand_(str, isTop) {
125128
n = parseCommaParts(m.body);
126129
if (n.length === 1 && n[0] !== undefined) {
127130
// x{{a,b}}y ==> x{a}y x{b}y
128-
n = expand_(n[0], false).map(embrace);
131+
n = expand_(n[0], max, false).map(embrace);
129132
//XXX is this necessary? Can't seem to hit it in tests.
130133
/* c8 ignore start */
131134
if (n.length === 1) {
@@ -179,11 +182,11 @@ function expand_(str, isTop) {
179182
else {
180183
N = [];
181184
for (let j = 0; j < n.length; j++) {
182-
N.push.apply(N, expand_(n[j], false));
185+
N.push.apply(N, expand_(n[j], max, false));
183186
}
184187
}
185188
for (let j = 0; j < N.length; j++) {
186-
for (let k = 0; k < post.length; k++) {
189+
for (let k = 0; k < post.length && expansions.length < max; k++) {
187190
const expansion = pre + N[j] + post[k];
188191
if (!isTop || isSequence || expansion) {
189192
expansions.push(expansion);

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const openPattern = /\\{/g;
1414
const closePattern = /\\}/g;
1515
const commaPattern = /\\,/g;
1616
const periodPattern = /\\./g;
17+
export const EXPANSION_MAX = 100_000;
1718
function numeric(str) {
1819
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
1920
}
@@ -59,10 +60,11 @@ function parseCommaParts(str) {
5960
parts.push.apply(parts, p);
6061
return parts;
6162
}
62-
export function expand(str) {
63+
export function expand(str, options = {}) {
6364
if (!str) {
6465
return [];
6566
}
67+
const { max = EXPANSION_MAX } = options;
6668
// I don't know why Bash 4.3 does this, but it does.
6769
// Anything starting with {} will have the first two bytes preserved
6870
// but *only* at the top level, so {},a}b will not expand to anything,
@@ -72,7 +74,7 @@ export function expand(str) {
7274
if (str.slice(0, 2) === '{}') {
7375
str = '\\{\\}' + str.slice(2);
7476
}
75-
return expand_(escapeBraces(str), true).map(unescapeBraces);
77+
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
7678
}
7779
function embrace(str) {
7880
return '{' + str + '}';
@@ -86,17 +88,17 @@ function lte(i, y) {
8688
function gte(i, y) {
8789
return i >= y;
8890
}
89-
function expand_(str, isTop) {
91+
function expand_(str, max, isTop) {
9092
/** @type {string[]} */
9193
const expansions = [];
9294
const m = balanced('{', '}', str);
9395
if (!m)
9496
return [str];
9597
// no need to expand pre, since it is guaranteed to be free of brace-sets
9698
const pre = m.pre;
97-
const post = m.post.length ? expand_(m.post, false) : [''];
99+
const post = m.post.length ? expand_(m.post, max, false) : [''];
98100
if (/\$$/.test(m.pre)) {
99-
for (let k = 0; k < post.length; k++) {
101+
for (let k = 0; k < post.length && k < max; k++) {
100102
const expansion = pre + '{' + m.body + '}' + post[k];
101103
expansions.push(expansion);
102104
}
@@ -110,7 +112,7 @@ function expand_(str, isTop) {
110112
// {a},b}
111113
if (m.post.match(/,(?!,).*\}/)) {
112114
str = m.pre + '{' + m.body + escClose + m.post;
113-
return expand_(str);
115+
return expand_(str, max, true);
114116
}
115117
return [str];
116118
}
@@ -122,7 +124,7 @@ function expand_(str, isTop) {
122124
n = parseCommaParts(m.body);
123125
if (n.length === 1 && n[0] !== undefined) {
124126
// x{{a,b}}y ==> x{a}y x{b}y
125-
n = expand_(n[0], false).map(embrace);
127+
n = expand_(n[0], max, false).map(embrace);
126128
//XXX is this necessary? Can't seem to hit it in tests.
127129
/* c8 ignore start */
128130
if (n.length === 1) {
@@ -176,11 +178,11 @@ function expand_(str, isTop) {
176178
else {
177179
N = [];
178180
for (let j = 0; j < n.length; j++) {
179-
N.push.apply(N, expand_(n[j], false));
181+
N.push.apply(N, expand_(n[j], max, false));
180182
}
181183
}
182184
for (let j = 0; j < N.length; j++) {
183-
for (let k = 0; k < post.length; k++) {
185+
for (let k = 0; k < post.length && expansions.length < max; k++) {
184186
const expansion = pre + N[j] + post[k];
185187
if (!isTop || isSequence || expansion) {
186188
expansions.push(expansion);

node_modules/@isaacs/brace-expansion/package.json

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@isaacs/brace-expansion",
33
"description": "Brace expansion as known from sh/bash",
4-
"version": "5.0.0",
4+
"version": "5.0.1",
55
"files": [
66
"dist"
77
],
@@ -28,27 +28,16 @@
2828
"presnap": "npm run prepare",
2929
"test": "tap",
3030
"snap": "tap",
31-
"format": "prettier --write . --loglevel warn",
31+
"format": "prettier --write .",
3232
"benchmark": "node benchmark/index.js",
3333
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
3434
},
35-
"prettier": {
36-
"semi": false,
37-
"printWidth": 80,
38-
"tabWidth": 2,
39-
"useTabs": false,
40-
"singleQuote": true,
41-
"jsxSingleQuote": false,
42-
"bracketSameLine": true,
43-
"arrowParens": "avoid",
44-
"endOfLine": "lf"
45-
},
4635
"devDependencies": {
4736
"@types/brace-expansion": "^1.1.2",
4837
"@types/node": "^24.0.0",
4938
"mkdirp": "^3.0.1",
5039
"prettier": "^3.3.2",
51-
"tap": "^21.1.0",
40+
"tap": "^21.5.0",
5241
"tshy": "^3.0.2",
5342
"typedoc": "^0.28.5"
5443
},

node_modules/minimatch/package.json

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
33
"name": "minimatch",
44
"description": "a glob matcher in javascript",
5-
"version": "10.1.1",
5+
"version": "10.1.2",
66
"repository": {
77
"type": "git",
88
"url": "git@github.com:isaacs/minimatch"
@@ -38,17 +38,6 @@
3838
"benchmark": "node benchmark/index.js",
3939
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
4040
},
41-
"prettier": {
42-
"semi": false,
43-
"printWidth": 80,
44-
"tabWidth": 2,
45-
"useTabs": false,
46-
"singleQuote": true,
47-
"jsxSingleQuote": false,
48-
"bracketSameLine": true,
49-
"arrowParens": "avoid",
50-
"endOfLine": "lf"
51-
},
5241
"engines": {
5342
"node": "20 || >=22"
5443
},
@@ -73,6 +62,6 @@
7362
"type": "module",
7463
"module": "./dist/esm/index.js",
7564
"dependencies": {
76-
"@isaacs/brace-expansion": "^5.0.0"
65+
"@isaacs/brace-expansion": "^5.0.1"
7766
}
7867
}

package-lock.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,14 +1388,18 @@
13881388
},
13891389
"node_modules/@isaacs/balanced-match": {
13901390
"version": "4.0.1",
1391+
"resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",
1392+
"integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",
13911393
"inBundle": true,
13921394
"license": "MIT",
13931395
"engines": {
13941396
"node": "20 || >=22"
13951397
}
13961398
},
13971399
"node_modules/@isaacs/brace-expansion": {
1398-
"version": "5.0.0",
1400+
"version": "5.0.1",
1401+
"resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz",
1402+
"integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==",
13991403
"inBundle": true,
14001404
"license": "MIT",
14011405
"dependencies": {
@@ -8288,13 +8292,13 @@
82888292
}
82898293
},
82908294
"node_modules/minimatch": {
8291-
"version": "10.1.1",
8292-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
8293-
"integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
8295+
"version": "10.1.2",
8296+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.2.tgz",
8297+
"integrity": "sha512-fu656aJ0n2kcXwsnwnv9g24tkU5uSmOlTjd6WyyaKm2Z+h1qmY6bAjrcaIxF/BslFqbZ8UBtbJi7KgQOZD2PTw==",
82948298
"inBundle": true,
82958299
"license": "BlueOak-1.0.0",
82968300
"dependencies": {
8297-
"@isaacs/brace-expansion": "^5.0.0"
8301+
"@isaacs/brace-expansion": "^5.0.1"
82988302
},
82998303
"engines": {
83008304
"node": "20 || >=22"

0 commit comments

Comments
 (0)