1
0
mirror of https://github.com/actions/upload-artifact.git synced 2026-02-26 05:32:32 +00:00

Bump minimatch to 10.1.1

This commit is contained in:
Daniel Kennedy
2026-02-25 13:24:55 -05:00
parent a2008cd1d8
commit 0508a90968
5 changed files with 487 additions and 202 deletions

66
.licenses/npm/minimatch.dep.yml generated Normal file
View File

@ -0,0 +1,66 @@
---
name: minimatch
version: 10.1.1
type: npm
summary: a glob matcher in javascript
homepage:
license: blueoak-1.0.0
licenses:
- sources: LICENSE.md
text: |
# Blue Oak Model License
Version 1.0.0
## Purpose
This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.
## Acceptance
In order to receive this license, you must agree to its
rules. The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.
## Copyright
Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.
## Notices
You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
<https://blueoakcouncil.org/license/1.0.0>.
## Excuse
If anyone notifies you in writing that you have not
complied with [Notices](#notices), you can keep your
license by taking all practical steps to comply within 30
days after the notice. If you do not do so, your license
ends immediately.
## Patent
Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.
## Reliability
No contributor can revoke this license.
## No Liability
**_As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim._**
notices: []

534
dist/merge/index.js vendored
View File

@ -70854,7 +70854,7 @@ __webpack_unused_export__ = defaultContentType
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Glob = void 0; exports.Glob = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const node_url_1 = __nccwpck_require__(3136); const node_url_1 = __nccwpck_require__(3136);
const path_scurry_1 = __nccwpck_require__(8958); const path_scurry_1 = __nccwpck_require__(8958);
const pattern_js_1 = __nccwpck_require__(7813); const pattern_js_1 = __nccwpck_require__(7813);
@ -71107,7 +71107,7 @@ exports.Glob = Glob;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.hasMagic = void 0; exports.hasMagic = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
/** /**
* Return true if the patterns provided contain any magic glob characters, * Return true if the patterns provided contain any magic glob characters,
* given the options provided. * given the options provided.
@ -71144,7 +71144,7 @@ exports.hasMagic = hasMagic;
// Ignores are always parsed in dot:true mode // Ignores are always parsed in dot:true mode
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Ignore = void 0; exports.Ignore = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const pattern_js_1 = __nccwpck_require__(7813); const pattern_js_1 = __nccwpck_require__(7813);
const defaultPlatform = (typeof process === 'object' && const defaultPlatform = (typeof process === 'object' &&
process && process &&
@ -71270,10 +71270,10 @@ exports.globStream = globStream;
exports.globSync = globSync; exports.globSync = globSync;
exports.globIterateSync = globIterateSync; exports.globIterateSync = globIterateSync;
exports.globIterate = globIterate; exports.globIterate = globIterate;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const glob_js_1 = __nccwpck_require__(2981); const glob_js_1 = __nccwpck_require__(2981);
const has_magic_js_1 = __nccwpck_require__(5197); const has_magic_js_1 = __nccwpck_require__(5197);
var minimatch_2 = __nccwpck_require__(6507); var minimatch_2 = __nccwpck_require__(3790);
Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } })); Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } }));
Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } })); Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } }));
var glob_js_2 = __nccwpck_require__(2981); var glob_js_2 = __nccwpck_require__(2981);
@ -71340,7 +71340,7 @@ exports.glob.glob = exports.glob;
// this is just a very light wrapper around 2 arrays with an offset index // this is just a very light wrapper around 2 arrays with an offset index
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Pattern = void 0; exports.Pattern = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const isPatternList = (pl) => pl.length >= 1; const isPatternList = (pl) => pl.length >= 1;
const isGlobList = (gl) => gl.length >= 1; const isGlobList = (gl) => gl.length >= 1;
/** /**
@ -71565,7 +71565,7 @@ exports.Pattern = Pattern;
// synchronous utility for filtering entries and calculating subwalks // synchronous utility for filtering entries and calculating subwalks
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0; exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
/** /**
* A cache of which patterns have been processed for a given Path * A cache of which patterns have been processed for a given Path
*/ */
@ -72258,7 +72258,7 @@ exports.GlobStream = GlobStream;
/***/ }), /***/ }),
/***/ 7305: /***/ 8895:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
@ -72278,7 +72278,7 @@ exports.assertValidPattern = assertValidPattern;
/***/ }), /***/ }),
/***/ 1803: /***/ 3238:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
@ -72286,8 +72286,8 @@ exports.assertValidPattern = assertValidPattern;
var _a; var _a;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AST = void 0; exports.AST = void 0;
const brace_expressions_js_1 = __nccwpck_require__(1090); const brace_expressions_js_1 = __nccwpck_require__(5192);
const unescape_js_1 = __nccwpck_require__(851); const unescape_js_1 = __nccwpck_require__(9829);
const types = new Set(['!', '?', '+', '*', '@']); const types = new Set(['!', '?', '+', '*', '@']);
const isExtglobType = (c) => types.has(c); const isExtglobType = (c) => types.has(c);
const isExtglobAST = (c) => isExtglobType(c.type); const isExtglobAST = (c) => isExtglobType(c.type);
@ -73031,7 +73031,7 @@ _a = AST;
/***/ }), /***/ }),
/***/ 1090: /***/ 5192:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
@ -73189,7 +73189,7 @@ exports.parseClass = parseClass;
/***/ }), /***/ }),
/***/ 800: /***/ 6726:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
@ -73217,17 +73217,17 @@ exports.escape = escape;
/***/ }), /***/ }),
/***/ 6507: /***/ 3790:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;
const brace_expansion_1 = __nccwpck_require__(8968); const brace_expansion_1 = __nccwpck_require__(8968);
const assert_valid_pattern_js_1 = __nccwpck_require__(7305); const assert_valid_pattern_js_1 = __nccwpck_require__(8895);
const ast_js_1 = __nccwpck_require__(1803); const ast_js_1 = __nccwpck_require__(3238);
const escape_js_1 = __nccwpck_require__(800); const escape_js_1 = __nccwpck_require__(6726);
const unescape_js_1 = __nccwpck_require__(851); const unescape_js_1 = __nccwpck_require__(9829);
const minimatch = (p, pattern, options = {}) => { const minimatch = (p, pattern, options = {}) => {
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern); (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
// shortcut: comments match nothing. // shortcut: comments match nothing.
@ -74228,11 +74228,11 @@ class Minimatch {
} }
exports.Minimatch = Minimatch; exports.Minimatch = Minimatch;
/* c8 ignore start */ /* c8 ignore start */
var ast_js_2 = __nccwpck_require__(1803); var ast_js_2 = __nccwpck_require__(3238);
Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } })); Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } }));
var escape_js_2 = __nccwpck_require__(800); var escape_js_2 = __nccwpck_require__(6726);
Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } })); Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } }));
var unescape_js_2 = __nccwpck_require__(851); var unescape_js_2 = __nccwpck_require__(9829);
Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } })); Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } }));
/* c8 ignore stop */ /* c8 ignore stop */
exports.minimatch.AST = ast_js_1.AST; exports.minimatch.AST = ast_js_1.AST;
@ -74243,7 +74243,7 @@ exports.minimatch.unescape = unescape_js_1.unescape;
/***/ }), /***/ }),
/***/ 851: /***/ 9829:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
@ -82870,10 +82870,8 @@ const parseClass = (glob, position) => {
} }
const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
const comb = ranges.length && negs.length const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
? '(' + sranges + '|' + snegs + ')' : ranges.length ? sranges
: ranges.length
? sranges
: snegs; : snegs;
return [comb, uflag, endPos - pos, true]; return [comb, uflag, endPos - pos, true];
}; };
@ -82882,21 +82880,35 @@ const parseClass = (glob, position) => {
/** /**
* 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_unescape = (s, { windowsPathsNoEscape = false, } = {}) => { const unescape_unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
return windowsPathsNoEscape if (magicalBraces) {
? s.replace(/\[([^\/\\])\]/g, '$1') return windowsPathsNoEscape ?
: s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1'); s.replace(/\[([^\/\\])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
.replace(/\\([^\/])/g, '$1');
}
return windowsPathsNoEscape ?
s.replace(/\[([^\/\\{}])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
.replace(/\\([^\/{}])/g, '$1');
}; };
//# sourceMappingURL=unescape.js.map //# sourceMappingURL=unescape.js.map
;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/ast.js ;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/ast.js
@ -82907,6 +82919,53 @@ var _a;
const types = new Set(['!', '?', '+', '*', '@']); const types = new Set(['!', '?', '+', '*', '@']);
const isExtglobType = (c) => types.has(c); const isExtglobType = (c) => types.has(c);
const isExtglobAST = (c) => isExtglobType(c.type); const isExtglobAST = (c) => isExtglobType(c.type);
// Map of which extglob types can adopt the children of a nested extglob
//
// anything but ! can adopt a matching type:
// +(a|+(b|c)|d) => +(a|b|c|d)
// *(a|*(b|c)|d) => *(a|b|c|d)
// @(a|@(b|c)|d) => @(a|b|c|d)
// ?(a|?(b|c)|d) => ?(a|b|c|d)
//
// * can adopt anything, because 0 or repetition is allowed
// *(a|?(b|c)|d) => *(a|b|c|d)
// *(a|+(b|c)|d) => *(a|b|c|d)
// *(a|@(b|c)|d) => *(a|b|c|d)
//
// + can adopt @, because 1 or repetition is allowed
// +(a|@(b|c)|d) => +(a|b|c|d)
//
// + and @ CANNOT adopt *, because 0 would be allowed
// +(a|*(b|c)|d) => would match "", on *(b|c)
// @(a|*(b|c)|d) => would match "", on *(b|c)
//
// + and @ CANNOT adopt ?, because 0 would be allowed
// +(a|?(b|c)|d) => would match "", on ?(b|c)
// @(a|?(b|c)|d) => would match "", on ?(b|c)
//
// ? can adopt @, because 0 or 1 is allowed
// ?(a|@(b|c)|d) => ?(a|b|c|d)
//
// ? and @ CANNOT adopt * or +, because >1 would be allowed
// ?(a|*(b|c)|d) => would match bbb on *(b|c)
// @(a|*(b|c)|d) => would match bbb on *(b|c)
// ?(a|+(b|c)|d) => would match bbb on +(b|c)
// @(a|+(b|c)|d) => would match bbb on +(b|c)
//
// ! CANNOT adopt ! (nothing else can either)
// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
//
// ! can adopt @
// !(a|@(b|c)|d) => !(a|b|c|d)
//
// ! CANNOT adopt *
// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
//
// ! CANNOT adopt +
// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
//
// ! CANNOT adopt ?
// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
const adoptionMap = new Map([ const adoptionMap = new Map([
['!', ['@']], ['!', ['@']],
['?', ['?', '@']], ['?', ['?', '@']],
@ -82914,11 +82973,14 @@ const adoptionMap = new Map([
['*', ['*', '+', '?', '@']], ['*', ['*', '+', '?', '@']],
['+', ['+', '@']], ['+', ['+', '@']],
]); ]);
// nested extglobs that can be adopted in, but with the addition of
// a blank '' element.
const adoptionWithSpaceMap = new Map([ const adoptionWithSpaceMap = new Map([
['!', ['?']], ['!', ['?']],
['@', ['?']], ['@', ['?']],
['+', ['?', '*']], ['+', ['?', '*']],
]); ]);
// union of the previous two maps
const adoptionAnyMap = new Map([ const adoptionAnyMap = new Map([
['!', ['?', '@']], ['!', ['?', '@']],
['?', ['?', '@']], ['?', ['?', '@']],
@ -82926,11 +82988,36 @@ const adoptionAnyMap = new Map([
['*', ['*', '+', '?', '@']], ['*', ['*', '+', '?', '@']],
['+', ['+', '@', '?', '*']], ['+', ['+', '@', '?', '*']],
]); ]);
// Extglobs that can take over their parent if they are the only child
// the key is parent, value maps child to resulting extglob parent type
// '@' is omitted because it's a special case. An `@` extglob with a single
// member can always be usurped by that subpattern.
const usurpMap = new Map([ const usurpMap = new Map([
['!', new Map([['!', '@']])], ['!', new Map([['!', '@']])],
['?', new Map([['*', '*'], ['+', '*']])], [
['@', new Map([['!', '!'], ['?', '?'], ['@', '@'], ['*', '*'], ['+', '+']])], '?',
['+', new Map([['?', '*'], ['*', '*']])], new Map([
['*', '*'],
['+', '*'],
]),
],
[
'@',
new Map([
['!', '!'],
['?', '?'],
['@', '@'],
['*', '*'],
['+', '+'],
]),
],
[
'+',
new Map([
['?', '*'],
['*', '*'],
]),
],
]); ]);
// Patterns that get prepended to bind to the start of either the // Patterns that get prepended to bind to the start of either the
// entire string, or just a single path portion, to prevent dots // entire string, or just a single path portion, to prevent dots
@ -82955,6 +83042,7 @@ const star = qmark + '*?';
const starNoEmpty = qmark + '+?'; const starNoEmpty = qmark + '+?';
// remove the \ chars that we added if we end up doing a nonmagic compare // remove the \ chars that we added if we end up doing a nonmagic compare
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') // const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
let ID = 0;
class AST { class AST {
type; type;
#root; #root;
@ -82970,6 +83058,22 @@ class AST {
// set to true if it's an extglob with no children // set to true if it's an extglob with no children
// (which really means one child of '') // (which really means one child of '')
#emptyExt = false; #emptyExt = false;
id = ++ID;
get depth() {
return (this.#parent?.depth ?? -1) + 1;
}
[Symbol.for('nodejs.util.inspect.custom')]() {
return {
'@@type': 'AST',
id: this.id,
type: this.type,
root: this.#root.id,
parent: this.#parent?.id,
depth: this.depth,
partsLength: this.#parts.length,
parts: this.#parts,
};
}
constructor(type, parent, options = {}) { constructor(type, parent, options = {}) {
this.type = type; this.type = type;
// extglobs are inherently magical // extglobs are inherently magical
@ -83048,7 +83152,8 @@ class AST {
if (p === '') if (p === '')
continue; continue;
/* c8 ignore start */ /* c8 ignore start */
if (typeof p !== 'string' && !(p instanceof _a && p.#parent === this)) { if (typeof p !== 'string' &&
!(p instanceof _a && p.#parent === this)) {
throw new Error('invalid part: ' + p); throw new Error('invalid part: ' + p);
} }
/* c8 ignore stop */ /* c8 ignore stop */
@ -83056,8 +83161,10 @@ class AST {
} }
} }
toJSON() { toJSON() {
const ret = this.type === null const ret = this.type === null ?
? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) this.#parts
.slice()
.map(p => (typeof p === 'string' ? p : p.toJSON()))
: [this.type, ...this.#parts.map(p => p.toJSON())]; : [this.type, ...this.#parts.map(p => p.toJSON())];
if (this.isStart() && !this.type) if (this.isStart() && !this.type)
ret.unshift([]); ret.unshift([]);
@ -83152,6 +83259,8 @@ class AST {
acc += c; acc += c;
continue; continue;
} }
// we don't have to check for adoption here, because that's
// done at the other recursion point.
const doRecurse = !opt.noext && const doRecurse = !opt.noext &&
isExtglobType(c) && isExtglobType(c) &&
str.charAt(i) === '(' && str.charAt(i) === '(' &&
@ -83203,7 +83312,8 @@ class AST {
acc += c; acc += c;
continue; continue;
} }
const doRecurse = isExtglobType(c) && const doRecurse = !opt.noext &&
isExtglobType(c) &&
str.charAt(i) === '(' && str.charAt(i) === '(' &&
/* c8 ignore start - the maxDepth is sufficient here */ /* c8 ignore start - the maxDepth is sufficient here */
(extDepth <= maxDepth || (ast && ast.#canAdoptType(c))); (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
@ -83308,47 +83418,14 @@ class AST {
/* c8 ignore stop */ /* c8 ignore stop */
this.#parts = gc.#parts; this.#parts = gc.#parts;
for (const p of this.#parts) { for (const p of this.#parts) {
if (typeof p === 'object') if (typeof p === 'object') {
p.#parent = this; p.#parent = this;
}
} }
this.type = nt; this.type = nt;
this.#toString = undefined; this.#toString = undefined;
this.#emptyExt = false; this.#emptyExt = false;
} }
#flatten() {
if (!isExtglobAST(this)) {
for (const p of this.#parts) {
if (typeof p === 'object')
p.#flatten();
}
}
else {
let iterations = 0;
let done = false;
do {
done = true;
for (let i = 0; i < this.#parts.length; i++) {
const c = this.#parts[i];
if (typeof c === 'object') {
c.#flatten();
if (this.#canAdopt(c)) {
done = false;
this.#adopt(c, i);
}
else if (this.#canAdoptWithSpace(c)) {
done = false;
this.#adoptWithSpace(c, i);
}
else if (this.#canUsurp(c)) {
done = false;
this.#usurp(c);
}
}
}
} while (!done && ++iterations < 10);
}
this.#toString = undefined;
}
static fromGlob(pattern, options = {}) { static fromGlob(pattern, options = {}) {
const ast = new _a(null, undefined, options); const ast = new _a(null, undefined, options);
_a.#parseAST(pattern, ast, 0, options, 0); _a.#parseAST(pattern, ast, 0, options, 0);
@ -83460,11 +83537,13 @@ class AST {
this.#fillNegs(); this.#fillNegs();
} }
if (!isExtglobAST(this)) { if (!isExtglobAST(this)) {
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' ?
? _a.#parseGlob(p, this.#hasMagic, noEmpty) _a.#parseGlob(p, this.#hasMagic, noEmpty)
: p.toRegExpSource(allowDot); : p.toRegExpSource(allowDot);
this.#hasMagic = this.#hasMagic || hasMagic; this.#hasMagic = this.#hasMagic || hasMagic;
this.#uflag = this.#uflag || uflag; this.#uflag = this.#uflag || uflag;
@ -83493,7 +83572,10 @@ class AST {
// no need to prevent dots if it can't match a dot, or if a // no need to prevent dots if it can't match a dot, or if a
// sub-pattern will be preventing it anyway. // sub-pattern will be preventing it anyway.
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; start =
needNoTrav ? startNoTraversal
: needNoDot ? startNoDot
: '';
} }
} }
} }
@ -83529,9 +83611,8 @@ class AST {
me.#hasMagic = undefined; me.#hasMagic = undefined;
return [s, unescape_unescape(this.toString()), false, false]; return [s, unescape_unescape(this.toString()), false, false];
} }
// XXX abstract out this map method let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ''
? ''
: this.#partsToRegExp(true); : this.#partsToRegExp(true);
if (bodyDotAllowed === body) { if (bodyDotAllowed === body) {
bodyDotAllowed = ''; bodyDotAllowed = '';
@ -83545,20 +83626,16 @@ class AST {
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
} }
else { else {
const close = this.type === '!' const close = this.type === '!' ?
? // !() must match something,but !(x) can match '' // !() must match something,but !(x) can match ''
'))' + '))' +
(this.isStart() && !dot && !allowDot ? startNoDot : '') + (this.isStart() && !dot && !allowDot ? startNoDot : '') +
star + star +
')' ')'
: this.type === '@' : this.type === '@' ? ')'
? ')' : this.type === '?' ? ')?'
: this.type === '?' : this.type === '+' && bodyDotAllowed ? ')'
? ')?' : this.type === '*' && bodyDotAllowed ? `)?`
: this.type === '+' && bodyDotAllowed
? ')'
: this.type === '*' && bodyDotAllowed
? `)?`
: `)${this.type}`; : `)${this.type}`;
final = start + body + close; final = start + body + close;
} }
@ -83569,6 +83646,42 @@ class AST {
this.#uflag, this.#uflag,
]; ];
} }
#flatten() {
if (!isExtglobAST(this)) {
for (const p of this.#parts) {
if (typeof p === 'object') {
p.#flatten();
}
}
}
else {
// do up to 10 passes to flatten as much as possible
let iterations = 0;
let done = false;
do {
done = true;
for (let i = 0; i < this.#parts.length; i++) {
const c = this.#parts[i];
if (typeof c === 'object') {
c.#flatten();
if (this.#canAdopt(c)) {
done = false;
this.#adopt(c, i);
}
else if (this.#canAdoptWithSpace(c)) {
done = false;
this.#adoptWithSpace(c, i);
}
else if (this.#canUsurp(c)) {
done = false;
this.#usurp(c);
}
}
}
} while (!done && ++iterations < 10);
}
this.#toString = undefined;
}
#partsToRegExp(dot) { #partsToRegExp(dot) {
return this.#parts return this.#parts
.map(p => { .map(p => {
@ -83597,9 +83710,19 @@ class AST {
if (escaping) { if (escaping) {
escaping = false; escaping = false;
re += (reSpecials.has(c) ? '\\' : '') + c; re += (reSpecials.has(c) ? '\\' : '') + c;
inStar = false;
continue; continue;
} }
if (c === '*') {
if (inStar)
continue;
inStar = true;
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
hasMagic = true;
continue;
}
else {
inStar = false;
}
if (c === '\\') { if (c === '\\') {
if (i === glob.length - 1) { if (i === glob.length - 1) {
re += '\\\\'; re += '\\\\';
@ -83616,21 +83739,9 @@ class AST {
uflag = uflag || needUflag; uflag = uflag || needUflag;
i += consumed - 1; i += consumed - 1;
hasMagic = hasMagic || magic; hasMagic = hasMagic || magic;
inStar = false;
continue; continue;
} }
} }
if (c === '*') {
if (inStar)
continue;
inStar = true;
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
hasMagic = true;
continue;
}
else {
inStar = false;
}
if (c === '?') { if (c === '?') {
re += qmark; re += qmark;
hasMagic = true; hasMagic = true;
@ -83647,18 +83758,26 @@ _a = AST;
/** /**
* 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_escape = (s, { windowsPathsNoEscape = false, } = {}) => { const escape_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 ']'.
return windowsPathsNoEscape if (magicalBraces) {
? s.replace(/[?*()[\]]/g, '[$&]') return windowsPathsNoEscape ?
s.replace(/[?*()[\]{}]/g, '[$&]')
: s.replace(/[?*()[\]\\{}]/g, '\\$&');
}
return windowsPathsNoEscape ?
s.replace(/[?*()[\]]/g, '[$&]')
: s.replace(/[?*()[\]\\]/g, '\\$&'); : s.replace(/[?*()[\]\\]/g, '\\$&');
}; };
//# sourceMappingURL=escape.js.map //# sourceMappingURL=escape.js.map
@ -83728,8 +83847,8 @@ const qmarksTestNoExtDot = ([$0]) => {
return (f) => f.length === len && f !== '.' && f !== '..'; return (f) => f.length === len && f !== '.' && f !== '..';
}; };
/* c8 ignore start */ /* c8 ignore start */
const defaultPlatform = (typeof process === 'object' && process const defaultPlatform = (typeof process === 'object' && process ?
? (typeof process.env === 'object' && (typeof process.env === 'object' &&
process.env && process.env &&
process.env.__MINIMATCH_TESTING_PLATFORM__) || process.env.__MINIMATCH_TESTING_PLATFORM__) ||
process.platform process.platform
@ -83813,7 +83932,7 @@ const braceExpand = (pattern, options = {}) => {
// shortcut. no need to expand. // shortcut. no need to expand.
return [pattern]; return [pattern];
} }
return expand(pattern); return expand(pattern, { max: options.braceExpandMax });
}; };
minimatch.braceExpand = braceExpand; minimatch.braceExpand = braceExpand;
// parse a component of the expanded set. // parse a component of the expanded set.
@ -83868,8 +83987,10 @@ class Minimatch {
this.pattern = pattern; this.pattern = pattern;
this.platform = options.platform || defaultPlatform; this.platform = options.platform || defaultPlatform;
this.isWindows = this.platform === 'win32'; this.isWindows = this.platform === 'win32';
// avoid the annoying deprecation flag lol
const awe = ('allowWindow' + 'sEscape');
this.windowsPathsNoEscape = this.windowsPathsNoEscape =
!!options.windowsPathsNoEscape || options.allowWindowsEscape === false; !!options.windowsPathsNoEscape || options[awe] === false;
if (this.windowsPathsNoEscape) { if (this.windowsPathsNoEscape) {
this.pattern = this.pattern.replace(/\\/g, '/'); this.pattern = this.pattern.replace(/\\/g, '/');
} }
@ -83882,8 +84003,8 @@ class Minimatch {
this.partial = !!options.partial; this.partial = !!options.partial;
this.nocase = !!this.options.nocase; this.nocase = !!this.options.nocase;
this.windowsNoMagicRoot = this.windowsNoMagicRoot =
options.windowsNoMagicRoot !== undefined options.windowsNoMagicRoot !== undefined ?
? options.windowsNoMagicRoot options.windowsNoMagicRoot
: !!(this.isWindows && this.nocase); : !!(this.isWindows && this.nocase);
this.globSet = []; this.globSet = [];
this.globParts = []; this.globParts = [];
@ -83946,7 +84067,10 @@ class Minimatch {
!globMagic.test(s[3]); !globMagic.test(s[3]);
const isDrive = /^[a-z]:/i.test(s[0]); const isDrive = /^[a-z]:/i.test(s[0]);
if (isUNC) { if (isUNC) {
return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; return [
...s.slice(0, 4),
...s.slice(4).map(ss => this.parse(ss)),
];
} }
else if (isDrive) { else if (isDrive) {
return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
@ -83978,7 +84102,7 @@ class Minimatch {
// to the right as possible, even if it increases the number // to the right as possible, even if it increases the number
// of patterns that we have to process. // of patterns that we have to process.
preprocess(globParts) { preprocess(globParts) {
// if we're not in globstar mode, then turn all ** into * // if we're not in globstar mode, then turn ** into *
if (this.options.noglobstar) { if (this.options.noglobstar) {
for (let i = 0; i < globParts.length; i++) { for (let i = 0; i < globParts.length; i++) {
for (let j = 0; j < globParts[i].length; j++) { for (let j = 0; j < globParts[i].length; j++) {
@ -84283,13 +84407,18 @@ class Minimatch {
pattern[2] === '?' && pattern[2] === '?' &&
typeof pattern[3] === 'string' && typeof pattern[3] === 'string' &&
/^[a-z]:$/i.test(pattern[3]); /^[a-z]:$/i.test(pattern[3]);
const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined; const fdi = fileUNC ? 3
const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined; : fileDrive ? 0
: undefined;
const pdi = patternUNC ? 3
: patternDrive ? 0
: undefined;
if (typeof fdi === 'number' && typeof pdi === 'number') { if (typeof fdi === 'number' && typeof pdi === 'number') {
const [fd, pd] = [ const [fd, pd] = [
file[fdi], file[fdi],
pattern[pdi], pattern[pdi],
]; ];
// start matching at the drive letter index of each
if (fd.toLowerCase() === pd.toLowerCase()) { if (fd.toLowerCase() === pd.toLowerCase()) {
pattern[pdi] = fd; pattern[pdi] = fd;
patternStartIndex = pdi; patternStartIndex = pdi;
@ -84298,7 +84427,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);
@ -84309,8 +84438,12 @@ class Minimatch {
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex); return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
} }
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
// split the pattern into head, tail, and middle of ** delimited parts
const firstgs = pattern.indexOf(GLOBSTAR, patternIndex); const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
const lastgs = pattern.lastIndexOf(GLOBSTAR); const lastgs = pattern.lastIndexOf(GLOBSTAR);
// split the pattern up into globstar-delimited sections
// the tail has to be at the end, and the others just have
// to be found in order from the head.
const [head, body, tail] = partial ? [ const [head, body, tail] = partial ? [
pattern.slice(patternIndex, firstgs), pattern.slice(patternIndex, firstgs),
pattern.slice(firstgs + 1), pattern.slice(firstgs + 1),
@ -84320,43 +84453,70 @@ class Minimatch {
pattern.slice(firstgs + 1, lastgs), pattern.slice(firstgs + 1, lastgs),
pattern.slice(lastgs + 1), pattern.slice(lastgs + 1),
]; ];
// check the head, from the current file/pattern index.
if (head.length) { if (head.length) {
const fileHead = file.slice(fileIndex, fileIndex + head.length); const fileHead = file.slice(fileIndex, fileIndex + head.length);
if (!this.#matchOne(fileHead, head, partial, 0, 0)) if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
return false; return false;
}
fileIndex += head.length; fileIndex += head.length;
patternIndex += head.length;
} }
// now we know the head matches!
// if the last portion is not empty, it MUST match the end
// check the tail
let fileTailMatch = 0; let fileTailMatch = 0;
if (tail.length) { if (tail.length) {
// if head + tail > file, then we cannot possibly match
if (tail.length + fileIndex > file.length) if (tail.length + fileIndex > file.length)
return false; return false;
// try to match the tail
let tailStart = file.length - tail.length; let tailStart = file.length - tail.length;
if (this.#matchOne(file, tail, partial, tailStart, 0)) { if (this.#matchOne(file, tail, partial, tailStart, 0)) {
fileTailMatch = tail.length; fileTailMatch = tail.length;
} }
else { else {
// affordance for stuff like a/**/* matching a/b/
// if the last file portion is '', and there's more to the pattern
// then try without the '' bit.
if (file[file.length - 1] !== '' || if (file[file.length - 1] !== '' ||
fileIndex + tail.length === file.length) { fileIndex + tail.length === file.length) {
return false; return false;
} }
tailStart--; tailStart--;
if (!this.#matchOne(file, tail, partial, tailStart, 0)) if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
return false; return false;
}
fileTailMatch = tail.length + 1; fileTailMatch = tail.length + 1;
} }
} }
// now we know the tail matches!
// the middle is zero or more portions wrapped in **, possibly
// containing more ** sections.
// so a/**/b/**/c/**/d has become **/b/**/c/**
// if it's empty, it means a/**/b, just verify we have no bad dots
// if there's no tail, so it ends on /**, then we must have *something*
// after the head, or it's not a matc
if (!body.length) { if (!body.length) {
let sawSome = !!fileTailMatch; let sawSome = !!fileTailMatch;
for (let i = fileIndex; i < file.length - fileTailMatch; i++) { for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
const f = String(file[i]); const f = String(file[i]);
sawSome = true; sawSome = true;
if (f === '.' || f === '..' || if (f === '.' ||
f === '..' ||
(!this.options.dot && f.startsWith('.'))) { (!this.options.dot && f.startsWith('.'))) {
return false; return false;
} }
} }
// in partial mode, we just need to get past all file parts
return partial || sawSome; return partial || sawSome;
} }
// now we know that there's one or more body sections, which can
// be matched anywhere from the 0 index (because the head was pruned)
// through to the length-fileTailMatch index.
// split the body up into sections, and note the minimum index it can
// be found at (start with the length of all previous segments)
// [section, before, after]
const bodySegments = [[[], 0]]; const bodySegments = [[[], 0]];
let currentBody = bodySegments[0]; let currentBody = bodySegments[0];
let nonGsParts = 0; let nonGsParts = 0;
@ -84379,34 +84539,56 @@ class Minimatch {
} }
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch); return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
} }
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { // return false for "nope, not matching"
// return null for "not matching, cannot keep trying"
#matchGlobStarBodySections(file,
// pattern section, last possible position for it
bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
// take the first body segment, and walk from fileIndex to its "after"
// value at the end
// If it doesn't match at that position, we increment, until we hit
// that final possible position, and give up.
// If it does match, then advance and try to rest.
// If any of them fail we keep walking forward.
// this is still a bit recursively painful, but it's more constrained
// than previous implementations, because we never test something that
// can't possibly be a valid matching condition.
const bs = bodySegments[bodyIndex]; const bs = bodySegments[bodyIndex];
if (!bs) { if (!bs) {
// just make sure that there's no bad dots
for (let i = fileIndex; i < file.length; i++) { for (let i = fileIndex; i < file.length; i++) {
sawTail = true; sawTail = true;
const f = file[i]; const f = file[i];
if (f === '.' || f === '..' || if (f === '.' ||
f === '..' ||
(!this.options.dot && f.startsWith('.'))) { (!this.options.dot && f.startsWith('.'))) {
return false; return false;
} }
} }
return sawTail; return sawTail;
} }
// have a non-globstar body section to test
const [body, after] = bs; const [body, after] = bs;
while (fileIndex <= after) { while (fileIndex <= after) {
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0); const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
// if limit exceeded, no match. intentional false negative,
// acceptable break in correctness for security.
if (m && globStarDepth < this.maxGlobstarRecursion) { if (m && globStarDepth < this.maxGlobstarRecursion) {
// match! see if the rest match. if so, we're done!
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
if (sub !== false) if (sub !== false) {
return sub; return sub;
}
} }
const f = file[fileIndex]; const f = file[fileIndex];
if (f === '.' || f === '..' || if (f === '.' ||
f === '..' ||
(!this.options.dot && f.startsWith('.'))) { (!this.options.dot && f.startsWith('.'))) {
return false; return false;
} }
fileIndex++; fileIndex++;
} }
// walked off. no point continuing
return partial || null; return partial || null;
} }
#matchOne(file, pattern, partial, fileIndex, patternIndex) { #matchOne(file, pattern, partial, fileIndex, patternIndex) {
@ -84414,16 +84596,24 @@ class Minimatch {
let pi; let pi;
let pl; let pl;
let fl; let fl;
for (fi = fileIndex, pi = patternIndex, for (fi = fileIndex,
fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { pi = patternIndex,
fl = file.length,
pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
this.debug('matchOne loop'); this.debug('matchOne loop');
let p = pattern[pi]; let p = pattern[pi];
let f = file[fi]; let f = file[fi];
this.debug(pattern, p, f); this.debug(pattern, p, f);
// should be impossible.
// some invalid regexp stuff in the set.
/* c8 ignore start */ /* c8 ignore start */
if (p === false || p === GLOBSTAR) if (p === false || p === GLOBSTAR) {
return false; return false;
}
/* c8 ignore stop */ /* c8 ignore stop */
// something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
let hit; let hit;
if (typeof p === 'string') { if (typeof p === 'string') {
hit = f === p; hit = f === p;
@ -84436,17 +84626,38 @@ class Minimatch {
if (!hit) if (!hit)
return false; return false;
} }
// Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) { if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true; return true;
} }
else if (fi === fl) { else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial; return partial;
} }
else if (pi === pl) { else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
return fi === fl - 1 && file[fi] === ''; return fi === fl - 1 && file[fi] === '';
/* c8 ignore start */ /* c8 ignore start */
} }
else { else {
// should be unreachable.
throw new Error('wtf?'); throw new Error('wtf?');
} }
/* c8 ignore stop */ /* c8 ignore stop */
@ -84470,21 +84681,19 @@ class Minimatch {
fastTest = options.dot ? starTestDot : starTest; fastTest = options.dot ? starTestDot : starTest;
} }
else if ((m = pattern.match(starDotExtRE))) { else if ((m = pattern.match(starDotExtRE))) {
fastTest = (options.nocase fastTest = (options.nocase ?
? options.dot options.dot ?
? starDotExtTestNocaseDot starDotExtTestNocaseDot
: starDotExtTestNocase : starDotExtTestNocase
: options.dot : options.dot ? starDotExtTestDot
? starDotExtTestDot
: starDotExtTest)(m[1]); : starDotExtTest)(m[1]);
} }
else if ((m = pattern.match(qmarksRE))) { else if ((m = pattern.match(qmarksRE))) {
fastTest = (options.nocase fastTest = (options.nocase ?
? options.dot options.dot ?
? qmarksTestNocaseDot qmarksTestNocaseDot
: qmarksTestNocase : qmarksTestNocase
: options.dot : options.dot ? qmarksTestDot
? qmarksTestDot
: qmarksTest)(m); : qmarksTest)(m);
} }
else if ((m = pattern.match(starDotStarRE))) { else if ((m = pattern.match(starDotStarRE))) {
@ -84515,10 +84724,8 @@ class Minimatch {
return this.regexp; return this.regexp;
} }
const options = this.options; const options = this.options;
const twoStar = options.noglobstar const twoStar = options.noglobstar ? esm_star
? esm_star : options.dot ? twoStarDot
: options.dot
? twoStarDot
: twoStarNoDot; : twoStarNoDot;
const flags = new Set(options.nocase ? ['i'] : []); const flags = new Set(options.nocase ? ['i'] : []);
// regexpify non-globstar patterns // regexpify non-globstar patterns
@ -84534,11 +84741,9 @@ class Minimatch {
for (const f of p.flags.split('')) for (const f of p.flags.split(''))
flags.add(f); flags.add(f);
} }
return typeof p === 'string' return (typeof p === 'string' ? esm_regExpEscape(p)
? esm_regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR
: p === GLOBSTAR : p._src);
? GLOBSTAR
: p._src;
}); });
pp.forEach((p, i) => { pp.forEach((p, i) => {
const next = pp[i + 1]; const next = pp[i + 1];
@ -84555,14 +84760,25 @@ class Minimatch {
} }
} }
else if (next === undefined) { else if (next === undefined) {
pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?'; pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
} }
else if (next !== GLOBSTAR) { else if (next !== GLOBSTAR) {
pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next; pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
pp[i + 1] = GLOBSTAR; pp[i + 1] = GLOBSTAR;
} }
}); });
return pp.filter(p => p !== GLOBSTAR).join('/'); const filtered = pp.filter(p => p !== 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 |,
@ -84571,6 +84787,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 + ').+$';

44
dist/upload/index.js vendored
View File

@ -70854,7 +70854,7 @@ __webpack_unused_export__ = defaultContentType
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Glob = void 0; exports.Glob = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const node_url_1 = __nccwpck_require__(3136); const node_url_1 = __nccwpck_require__(3136);
const path_scurry_1 = __nccwpck_require__(8958); const path_scurry_1 = __nccwpck_require__(8958);
const pattern_js_1 = __nccwpck_require__(7813); const pattern_js_1 = __nccwpck_require__(7813);
@ -71107,7 +71107,7 @@ exports.Glob = Glob;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.hasMagic = void 0; exports.hasMagic = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
/** /**
* Return true if the patterns provided contain any magic glob characters, * Return true if the patterns provided contain any magic glob characters,
* given the options provided. * given the options provided.
@ -71144,7 +71144,7 @@ exports.hasMagic = hasMagic;
// Ignores are always parsed in dot:true mode // Ignores are always parsed in dot:true mode
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Ignore = void 0; exports.Ignore = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const pattern_js_1 = __nccwpck_require__(7813); const pattern_js_1 = __nccwpck_require__(7813);
const defaultPlatform = (typeof process === 'object' && const defaultPlatform = (typeof process === 'object' &&
process && process &&
@ -71270,10 +71270,10 @@ exports.globStream = globStream;
exports.globSync = globSync; exports.globSync = globSync;
exports.globIterateSync = globIterateSync; exports.globIterateSync = globIterateSync;
exports.globIterate = globIterate; exports.globIterate = globIterate;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const glob_js_1 = __nccwpck_require__(2981); const glob_js_1 = __nccwpck_require__(2981);
const has_magic_js_1 = __nccwpck_require__(5197); const has_magic_js_1 = __nccwpck_require__(5197);
var minimatch_2 = __nccwpck_require__(6507); var minimatch_2 = __nccwpck_require__(3790);
Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } })); Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } }));
Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } })); Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } }));
var glob_js_2 = __nccwpck_require__(2981); var glob_js_2 = __nccwpck_require__(2981);
@ -71340,7 +71340,7 @@ exports.glob.glob = exports.glob;
// this is just a very light wrapper around 2 arrays with an offset index // this is just a very light wrapper around 2 arrays with an offset index
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Pattern = void 0; exports.Pattern = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
const isPatternList = (pl) => pl.length >= 1; const isPatternList = (pl) => pl.length >= 1;
const isGlobList = (gl) => gl.length >= 1; const isGlobList = (gl) => gl.length >= 1;
/** /**
@ -71565,7 +71565,7 @@ exports.Pattern = Pattern;
// synchronous utility for filtering entries and calculating subwalks // synchronous utility for filtering entries and calculating subwalks
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0; exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;
const minimatch_1 = __nccwpck_require__(6507); const minimatch_1 = __nccwpck_require__(3790);
/** /**
* A cache of which patterns have been processed for a given Path * A cache of which patterns have been processed for a given Path
*/ */
@ -72258,7 +72258,7 @@ exports.GlobStream = GlobStream;
/***/ }), /***/ }),
/***/ 7305: /***/ 8895:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
@ -72278,7 +72278,7 @@ exports.assertValidPattern = assertValidPattern;
/***/ }), /***/ }),
/***/ 1803: /***/ 3238:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
@ -72286,8 +72286,8 @@ exports.assertValidPattern = assertValidPattern;
var _a; var _a;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AST = void 0; exports.AST = void 0;
const brace_expressions_js_1 = __nccwpck_require__(1090); const brace_expressions_js_1 = __nccwpck_require__(5192);
const unescape_js_1 = __nccwpck_require__(851); const unescape_js_1 = __nccwpck_require__(9829);
const types = new Set(['!', '?', '+', '*', '@']); const types = new Set(['!', '?', '+', '*', '@']);
const isExtglobType = (c) => types.has(c); const isExtglobType = (c) => types.has(c);
const isExtglobAST = (c) => isExtglobType(c.type); const isExtglobAST = (c) => isExtglobType(c.type);
@ -73031,7 +73031,7 @@ _a = AST;
/***/ }), /***/ }),
/***/ 1090: /***/ 5192:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
@ -73189,7 +73189,7 @@ exports.parseClass = parseClass;
/***/ }), /***/ }),
/***/ 800: /***/ 6726:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
@ -73217,17 +73217,17 @@ exports.escape = escape;
/***/ }), /***/ }),
/***/ 6507: /***/ 3790:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;
const brace_expansion_1 = __nccwpck_require__(8968); const brace_expansion_1 = __nccwpck_require__(8968);
const assert_valid_pattern_js_1 = __nccwpck_require__(7305); const assert_valid_pattern_js_1 = __nccwpck_require__(8895);
const ast_js_1 = __nccwpck_require__(1803); const ast_js_1 = __nccwpck_require__(3238);
const escape_js_1 = __nccwpck_require__(800); const escape_js_1 = __nccwpck_require__(6726);
const unescape_js_1 = __nccwpck_require__(851); const unescape_js_1 = __nccwpck_require__(9829);
const minimatch = (p, pattern, options = {}) => { const minimatch = (p, pattern, options = {}) => {
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern); (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
// shortcut: comments match nothing. // shortcut: comments match nothing.
@ -74228,11 +74228,11 @@ class Minimatch {
} }
exports.Minimatch = Minimatch; exports.Minimatch = Minimatch;
/* c8 ignore start */ /* c8 ignore start */
var ast_js_2 = __nccwpck_require__(1803); var ast_js_2 = __nccwpck_require__(3238);
Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } })); Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } }));
var escape_js_2 = __nccwpck_require__(800); var escape_js_2 = __nccwpck_require__(6726);
Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } })); Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } }));
var unescape_js_2 = __nccwpck_require__(851); var unescape_js_2 = __nccwpck_require__(9829);
Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } })); Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } }));
/* c8 ignore stop */ /* c8 ignore stop */
exports.minimatch.AST = ast_js_1.AST; exports.minimatch.AST = ast_js_1.AST;
@ -74243,7 +74243,7 @@ exports.minimatch.unescape = unescape_js_1.unescape;
/***/ }), /***/ }),
/***/ 851: /***/ 9829:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {

43
package-lock.json generated
View File

@ -14,7 +14,7 @@
"@actions/github": "^9.0.0", "@actions/github": "^9.0.0",
"@actions/glob": "^0.6.1", "@actions/glob": "^0.6.1",
"@actions/io": "^3.0.2", "@actions/io": "^3.0.2",
"minimatch": "^9.0.3" "minimatch": "^10.1.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
@ -2409,22 +2409,6 @@
"typescript": ">=4.8.4 <6.0.0" "typescript": ">=4.8.4 <6.0.0"
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
"version": "10.2.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "8.56.1", "version": "8.56.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz",
@ -5420,6 +5404,21 @@
"node": ">=10.13.0" "node": ">=10.13.0"
} }
}, },
"node_modules/glob/node_modules/minimatch": {
"version": "9.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.8.tgz",
"integrity": "sha512-reYkDYtj/b19TeqbNZCV4q9t+Yxylf/rYBsLb42SXJatTv4/ylq5lEiAmhA/IToxO7NI2UzNMghHoHuaqDkAjw==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^5.0.2"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/globals": { "node_modules/globals": {
"version": "14.0.0", "version": "14.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
@ -7220,15 +7219,15 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "9.0.8", "version": "10.2.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.8.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
"integrity": "sha512-reYkDYtj/b19TeqbNZCV4q9t+Yxylf/rYBsLb42SXJatTv4/ylq5lEiAmhA/IToxO7NI2UzNMghHoHuaqDkAjw==", "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
"license": "ISC", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"brace-expansion": "^5.0.2" "brace-expansion": "^5.0.2"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.17" "node": "18 || 20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"

View File

@ -38,7 +38,7 @@
"@actions/github": "^9.0.0", "@actions/github": "^9.0.0",
"@actions/glob": "^0.6.1", "@actions/glob": "^0.6.1",
"@actions/io": "^3.0.2", "@actions/io": "^3.0.2",
"minimatch": "^9.0.3" "minimatch": "^10.1.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",