Compare commits

1 Commits

Author SHA1 Message Date
aece5023fb chore(deps): update dependency glob to v11.1.0
All checks were successful
Lint / pre-commit Linting (push) Successful in 1m18s
2025-12-31 18:06:00 +00:00
2 changed files with 63 additions and 27 deletions

72
dist/index.js vendored
View File

@@ -46985,7 +46985,9 @@ class AST {
if (this.#root === this) if (this.#root === this)
this.#fillNegs(); this.#fillNegs();
if (!this.type) { if (!this.type) {
const noEmpty = this.isStart() && this.isEnd(); const noEmpty = this.isStart() &&
this.isEnd() &&
!this.#parts.some(s => typeof s !== 'string');
const src = this.#parts const src = this.#parts
.map(p => { .map(p => {
const [re, _, hasMagic, uflag] = typeof p === 'string' const [re, _, hasMagic, uflag] = typeof p === 'string'
@@ -47141,10 +47143,7 @@ class AST {
} }
} }
if (c === '*') { if (c === '*') {
if (noEmpty && glob === '*') re += noEmpty && glob === '*' ? starNoEmpty : star;
re += starNoEmpty;
else
re += star;
hasMagic = true; hasMagic = true;
continue; continue;
} }
@@ -47332,16 +47331,24 @@ exports.escape = void 0;
/** /**
* Escape all magic characters in a glob pattern. * Escape all magic characters in a glob pattern.
* *
* If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} * If the {@link MinimatchOptions.windowsPathsNoEscape}
* option is used, then characters are escaped by wrapping in `[]`, because * option is used, then characters are escaped by wrapping in `[]`, because
* a magic character wrapped in a character class can only be satisfied by * a magic character wrapped in a character class can only be satisfied by
* that exact character. In this mode, `\` is _not_ escaped, because it is * that exact character. In this mode, `\` is _not_ escaped, because it is
* not interpreted as a magic character, but instead as a path separator. * not interpreted as a magic character, but instead as a path separator.
*
* If the {@link MinimatchOptions.magicalBraces} option is used,
* then braces (`{` and `}`) will be escaped.
*/ */
const escape = (s, { windowsPathsNoEscape = false, } = {}) => { const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
// don't need to escape +@! because we escape the parens // don't need to escape +@! because we escape the parens
// that make those magic, and escaping ! as [!] isn't valid, // that make those magic, and escaping ! as [!] isn't valid,
// because [!]] is a valid glob class meaning not ']'. // because [!]] is a valid glob class meaning not ']'.
if (magicalBraces) {
return windowsPathsNoEscape
? s.replace(/[?*()[\]{}]/g, '[$&]')
: s.replace(/[?*()[\]\\{}]/g, '\\$&');
}
return windowsPathsNoEscape return windowsPathsNoEscape
? s.replace(/[?*()[\]]/g, '[$&]') ? s.replace(/[?*()[\]]/g, '[$&]')
: s.replace(/[?*()[\]\\]/g, '\\$&'); : s.replace(/[?*()[\]\\]/g, '\\$&');
@@ -47997,7 +48004,7 @@ class Minimatch {
} }
} }
// resolve and reduce . and .. portions in the file as well. // resolve and reduce . and .. portions in the file as well.
// dont' need to do the second phase, because it's only one string[] // don't need to do the second phase, because it's only one string[]
const { optimizationLevel = 1 } = this.options; const { optimizationLevel = 1 } = this.options;
if (optimizationLevel >= 2) { if (optimizationLevel >= 2) {
file = this.levelTwoFileOptimize(file); file = this.levelTwoFileOptimize(file);
@@ -48250,14 +48257,25 @@ class Minimatch {
} }
} }
else if (next === undefined) { else if (next === undefined) {
pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?'; pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
} }
else if (next !== exports.GLOBSTAR) { else if (next !== exports.GLOBSTAR) {
pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next; pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
pp[i + 1] = exports.GLOBSTAR; pp[i + 1] = exports.GLOBSTAR;
} }
}); });
return pp.filter(p => p !== exports.GLOBSTAR).join('/'); const filtered = pp.filter(p => p !== exports.GLOBSTAR);
// For partial matches, we need to make the pattern match
// any prefix of the full path. We do this by generating
// alternative patterns that match progressively longer prefixes.
if (this.partial && filtered.length >= 1) {
const prefixes = [];
for (let i = 1; i <= filtered.length; i++) {
prefixes.push(filtered.slice(0, i).join('/'));
}
return '(?:' + prefixes.join('|') + ')';
}
return filtered.join('/');
}) })
.join('|'); .join('|');
// need to wrap in parens if we had more than one thing with |, // need to wrap in parens if we had more than one thing with |,
@@ -48266,6 +48284,10 @@ class Minimatch {
// must match entire pattern // must match entire pattern
// ending in a * or ** will make it less strict. // ending in a * or ** will make it less strict.
re = '^' + open + re + close + '$'; re = '^' + open + re + close + '$';
// In partial mode, '/' should always match as it's a valid prefix for any pattern
if (this.partial) {
re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
}
// can match anything, as long as it's not this. // can match anything, as long as it's not this.
if (this.negate) if (this.negate)
re = '^(?!' + re + ').+$'; re = '^(?!' + re + ').+$';
@@ -48382,21 +48404,35 @@ exports.unescape = void 0;
/** /**
* Un-escape a string that has been escaped with {@link escape}. * Un-escape a string that has been escaped with {@link escape}.
* *
* If the {@link windowsPathsNoEscape} option is used, then square-brace * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
* escapes are removed, but not backslash escapes. For example, it will turn * square-bracket escapes are removed, but not backslash escapes.
* the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
* becuase `\` is a path separator in `windowsPathsNoEscape` mode.
* *
* When `windowsPathsNoEscape` is not set, then both brace escapes and * For example, it will turn the string `'[*]'` into `*`, but it will not
* turn `'\\*'` into `'*'`, because `\` is a path separator in
* `windowsPathsNoEscape` mode.
*
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
* backslash escapes are removed. * backslash escapes are removed.
* *
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
* or unescaped. * or unescaped.
*
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
* unescaped.
*/ */
const unescape = (s, { windowsPathsNoEscape = false, } = {}) => { const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
if (magicalBraces) {
return windowsPathsNoEscape
? s.replace(/\[([^\/\\])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
.replace(/\\([^\/])/g, '$1');
}
return windowsPathsNoEscape return windowsPathsNoEscape
? s.replace(/\[([^\/\\])\]/g, '$1') ? s.replace(/\[([^\/\\{}])\]/g, '$1')
: s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1'); : s
.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
.replace(/\\([^\/{}])/g, '$1');
}; };
exports.unescape = unescape; exports.unescape = unescape;
//# sourceMappingURL=unescape.js.map //# sourceMappingURL=unescape.js.map

18
package-lock.json generated
View File

@@ -424,14 +424,14 @@
} }
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "11.0.3", "version": "11.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz",
"integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==", "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==",
"license": "ISC", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"foreground-child": "^3.3.1", "foreground-child": "^3.3.1",
"jackspeak": "^4.1.1", "jackspeak": "^4.1.1",
"minimatch": "^10.0.3", "minimatch": "^10.1.1",
"minipass": "^7.1.2", "minipass": "^7.1.2",
"package-json-from-dist": "^1.0.0", "package-json-from-dist": "^1.0.0",
"path-scurry": "^2.0.0" "path-scurry": "^2.0.0"
@@ -579,10 +579,10 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "10.0.3", "version": "10.1.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
"integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
"license": "ISC", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"@isaacs/brace-expansion": "^5.0.0" "@isaacs/brace-expansion": "^5.0.0"
}, },