mirror of
https://github.com/github/codeql-action.git
synced 2026-04-01 17:22:19 +00:00
Merge pull request #3521 from github/dependabot/npm_and_yarn/minimatch-3.1.5
Bump minimatch from 3.1.3 to 3.1.5
This commit is contained in:
730
lib/analyze-action-post.js
generated
730
lib/analyze-action-post.js
generated
@@ -49361,6 +49361,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path7.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49757,50 +49758,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
@@ -103376,6 +103474,7 @@ var require_minimatch2 = __commonJS({
|
||||
assertValidPattern(pattern);
|
||||
if (!options) options = {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
||||
@@ -103432,51 +103531,146 @@ var require_minimatch2 = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
}
|
||||
_matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let firstgs = -1;
|
||||
for (let i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let lastgs = -1;
|
||||
for (let i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const head = pattern.slice(patternIndex, firstgs);
|
||||
const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
const tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
var hit;
|
||||
fileIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
const tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
const f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let idx = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
_matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
_matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
const p = pattern[pi];
|
||||
const f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
let hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
this.debug("string match", p, f, hit);
|
||||
@@ -116797,12 +116991,60 @@ var require_unescape = __commonJS({
|
||||
var require_ast = __commonJS({
|
||||
"node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) {
|
||||
"use strict";
|
||||
var _a;
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.AST = void 0;
|
||||
var brace_expressions_js_1 = require_brace_expressions();
|
||||
var unescape_js_1 = require_unescape();
|
||||
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
||||
var isExtglobType = (c) => types.has(c);
|
||||
var isExtglobAST = (c) => isExtglobType(c.type);
|
||||
var adoptionMap = /* @__PURE__ */ new Map([
|
||||
["!", ["@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@"]]
|
||||
]);
|
||||
var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?"]],
|
||||
["@", ["?"]],
|
||||
["+", ["?", "*"]]
|
||||
]);
|
||||
var adoptionAnyMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?", "@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["?", "@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@", "?", "*"]]
|
||||
]);
|
||||
var usurpMap = /* @__PURE__ */ new Map([
|
||||
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
||||
[
|
||||
"?",
|
||||
/* @__PURE__ */ new Map([
|
||||
["*", "*"],
|
||||
["+", "*"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"@",
|
||||
/* @__PURE__ */ new Map([
|
||||
["!", "!"],
|
||||
["?", "?"],
|
||||
["@", "@"],
|
||||
["*", "*"],
|
||||
["+", "+"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"+",
|
||||
/* @__PURE__ */ new Map([
|
||||
["?", "*"],
|
||||
["*", "*"]
|
||||
])
|
||||
]
|
||||
]);
|
||||
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
||||
var startNoDot = "(?!\\.)";
|
||||
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
||||
@@ -116812,7 +117054,8 @@ var require_ast = __commonJS({
|
||||
var qmark = "[^/]";
|
||||
var star = qmark + "*?";
|
||||
var starNoEmpty = qmark + "+?";
|
||||
var AST = class _AST {
|
||||
var ID = 0;
|
||||
var AST = class {
|
||||
type;
|
||||
#root;
|
||||
#hasMagic;
|
||||
@@ -116827,6 +117070,22 @@ var require_ast = __commonJS({
|
||||
// set to true if it's an extglob with no children
|
||||
// (which really means one child of '')
|
||||
#emptyExt = false;
|
||||
id = ++ID;
|
||||
get depth() {
|
||||
return (this.#parent?.depth ?? -1) + 1;
|
||||
}
|
||||
[/* @__PURE__ */ 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(type2, parent, options = {}) {
|
||||
this.type = type2;
|
||||
if (type2)
|
||||
@@ -116892,7 +117151,7 @@ var require_ast = __commonJS({
|
||||
for (const p of parts) {
|
||||
if (p === "")
|
||||
continue;
|
||||
if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) {
|
||||
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
|
||||
throw new Error("invalid part: " + p);
|
||||
}
|
||||
this.#parts.push(p);
|
||||
@@ -116917,7 +117176,7 @@ var require_ast = __commonJS({
|
||||
const p = this.#parent;
|
||||
for (let i = 0; i < this.#parentIndex; i++) {
|
||||
const pp = p.#parts[i];
|
||||
if (!(pp instanceof _AST && pp.type === "!")) {
|
||||
if (!(pp instanceof _a && pp.type === "!")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -116942,13 +117201,14 @@ var require_ast = __commonJS({
|
||||
this.push(part.clone(this));
|
||||
}
|
||||
clone(parent) {
|
||||
const c = new _AST(this.type, parent);
|
||||
const c = new _a(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str2, ast, pos, opt) {
|
||||
static #parseAST(str2, ast, pos, opt, extDepth) {
|
||||
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
||||
let escaping = false;
|
||||
let inBrace = false;
|
||||
let braceStart = -1;
|
||||
@@ -116980,11 +117240,12 @@ var require_ast = __commonJS({
|
||||
acc2 += c;
|
||||
continue;
|
||||
}
|
||||
if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
|
||||
if (doRecurse) {
|
||||
ast.push(acc2);
|
||||
acc2 = "";
|
||||
const ext = new _AST(c, ast);
|
||||
i2 = _AST.#parseAST(str2, ext, i2, opt);
|
||||
const ext = new _a(c, ast);
|
||||
i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1);
|
||||
ast.push(ext);
|
||||
continue;
|
||||
}
|
||||
@@ -116994,7 +117255,7 @@ var require_ast = __commonJS({
|
||||
return i2;
|
||||
}
|
||||
let i = pos + 1;
|
||||
let part = new _AST(null, ast);
|
||||
let part = new _a(null, ast);
|
||||
const parts = [];
|
||||
let acc = "";
|
||||
while (i < str2.length) {
|
||||
@@ -117021,19 +117282,22 @@ var require_ast = __commonJS({
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (isExtglobType(c) && str2.charAt(i) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
||||
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
||||
if (doRecurse) {
|
||||
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
const ext = new _AST(c, part);
|
||||
const ext = new _a(c, part);
|
||||
part.push(ext);
|
||||
i = _AST.#parseAST(str2, ext, i, opt);
|
||||
i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd);
|
||||
continue;
|
||||
}
|
||||
if (c === "|") {
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
parts.push(part);
|
||||
part = new _AST(null, ast);
|
||||
part = new _a(null, ast);
|
||||
continue;
|
||||
}
|
||||
if (c === ")") {
|
||||
@@ -117052,9 +117316,71 @@ var require_ast = __commonJS({
|
||||
ast.#parts = [str2.substring(pos - 1)];
|
||||
return i;
|
||||
}
|
||||
#canAdoptWithSpace(child) {
|
||||
return this.#canAdopt(child, adoptionWithSpaceMap);
|
||||
}
|
||||
#canAdopt(child, map2 = adoptionMap) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canAdoptType(gc.type, map2);
|
||||
}
|
||||
#canAdoptType(c, map2 = adoptionAnyMap) {
|
||||
return !!map2.get(this.type)?.includes(c);
|
||||
}
|
||||
#adoptWithSpace(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
const blank = new _a(null, gc, this.options);
|
||||
blank.#parts.push("");
|
||||
gc.push(blank);
|
||||
this.#adopt(child, index);
|
||||
}
|
||||
#adopt(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
this.#parts.splice(index, 1, ...gc.#parts);
|
||||
for (const p of gc.#parts) {
|
||||
if (typeof p === "object")
|
||||
p.#parent = this;
|
||||
}
|
||||
this.#toString = void 0;
|
||||
}
|
||||
#canUsurpType(c) {
|
||||
const m = usurpMap.get(this.type);
|
||||
return !!m?.has(c);
|
||||
}
|
||||
#canUsurp(child) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canUsurpType(gc.type);
|
||||
}
|
||||
#usurp(child) {
|
||||
const m = usurpMap.get(this.type);
|
||||
const gc = child.#parts[0];
|
||||
const nt = m?.get(gc.type);
|
||||
if (!nt)
|
||||
return false;
|
||||
this.#parts = gc.#parts;
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === "object") {
|
||||
p.#parent = this;
|
||||
}
|
||||
}
|
||||
this.type = nt;
|
||||
this.#toString = void 0;
|
||||
this.#emptyExt = false;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new _AST(null, void 0, options);
|
||||
_AST.#parseAST(pattern, ast, 0, options);
|
||||
const ast = new _a(null, void 0, options);
|
||||
_a.#parseAST(pattern, ast, 0, options, 0);
|
||||
return ast;
|
||||
}
|
||||
// returns the regular expression if there's magic, or the unescaped
|
||||
@@ -117148,12 +117474,14 @@ var require_ast = __commonJS({
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this)
|
||||
if (this.#root === this) {
|
||||
this.#flatten();
|
||||
this.#fillNegs();
|
||||
if (!this.type) {
|
||||
}
|
||||
if (!isExtglobAST(this)) {
|
||||
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
||||
const src = this.#parts.map((p) => {
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
@@ -117192,9 +117520,10 @@ var require_ast = __commonJS({
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
||||
const s = this.toString();
|
||||
this.#parts = [s];
|
||||
this.type = null;
|
||||
this.#hasMagic = void 0;
|
||||
const me = this;
|
||||
me.#parts = [s];
|
||||
me.type = null;
|
||||
me.#hasMagic = void 0;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
|
||||
@@ -117221,6 +117550,38 @@ var require_ast = __commonJS({
|
||||
this.#uflag
|
||||
];
|
||||
}
|
||||
#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 = void 0;
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts.map((p) => {
|
||||
if (typeof p === "string") {
|
||||
@@ -117282,6 +117643,7 @@ var require_ast = __commonJS({
|
||||
}
|
||||
};
|
||||
exports2.AST = AST;
|
||||
_a = AST;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -117466,11 +117828,13 @@ var require_commonjs20 = __commonJS({
|
||||
isWindows;
|
||||
platform;
|
||||
windowsNoMagicRoot;
|
||||
maxGlobstarRecursion;
|
||||
regexp;
|
||||
constructor(pattern, options = {}) {
|
||||
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
||||
this.pattern = pattern;
|
||||
this.platform = options.platform || defaultPlatform;
|
||||
this.isWindows = this.platform === "win32";
|
||||
@@ -117807,7 +118171,8 @@ var require_commonjs20 = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial = false) {
|
||||
const options = this.options;
|
||||
let fileStartIndex = 0;
|
||||
let patternStartIndex = 0;
|
||||
if (this.isWindows) {
|
||||
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
||||
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
||||
@@ -117822,11 +118187,8 @@ var require_commonjs20 = __commonJS({
|
||||
];
|
||||
if (fd.toLowerCase() === pd.toLowerCase()) {
|
||||
pattern[pdi] = fd;
|
||||
if (pdi > fdi) {
|
||||
pattern = pattern.slice(pdi);
|
||||
} else if (fdi > pdi) {
|
||||
file = file.slice(fdi);
|
||||
}
|
||||
patternStartIndex = pdi;
|
||||
fileStartIndex = fdi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117834,49 +118196,123 @@ var require_commonjs20 = __commonJS({
|
||||
if (optimizationLevel >= 2) {
|
||||
file = this.levelTwoFileOptimize(file);
|
||||
}
|
||||
this.debug("matchOne", this, { file, pattern });
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) {
|
||||
if (pattern.includes(exports2.GLOBSTAR)) {
|
||||
return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex);
|
||||
const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR);
|
||||
const [head, body, tail] = partial ? [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1),
|
||||
[]
|
||||
] : [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1, lastgs),
|
||||
pattern.slice(lastgs + 1)
|
||||
];
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (p === exports2.GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
fileIndex += head.length;
|
||||
patternIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length)
|
||||
return false;
|
||||
let tailStart = file.length - tail.length;
|
||||
if (this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) {
|
||||
return true;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
|
||||
const f = String(file[i2]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === exports2.GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let i = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
||||
}
|
||||
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi;
|
||||
let pi;
|
||||
let pl;
|
||||
let fl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
let p = pattern[pi];
|
||||
let f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === exports2.GLOBSTAR) {
|
||||
return false;
|
||||
}
|
||||
let hit;
|
||||
|
||||
176
lib/analyze-action.js
generated
176
lib/analyze-action.js
generated
@@ -49361,6 +49361,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path16.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49757,50 +49758,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
176
lib/autobuild-action.js
generated
176
lib/autobuild-action.js
generated
@@ -49361,6 +49361,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path7.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49757,50 +49758,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
730
lib/init-action-post.js
generated
730
lib/init-action-post.js
generated
@@ -49361,6 +49361,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path18.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49757,50 +49758,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
@@ -103376,6 +103474,7 @@ var require_minimatch2 = __commonJS({
|
||||
assertValidPattern(pattern);
|
||||
if (!options) options = {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
||||
@@ -103432,51 +103531,146 @@ var require_minimatch2 = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
}
|
||||
_matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let firstgs = -1;
|
||||
for (let i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let lastgs = -1;
|
||||
for (let i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const head = pattern.slice(patternIndex, firstgs);
|
||||
const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
const tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
var hit;
|
||||
fileIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
const tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
const f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let idx = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
_matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
_matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
const p = pattern[pi];
|
||||
const f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
let hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
this.debug("string match", p, f, hit);
|
||||
@@ -116797,12 +116991,60 @@ var require_unescape = __commonJS({
|
||||
var require_ast = __commonJS({
|
||||
"node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) {
|
||||
"use strict";
|
||||
var _a;
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.AST = void 0;
|
||||
var brace_expressions_js_1 = require_brace_expressions();
|
||||
var unescape_js_1 = require_unescape();
|
||||
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
||||
var isExtglobType = (c) => types.has(c);
|
||||
var isExtglobAST = (c) => isExtglobType(c.type);
|
||||
var adoptionMap = /* @__PURE__ */ new Map([
|
||||
["!", ["@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@"]]
|
||||
]);
|
||||
var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?"]],
|
||||
["@", ["?"]],
|
||||
["+", ["?", "*"]]
|
||||
]);
|
||||
var adoptionAnyMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?", "@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["?", "@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@", "?", "*"]]
|
||||
]);
|
||||
var usurpMap = /* @__PURE__ */ new Map([
|
||||
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
||||
[
|
||||
"?",
|
||||
/* @__PURE__ */ new Map([
|
||||
["*", "*"],
|
||||
["+", "*"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"@",
|
||||
/* @__PURE__ */ new Map([
|
||||
["!", "!"],
|
||||
["?", "?"],
|
||||
["@", "@"],
|
||||
["*", "*"],
|
||||
["+", "+"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"+",
|
||||
/* @__PURE__ */ new Map([
|
||||
["?", "*"],
|
||||
["*", "*"]
|
||||
])
|
||||
]
|
||||
]);
|
||||
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
||||
var startNoDot = "(?!\\.)";
|
||||
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
||||
@@ -116812,7 +117054,8 @@ var require_ast = __commonJS({
|
||||
var qmark = "[^/]";
|
||||
var star = qmark + "*?";
|
||||
var starNoEmpty = qmark + "+?";
|
||||
var AST = class _AST {
|
||||
var ID = 0;
|
||||
var AST = class {
|
||||
type;
|
||||
#root;
|
||||
#hasMagic;
|
||||
@@ -116827,6 +117070,22 @@ var require_ast = __commonJS({
|
||||
// set to true if it's an extglob with no children
|
||||
// (which really means one child of '')
|
||||
#emptyExt = false;
|
||||
id = ++ID;
|
||||
get depth() {
|
||||
return (this.#parent?.depth ?? -1) + 1;
|
||||
}
|
||||
[/* @__PURE__ */ 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(type2, parent, options = {}) {
|
||||
this.type = type2;
|
||||
if (type2)
|
||||
@@ -116892,7 +117151,7 @@ var require_ast = __commonJS({
|
||||
for (const p of parts) {
|
||||
if (p === "")
|
||||
continue;
|
||||
if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) {
|
||||
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
|
||||
throw new Error("invalid part: " + p);
|
||||
}
|
||||
this.#parts.push(p);
|
||||
@@ -116917,7 +117176,7 @@ var require_ast = __commonJS({
|
||||
const p = this.#parent;
|
||||
for (let i = 0; i < this.#parentIndex; i++) {
|
||||
const pp = p.#parts[i];
|
||||
if (!(pp instanceof _AST && pp.type === "!")) {
|
||||
if (!(pp instanceof _a && pp.type === "!")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -116942,13 +117201,14 @@ var require_ast = __commonJS({
|
||||
this.push(part.clone(this));
|
||||
}
|
||||
clone(parent) {
|
||||
const c = new _AST(this.type, parent);
|
||||
const c = new _a(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str2, ast, pos, opt) {
|
||||
static #parseAST(str2, ast, pos, opt, extDepth) {
|
||||
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
||||
let escaping = false;
|
||||
let inBrace = false;
|
||||
let braceStart = -1;
|
||||
@@ -116980,11 +117240,12 @@ var require_ast = __commonJS({
|
||||
acc2 += c;
|
||||
continue;
|
||||
}
|
||||
if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
|
||||
if (doRecurse) {
|
||||
ast.push(acc2);
|
||||
acc2 = "";
|
||||
const ext = new _AST(c, ast);
|
||||
i2 = _AST.#parseAST(str2, ext, i2, opt);
|
||||
const ext = new _a(c, ast);
|
||||
i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1);
|
||||
ast.push(ext);
|
||||
continue;
|
||||
}
|
||||
@@ -116994,7 +117255,7 @@ var require_ast = __commonJS({
|
||||
return i2;
|
||||
}
|
||||
let i = pos + 1;
|
||||
let part = new _AST(null, ast);
|
||||
let part = new _a(null, ast);
|
||||
const parts = [];
|
||||
let acc = "";
|
||||
while (i < str2.length) {
|
||||
@@ -117021,19 +117282,22 @@ var require_ast = __commonJS({
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (isExtglobType(c) && str2.charAt(i) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
||||
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
||||
if (doRecurse) {
|
||||
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
const ext = new _AST(c, part);
|
||||
const ext = new _a(c, part);
|
||||
part.push(ext);
|
||||
i = _AST.#parseAST(str2, ext, i, opt);
|
||||
i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd);
|
||||
continue;
|
||||
}
|
||||
if (c === "|") {
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
parts.push(part);
|
||||
part = new _AST(null, ast);
|
||||
part = new _a(null, ast);
|
||||
continue;
|
||||
}
|
||||
if (c === ")") {
|
||||
@@ -117052,9 +117316,71 @@ var require_ast = __commonJS({
|
||||
ast.#parts = [str2.substring(pos - 1)];
|
||||
return i;
|
||||
}
|
||||
#canAdoptWithSpace(child) {
|
||||
return this.#canAdopt(child, adoptionWithSpaceMap);
|
||||
}
|
||||
#canAdopt(child, map2 = adoptionMap) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canAdoptType(gc.type, map2);
|
||||
}
|
||||
#canAdoptType(c, map2 = adoptionAnyMap) {
|
||||
return !!map2.get(this.type)?.includes(c);
|
||||
}
|
||||
#adoptWithSpace(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
const blank = new _a(null, gc, this.options);
|
||||
blank.#parts.push("");
|
||||
gc.push(blank);
|
||||
this.#adopt(child, index);
|
||||
}
|
||||
#adopt(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
this.#parts.splice(index, 1, ...gc.#parts);
|
||||
for (const p of gc.#parts) {
|
||||
if (typeof p === "object")
|
||||
p.#parent = this;
|
||||
}
|
||||
this.#toString = void 0;
|
||||
}
|
||||
#canUsurpType(c) {
|
||||
const m = usurpMap.get(this.type);
|
||||
return !!m?.has(c);
|
||||
}
|
||||
#canUsurp(child) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canUsurpType(gc.type);
|
||||
}
|
||||
#usurp(child) {
|
||||
const m = usurpMap.get(this.type);
|
||||
const gc = child.#parts[0];
|
||||
const nt = m?.get(gc.type);
|
||||
if (!nt)
|
||||
return false;
|
||||
this.#parts = gc.#parts;
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === "object") {
|
||||
p.#parent = this;
|
||||
}
|
||||
}
|
||||
this.type = nt;
|
||||
this.#toString = void 0;
|
||||
this.#emptyExt = false;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new _AST(null, void 0, options);
|
||||
_AST.#parseAST(pattern, ast, 0, options);
|
||||
const ast = new _a(null, void 0, options);
|
||||
_a.#parseAST(pattern, ast, 0, options, 0);
|
||||
return ast;
|
||||
}
|
||||
// returns the regular expression if there's magic, or the unescaped
|
||||
@@ -117148,12 +117474,14 @@ var require_ast = __commonJS({
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this)
|
||||
if (this.#root === this) {
|
||||
this.#flatten();
|
||||
this.#fillNegs();
|
||||
if (!this.type) {
|
||||
}
|
||||
if (!isExtglobAST(this)) {
|
||||
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
||||
const src = this.#parts.map((p) => {
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
@@ -117192,9 +117520,10 @@ var require_ast = __commonJS({
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
||||
const s = this.toString();
|
||||
this.#parts = [s];
|
||||
this.type = null;
|
||||
this.#hasMagic = void 0;
|
||||
const me = this;
|
||||
me.#parts = [s];
|
||||
me.type = null;
|
||||
me.#hasMagic = void 0;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
|
||||
@@ -117221,6 +117550,38 @@ var require_ast = __commonJS({
|
||||
this.#uflag
|
||||
];
|
||||
}
|
||||
#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 = void 0;
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts.map((p) => {
|
||||
if (typeof p === "string") {
|
||||
@@ -117282,6 +117643,7 @@ var require_ast = __commonJS({
|
||||
}
|
||||
};
|
||||
exports2.AST = AST;
|
||||
_a = AST;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -117466,11 +117828,13 @@ var require_commonjs20 = __commonJS({
|
||||
isWindows;
|
||||
platform;
|
||||
windowsNoMagicRoot;
|
||||
maxGlobstarRecursion;
|
||||
regexp;
|
||||
constructor(pattern, options = {}) {
|
||||
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
||||
this.pattern = pattern;
|
||||
this.platform = options.platform || defaultPlatform;
|
||||
this.isWindows = this.platform === "win32";
|
||||
@@ -117807,7 +118171,8 @@ var require_commonjs20 = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial = false) {
|
||||
const options = this.options;
|
||||
let fileStartIndex = 0;
|
||||
let patternStartIndex = 0;
|
||||
if (this.isWindows) {
|
||||
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
||||
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
||||
@@ -117822,11 +118187,8 @@ var require_commonjs20 = __commonJS({
|
||||
];
|
||||
if (fd.toLowerCase() === pd.toLowerCase()) {
|
||||
pattern[pdi] = fd;
|
||||
if (pdi > fdi) {
|
||||
pattern = pattern.slice(pdi);
|
||||
} else if (fdi > pdi) {
|
||||
file = file.slice(fdi);
|
||||
}
|
||||
patternStartIndex = pdi;
|
||||
fileStartIndex = fdi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117834,49 +118196,123 @@ var require_commonjs20 = __commonJS({
|
||||
if (optimizationLevel >= 2) {
|
||||
file = this.levelTwoFileOptimize(file);
|
||||
}
|
||||
this.debug("matchOne", this, { file, pattern });
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) {
|
||||
if (pattern.includes(exports2.GLOBSTAR)) {
|
||||
return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex);
|
||||
const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR);
|
||||
const [head, body, tail] = partial ? [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1),
|
||||
[]
|
||||
] : [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1, lastgs),
|
||||
pattern.slice(lastgs + 1)
|
||||
];
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (p === exports2.GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
fileIndex += head.length;
|
||||
patternIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length)
|
||||
return false;
|
||||
let tailStart = file.length - tail.length;
|
||||
if (this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) {
|
||||
return true;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
|
||||
const f = String(file[i2]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === exports2.GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let i = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
||||
}
|
||||
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi;
|
||||
let pi;
|
||||
let pl;
|
||||
let fl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
let p = pattern[pi];
|
||||
let f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === exports2.GLOBSTAR) {
|
||||
return false;
|
||||
}
|
||||
let hit;
|
||||
|
||||
176
lib/init-action.js
generated
176
lib/init-action.js
generated
@@ -49512,6 +49512,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path17.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49908,50 +49909,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
176
lib/resolve-environment-action.js
generated
176
lib/resolve-environment-action.js
generated
@@ -49361,6 +49361,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path5.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49757,50 +49758,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
176
lib/setup-codeql-action.js
generated
176
lib/setup-codeql-action.js
generated
@@ -48064,6 +48064,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path9.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -48460,50 +48461,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
730
lib/start-proxy-action-post.js
generated
730
lib/start-proxy-action-post.js
generated
@@ -49361,6 +49361,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path4.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49757,50 +49758,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
@@ -102003,6 +102101,7 @@ var require_minimatch2 = __commonJS({
|
||||
assertValidPattern(pattern);
|
||||
if (!options) options = {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
||||
@@ -102059,51 +102158,146 @@ var require_minimatch2 = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
}
|
||||
_matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let firstgs = -1;
|
||||
for (let i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let lastgs = -1;
|
||||
for (let i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const head = pattern.slice(patternIndex, firstgs);
|
||||
const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
const tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
var hit;
|
||||
fileIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
const tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
const f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let idx = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
_matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
_matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
const p = pattern[pi];
|
||||
const f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
let hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
this.debug("string match", p, f, hit);
|
||||
@@ -115424,12 +115618,60 @@ var require_unescape = __commonJS({
|
||||
var require_ast = __commonJS({
|
||||
"node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) {
|
||||
"use strict";
|
||||
var _a;
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.AST = void 0;
|
||||
var brace_expressions_js_1 = require_brace_expressions();
|
||||
var unescape_js_1 = require_unescape();
|
||||
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
||||
var isExtglobType = (c) => types.has(c);
|
||||
var isExtglobAST = (c) => isExtglobType(c.type);
|
||||
var adoptionMap = /* @__PURE__ */ new Map([
|
||||
["!", ["@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@"]]
|
||||
]);
|
||||
var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?"]],
|
||||
["@", ["?"]],
|
||||
["+", ["?", "*"]]
|
||||
]);
|
||||
var adoptionAnyMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?", "@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["?", "@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@", "?", "*"]]
|
||||
]);
|
||||
var usurpMap = /* @__PURE__ */ new Map([
|
||||
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
||||
[
|
||||
"?",
|
||||
/* @__PURE__ */ new Map([
|
||||
["*", "*"],
|
||||
["+", "*"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"@",
|
||||
/* @__PURE__ */ new Map([
|
||||
["!", "!"],
|
||||
["?", "?"],
|
||||
["@", "@"],
|
||||
["*", "*"],
|
||||
["+", "+"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"+",
|
||||
/* @__PURE__ */ new Map([
|
||||
["?", "*"],
|
||||
["*", "*"]
|
||||
])
|
||||
]
|
||||
]);
|
||||
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
||||
var startNoDot = "(?!\\.)";
|
||||
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
||||
@@ -115439,7 +115681,8 @@ var require_ast = __commonJS({
|
||||
var qmark = "[^/]";
|
||||
var star = qmark + "*?";
|
||||
var starNoEmpty = qmark + "+?";
|
||||
var AST = class _AST {
|
||||
var ID = 0;
|
||||
var AST = class {
|
||||
type;
|
||||
#root;
|
||||
#hasMagic;
|
||||
@@ -115454,6 +115697,22 @@ var require_ast = __commonJS({
|
||||
// set to true if it's an extglob with no children
|
||||
// (which really means one child of '')
|
||||
#emptyExt = false;
|
||||
id = ++ID;
|
||||
get depth() {
|
||||
return (this.#parent?.depth ?? -1) + 1;
|
||||
}
|
||||
[/* @__PURE__ */ 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(type2, parent, options = {}) {
|
||||
this.type = type2;
|
||||
if (type2)
|
||||
@@ -115519,7 +115778,7 @@ var require_ast = __commonJS({
|
||||
for (const p of parts) {
|
||||
if (p === "")
|
||||
continue;
|
||||
if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) {
|
||||
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
|
||||
throw new Error("invalid part: " + p);
|
||||
}
|
||||
this.#parts.push(p);
|
||||
@@ -115544,7 +115803,7 @@ var require_ast = __commonJS({
|
||||
const p = this.#parent;
|
||||
for (let i = 0; i < this.#parentIndex; i++) {
|
||||
const pp = p.#parts[i];
|
||||
if (!(pp instanceof _AST && pp.type === "!")) {
|
||||
if (!(pp instanceof _a && pp.type === "!")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -115569,13 +115828,14 @@ var require_ast = __commonJS({
|
||||
this.push(part.clone(this));
|
||||
}
|
||||
clone(parent) {
|
||||
const c = new _AST(this.type, parent);
|
||||
const c = new _a(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str2, ast, pos, opt) {
|
||||
static #parseAST(str2, ast, pos, opt, extDepth) {
|
||||
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
||||
let escaping = false;
|
||||
let inBrace = false;
|
||||
let braceStart = -1;
|
||||
@@ -115607,11 +115867,12 @@ var require_ast = __commonJS({
|
||||
acc2 += c;
|
||||
continue;
|
||||
}
|
||||
if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
|
||||
if (doRecurse) {
|
||||
ast.push(acc2);
|
||||
acc2 = "";
|
||||
const ext = new _AST(c, ast);
|
||||
i2 = _AST.#parseAST(str2, ext, i2, opt);
|
||||
const ext = new _a(c, ast);
|
||||
i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1);
|
||||
ast.push(ext);
|
||||
continue;
|
||||
}
|
||||
@@ -115621,7 +115882,7 @@ var require_ast = __commonJS({
|
||||
return i2;
|
||||
}
|
||||
let i = pos + 1;
|
||||
let part = new _AST(null, ast);
|
||||
let part = new _a(null, ast);
|
||||
const parts = [];
|
||||
let acc = "";
|
||||
while (i < str2.length) {
|
||||
@@ -115648,19 +115909,22 @@ var require_ast = __commonJS({
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (isExtglobType(c) && str2.charAt(i) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
||||
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
||||
if (doRecurse) {
|
||||
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
const ext = new _AST(c, part);
|
||||
const ext = new _a(c, part);
|
||||
part.push(ext);
|
||||
i = _AST.#parseAST(str2, ext, i, opt);
|
||||
i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd);
|
||||
continue;
|
||||
}
|
||||
if (c === "|") {
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
parts.push(part);
|
||||
part = new _AST(null, ast);
|
||||
part = new _a(null, ast);
|
||||
continue;
|
||||
}
|
||||
if (c === ")") {
|
||||
@@ -115679,9 +115943,71 @@ var require_ast = __commonJS({
|
||||
ast.#parts = [str2.substring(pos - 1)];
|
||||
return i;
|
||||
}
|
||||
#canAdoptWithSpace(child) {
|
||||
return this.#canAdopt(child, adoptionWithSpaceMap);
|
||||
}
|
||||
#canAdopt(child, map2 = adoptionMap) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canAdoptType(gc.type, map2);
|
||||
}
|
||||
#canAdoptType(c, map2 = adoptionAnyMap) {
|
||||
return !!map2.get(this.type)?.includes(c);
|
||||
}
|
||||
#adoptWithSpace(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
const blank = new _a(null, gc, this.options);
|
||||
blank.#parts.push("");
|
||||
gc.push(blank);
|
||||
this.#adopt(child, index);
|
||||
}
|
||||
#adopt(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
this.#parts.splice(index, 1, ...gc.#parts);
|
||||
for (const p of gc.#parts) {
|
||||
if (typeof p === "object")
|
||||
p.#parent = this;
|
||||
}
|
||||
this.#toString = void 0;
|
||||
}
|
||||
#canUsurpType(c) {
|
||||
const m = usurpMap.get(this.type);
|
||||
return !!m?.has(c);
|
||||
}
|
||||
#canUsurp(child) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canUsurpType(gc.type);
|
||||
}
|
||||
#usurp(child) {
|
||||
const m = usurpMap.get(this.type);
|
||||
const gc = child.#parts[0];
|
||||
const nt = m?.get(gc.type);
|
||||
if (!nt)
|
||||
return false;
|
||||
this.#parts = gc.#parts;
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === "object") {
|
||||
p.#parent = this;
|
||||
}
|
||||
}
|
||||
this.type = nt;
|
||||
this.#toString = void 0;
|
||||
this.#emptyExt = false;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new _AST(null, void 0, options);
|
||||
_AST.#parseAST(pattern, ast, 0, options);
|
||||
const ast = new _a(null, void 0, options);
|
||||
_a.#parseAST(pattern, ast, 0, options, 0);
|
||||
return ast;
|
||||
}
|
||||
// returns the regular expression if there's magic, or the unescaped
|
||||
@@ -115775,12 +116101,14 @@ var require_ast = __commonJS({
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this)
|
||||
if (this.#root === this) {
|
||||
this.#flatten();
|
||||
this.#fillNegs();
|
||||
if (!this.type) {
|
||||
}
|
||||
if (!isExtglobAST(this)) {
|
||||
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
||||
const src = this.#parts.map((p) => {
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
@@ -115819,9 +116147,10 @@ var require_ast = __commonJS({
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
||||
const s = this.toString();
|
||||
this.#parts = [s];
|
||||
this.type = null;
|
||||
this.#hasMagic = void 0;
|
||||
const me = this;
|
||||
me.#parts = [s];
|
||||
me.type = null;
|
||||
me.#hasMagic = void 0;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
|
||||
@@ -115848,6 +116177,38 @@ var require_ast = __commonJS({
|
||||
this.#uflag
|
||||
];
|
||||
}
|
||||
#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 = void 0;
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts.map((p) => {
|
||||
if (typeof p === "string") {
|
||||
@@ -115909,6 +116270,7 @@ var require_ast = __commonJS({
|
||||
}
|
||||
};
|
||||
exports2.AST = AST;
|
||||
_a = AST;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -116093,11 +116455,13 @@ var require_commonjs20 = __commonJS({
|
||||
isWindows;
|
||||
platform;
|
||||
windowsNoMagicRoot;
|
||||
maxGlobstarRecursion;
|
||||
regexp;
|
||||
constructor(pattern, options = {}) {
|
||||
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
||||
this.pattern = pattern;
|
||||
this.platform = options.platform || defaultPlatform;
|
||||
this.isWindows = this.platform === "win32";
|
||||
@@ -116434,7 +116798,8 @@ var require_commonjs20 = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial = false) {
|
||||
const options = this.options;
|
||||
let fileStartIndex = 0;
|
||||
let patternStartIndex = 0;
|
||||
if (this.isWindows) {
|
||||
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
||||
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
||||
@@ -116449,11 +116814,8 @@ var require_commonjs20 = __commonJS({
|
||||
];
|
||||
if (fd.toLowerCase() === pd.toLowerCase()) {
|
||||
pattern[pdi] = fd;
|
||||
if (pdi > fdi) {
|
||||
pattern = pattern.slice(pdi);
|
||||
} else if (fdi > pdi) {
|
||||
file = file.slice(fdi);
|
||||
}
|
||||
patternStartIndex = pdi;
|
||||
fileStartIndex = fdi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116461,49 +116823,123 @@ var require_commonjs20 = __commonJS({
|
||||
if (optimizationLevel >= 2) {
|
||||
file = this.levelTwoFileOptimize(file);
|
||||
}
|
||||
this.debug("matchOne", this, { file, pattern });
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) {
|
||||
if (pattern.includes(exports2.GLOBSTAR)) {
|
||||
return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex);
|
||||
const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR);
|
||||
const [head, body, tail] = partial ? [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1),
|
||||
[]
|
||||
] : [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1, lastgs),
|
||||
pattern.slice(lastgs + 1)
|
||||
];
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (p === exports2.GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
fileIndex += head.length;
|
||||
patternIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length)
|
||||
return false;
|
||||
let tailStart = file.length - tail.length;
|
||||
if (this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) {
|
||||
return true;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
|
||||
const f = String(file[i2]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === exports2.GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let i = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
||||
}
|
||||
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi;
|
||||
let pi;
|
||||
let pl;
|
||||
let fl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
let p = pattern[pi];
|
||||
let f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === exports2.GLOBSTAR) {
|
||||
return false;
|
||||
}
|
||||
let hit;
|
||||
|
||||
176
lib/start-proxy-action.js
generated
176
lib/start-proxy-action.js
generated
@@ -48064,6 +48064,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path5.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -48460,50 +48461,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
176
lib/upload-lib.js
generated
176
lib/upload-lib.js
generated
@@ -49361,6 +49361,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path12.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -49757,50 +49758,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
730
lib/upload-sarif-action-post.js
generated
730
lib/upload-sarif-action-post.js
generated
@@ -94285,6 +94285,7 @@ var require_minimatch = __commonJS({
|
||||
assertValidPattern(pattern);
|
||||
if (!options) options = {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
||||
@@ -94341,51 +94342,146 @@ var require_minimatch = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
}
|
||||
_matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let firstgs = -1;
|
||||
for (let i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let lastgs = -1;
|
||||
for (let i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const head = pattern.slice(patternIndex, firstgs);
|
||||
const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
const tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
var hit;
|
||||
fileIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
const tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
const f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let idx = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
_matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
_matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
const p = pattern[pi];
|
||||
const f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
let hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
this.debug("string match", p, f, hit);
|
||||
@@ -107706,12 +107802,60 @@ var require_unescape = __commonJS({
|
||||
var require_ast = __commonJS({
|
||||
"node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) {
|
||||
"use strict";
|
||||
var _a;
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.AST = void 0;
|
||||
var brace_expressions_js_1 = require_brace_expressions();
|
||||
var unescape_js_1 = require_unescape();
|
||||
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
||||
var isExtglobType = (c) => types.has(c);
|
||||
var isExtglobAST = (c) => isExtglobType(c.type);
|
||||
var adoptionMap = /* @__PURE__ */ new Map([
|
||||
["!", ["@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@"]]
|
||||
]);
|
||||
var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?"]],
|
||||
["@", ["?"]],
|
||||
["+", ["?", "*"]]
|
||||
]);
|
||||
var adoptionAnyMap = /* @__PURE__ */ new Map([
|
||||
["!", ["?", "@"]],
|
||||
["?", ["?", "@"]],
|
||||
["@", ["?", "@"]],
|
||||
["*", ["*", "+", "?", "@"]],
|
||||
["+", ["+", "@", "?", "*"]]
|
||||
]);
|
||||
var usurpMap = /* @__PURE__ */ new Map([
|
||||
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
||||
[
|
||||
"?",
|
||||
/* @__PURE__ */ new Map([
|
||||
["*", "*"],
|
||||
["+", "*"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"@",
|
||||
/* @__PURE__ */ new Map([
|
||||
["!", "!"],
|
||||
["?", "?"],
|
||||
["@", "@"],
|
||||
["*", "*"],
|
||||
["+", "+"]
|
||||
])
|
||||
],
|
||||
[
|
||||
"+",
|
||||
/* @__PURE__ */ new Map([
|
||||
["?", "*"],
|
||||
["*", "*"]
|
||||
])
|
||||
]
|
||||
]);
|
||||
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
||||
var startNoDot = "(?!\\.)";
|
||||
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
||||
@@ -107721,7 +107865,8 @@ var require_ast = __commonJS({
|
||||
var qmark = "[^/]";
|
||||
var star = qmark + "*?";
|
||||
var starNoEmpty = qmark + "+?";
|
||||
var AST = class _AST {
|
||||
var ID = 0;
|
||||
var AST = class {
|
||||
type;
|
||||
#root;
|
||||
#hasMagic;
|
||||
@@ -107736,6 +107881,22 @@ var require_ast = __commonJS({
|
||||
// set to true if it's an extglob with no children
|
||||
// (which really means one child of '')
|
||||
#emptyExt = false;
|
||||
id = ++ID;
|
||||
get depth() {
|
||||
return (this.#parent?.depth ?? -1) + 1;
|
||||
}
|
||||
[/* @__PURE__ */ 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(type2, parent, options = {}) {
|
||||
this.type = type2;
|
||||
if (type2)
|
||||
@@ -107801,7 +107962,7 @@ var require_ast = __commonJS({
|
||||
for (const p of parts) {
|
||||
if (p === "")
|
||||
continue;
|
||||
if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) {
|
||||
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
|
||||
throw new Error("invalid part: " + p);
|
||||
}
|
||||
this.#parts.push(p);
|
||||
@@ -107826,7 +107987,7 @@ var require_ast = __commonJS({
|
||||
const p = this.#parent;
|
||||
for (let i = 0; i < this.#parentIndex; i++) {
|
||||
const pp = p.#parts[i];
|
||||
if (!(pp instanceof _AST && pp.type === "!")) {
|
||||
if (!(pp instanceof _a && pp.type === "!")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -107851,13 +108012,14 @@ var require_ast = __commonJS({
|
||||
this.push(part.clone(this));
|
||||
}
|
||||
clone(parent) {
|
||||
const c = new _AST(this.type, parent);
|
||||
const c = new _a(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str2, ast, pos, opt) {
|
||||
static #parseAST(str2, ast, pos, opt, extDepth) {
|
||||
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
||||
let escaping = false;
|
||||
let inBrace = false;
|
||||
let braceStart = -1;
|
||||
@@ -107889,11 +108051,12 @@ var require_ast = __commonJS({
|
||||
acc2 += c;
|
||||
continue;
|
||||
}
|
||||
if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
|
||||
if (doRecurse) {
|
||||
ast.push(acc2);
|
||||
acc2 = "";
|
||||
const ext = new _AST(c, ast);
|
||||
i2 = _AST.#parseAST(str2, ext, i2, opt);
|
||||
const ext = new _a(c, ast);
|
||||
i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1);
|
||||
ast.push(ext);
|
||||
continue;
|
||||
}
|
||||
@@ -107903,7 +108066,7 @@ var require_ast = __commonJS({
|
||||
return i2;
|
||||
}
|
||||
let i = pos + 1;
|
||||
let part = new _AST(null, ast);
|
||||
let part = new _a(null, ast);
|
||||
const parts = [];
|
||||
let acc = "";
|
||||
while (i < str2.length) {
|
||||
@@ -107930,19 +108093,22 @@ var require_ast = __commonJS({
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (isExtglobType(c) && str2.charAt(i) === "(") {
|
||||
const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
||||
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
||||
if (doRecurse) {
|
||||
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
const ext = new _AST(c, part);
|
||||
const ext = new _a(c, part);
|
||||
part.push(ext);
|
||||
i = _AST.#parseAST(str2, ext, i, opt);
|
||||
i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd);
|
||||
continue;
|
||||
}
|
||||
if (c === "|") {
|
||||
part.push(acc);
|
||||
acc = "";
|
||||
parts.push(part);
|
||||
part = new _AST(null, ast);
|
||||
part = new _a(null, ast);
|
||||
continue;
|
||||
}
|
||||
if (c === ")") {
|
||||
@@ -107961,9 +108127,71 @@ var require_ast = __commonJS({
|
||||
ast.#parts = [str2.substring(pos - 1)];
|
||||
return i;
|
||||
}
|
||||
#canAdoptWithSpace(child) {
|
||||
return this.#canAdopt(child, adoptionWithSpaceMap);
|
||||
}
|
||||
#canAdopt(child, map2 = adoptionMap) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canAdoptType(gc.type, map2);
|
||||
}
|
||||
#canAdoptType(c, map2 = adoptionAnyMap) {
|
||||
return !!map2.get(this.type)?.includes(c);
|
||||
}
|
||||
#adoptWithSpace(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
const blank = new _a(null, gc, this.options);
|
||||
blank.#parts.push("");
|
||||
gc.push(blank);
|
||||
this.#adopt(child, index);
|
||||
}
|
||||
#adopt(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
this.#parts.splice(index, 1, ...gc.#parts);
|
||||
for (const p of gc.#parts) {
|
||||
if (typeof p === "object")
|
||||
p.#parent = this;
|
||||
}
|
||||
this.#toString = void 0;
|
||||
}
|
||||
#canUsurpType(c) {
|
||||
const m = usurpMap.get(this.type);
|
||||
return !!m?.has(c);
|
||||
}
|
||||
#canUsurp(child) {
|
||||
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== "object" || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canUsurpType(gc.type);
|
||||
}
|
||||
#usurp(child) {
|
||||
const m = usurpMap.get(this.type);
|
||||
const gc = child.#parts[0];
|
||||
const nt = m?.get(gc.type);
|
||||
if (!nt)
|
||||
return false;
|
||||
this.#parts = gc.#parts;
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === "object") {
|
||||
p.#parent = this;
|
||||
}
|
||||
}
|
||||
this.type = nt;
|
||||
this.#toString = void 0;
|
||||
this.#emptyExt = false;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new _AST(null, void 0, options);
|
||||
_AST.#parseAST(pattern, ast, 0, options);
|
||||
const ast = new _a(null, void 0, options);
|
||||
_a.#parseAST(pattern, ast, 0, options, 0);
|
||||
return ast;
|
||||
}
|
||||
// returns the regular expression if there's magic, or the unescaped
|
||||
@@ -108057,12 +108285,14 @@ var require_ast = __commonJS({
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this)
|
||||
if (this.#root === this) {
|
||||
this.#flatten();
|
||||
this.#fillNegs();
|
||||
if (!this.type) {
|
||||
}
|
||||
if (!isExtglobAST(this)) {
|
||||
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
||||
const src = this.#parts.map((p) => {
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
const [re, _2, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
@@ -108101,9 +108331,10 @@ var require_ast = __commonJS({
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
||||
const s = this.toString();
|
||||
this.#parts = [s];
|
||||
this.type = null;
|
||||
this.#hasMagic = void 0;
|
||||
const me = this;
|
||||
me.#parts = [s];
|
||||
me.type = null;
|
||||
me.#hasMagic = void 0;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
|
||||
@@ -108130,6 +108361,38 @@ var require_ast = __commonJS({
|
||||
this.#uflag
|
||||
];
|
||||
}
|
||||
#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 = void 0;
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts.map((p) => {
|
||||
if (typeof p === "string") {
|
||||
@@ -108191,6 +108454,7 @@ var require_ast = __commonJS({
|
||||
}
|
||||
};
|
||||
exports2.AST = AST;
|
||||
_a = AST;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -108375,11 +108639,13 @@ var require_commonjs20 = __commonJS({
|
||||
isWindows;
|
||||
platform;
|
||||
windowsNoMagicRoot;
|
||||
maxGlobstarRecursion;
|
||||
regexp;
|
||||
constructor(pattern, options = {}) {
|
||||
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
||||
this.pattern = pattern;
|
||||
this.platform = options.platform || defaultPlatform;
|
||||
this.isWindows = this.platform === "win32";
|
||||
@@ -108716,7 +108982,8 @@ var require_commonjs20 = __commonJS({
|
||||
// out of pattern, then that's fine, as long as all
|
||||
// the parts match.
|
||||
matchOne(file, pattern, partial = false) {
|
||||
const options = this.options;
|
||||
let fileStartIndex = 0;
|
||||
let patternStartIndex = 0;
|
||||
if (this.isWindows) {
|
||||
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
||||
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
||||
@@ -108731,11 +108998,8 @@ var require_commonjs20 = __commonJS({
|
||||
];
|
||||
if (fd.toLowerCase() === pd.toLowerCase()) {
|
||||
pattern[pdi] = fd;
|
||||
if (pdi > fdi) {
|
||||
pattern = pattern.slice(pdi);
|
||||
} else if (fdi > pdi) {
|
||||
file = file.slice(fdi);
|
||||
}
|
||||
patternStartIndex = pdi;
|
||||
fileStartIndex = fdi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108743,49 +109007,123 @@ var require_commonjs20 = __commonJS({
|
||||
if (optimizationLevel >= 2) {
|
||||
file = this.levelTwoFileOptimize(file);
|
||||
}
|
||||
this.debug("matchOne", this, { file, pattern });
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) {
|
||||
if (pattern.includes(exports2.GLOBSTAR)) {
|
||||
return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
||||
}
|
||||
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
||||
const firstgs = pattern.indexOf(exports2.GLOBSTAR, patternIndex);
|
||||
const lastgs = pattern.lastIndexOf(exports2.GLOBSTAR);
|
||||
const [head, body, tail] = partial ? [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1),
|
||||
[]
|
||||
] : [
|
||||
pattern.slice(patternIndex, firstgs),
|
||||
pattern.slice(firstgs + 1, lastgs),
|
||||
pattern.slice(lastgs + 1)
|
||||
];
|
||||
if (head.length) {
|
||||
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (p === exports2.GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
fileIndex += head.length;
|
||||
patternIndex += head.length;
|
||||
}
|
||||
let fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length)
|
||||
return false;
|
||||
let tailStart = file.length - tail.length;
|
||||
if (this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) {
|
||||
return true;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
let sawSome = !!fileTailMatch;
|
||||
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
|
||||
const f = String(file[i2]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
const bodySegments = [[[], 0]];
|
||||
let currentBody = bodySegments[0];
|
||||
let nonGsParts = 0;
|
||||
const nonGsPartsSums = [0];
|
||||
for (const b of body) {
|
||||
if (b === exports2.GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
let i = bodySegments.length - 1;
|
||||
const fileLength = file.length - fileTailMatch;
|
||||
for (const b of bodySegments) {
|
||||
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
||||
}
|
||||
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
||||
}
|
||||
// return false for "nope, not matching"
|
||||
// return null for "not matching, cannot keep trying"
|
||||
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
const bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (let i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
const f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
const [body, after] = bs;
|
||||
while (fileIndex <= after) {
|
||||
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
const f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
}
|
||||
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
||||
let fi;
|
||||
let pi;
|
||||
let pl;
|
||||
let fl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
let p = pattern[pi];
|
||||
let f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false || p === exports2.GLOBSTAR) {
|
||||
return false;
|
||||
}
|
||||
let hit;
|
||||
@@ -150788,6 +151126,7 @@ var require_minimatch2 = __commonJS({
|
||||
pattern = pattern.split(path3.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -151184,50 +151523,147 @@ var require_minimatch2 = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
176
lib/upload-sarif-action.js
generated
176
lib/upload-sarif-action.js
generated
@@ -48064,6 +48064,7 @@ var require_minimatch = __commonJS({
|
||||
pattern = pattern.split(path13.sep).join("/");
|
||||
}
|
||||
this.options = options;
|
||||
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
||||
this.set = [];
|
||||
this.pattern = pattern;
|
||||
this.regexp = null;
|
||||
@@ -48460,50 +48461,147 @@ var require_minimatch = __commonJS({
|
||||
return this.negate;
|
||||
};
|
||||
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
||||
var options = this.options;
|
||||
this.debug(
|
||||
"matchOne",
|
||||
{ "this": this, file, pattern }
|
||||
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
||||
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
||||
}
|
||||
return this._matchOne(file, pattern, partial, 0, 0);
|
||||
};
|
||||
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var i;
|
||||
var firstgs = -1;
|
||||
for (i = patternIndex; i < pattern.length; i++) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
firstgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var lastgs = -1;
|
||||
for (i = pattern.length - 1; i >= 0; i--) {
|
||||
if (pattern[i] === GLOBSTAR) {
|
||||
lastgs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var head = pattern.slice(patternIndex, firstgs);
|
||||
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
||||
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
||||
if (head.length) {
|
||||
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
||||
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileIndex += head.length;
|
||||
}
|
||||
var fileTailMatch = 0;
|
||||
if (tail.length) {
|
||||
if (tail.length + fileIndex > file.length) return false;
|
||||
var tailStart = file.length - tail.length;
|
||||
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
fileTailMatch = tail.length;
|
||||
} else {
|
||||
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
||||
return false;
|
||||
}
|
||||
tailStart--;
|
||||
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
||||
return false;
|
||||
}
|
||||
fileTailMatch = tail.length + 1;
|
||||
}
|
||||
}
|
||||
if (!body.length) {
|
||||
var sawSome = !!fileTailMatch;
|
||||
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
||||
var f = String(file[i]);
|
||||
sawSome = true;
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return partial || sawSome;
|
||||
}
|
||||
var bodySegments = [[[], 0]];
|
||||
var currentBody = bodySegments[0];
|
||||
var nonGsParts = 0;
|
||||
var nonGsPartsSums = [0];
|
||||
for (var bi = 0; bi < body.length; bi++) {
|
||||
var b = body[bi];
|
||||
if (b === GLOBSTAR) {
|
||||
nonGsPartsSums.push(nonGsParts);
|
||||
currentBody = [[], 0];
|
||||
bodySegments.push(currentBody);
|
||||
} else {
|
||||
currentBody[0].push(b);
|
||||
nonGsParts++;
|
||||
}
|
||||
}
|
||||
var idx = bodySegments.length - 1;
|
||||
var fileLength = file.length - fileTailMatch;
|
||||
for (var si = 0; si < bodySegments.length; si++) {
|
||||
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
||||
}
|
||||
return !!this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex,
|
||||
0,
|
||||
partial,
|
||||
0,
|
||||
!!fileTailMatch
|
||||
);
|
||||
this.debug("matchOne", file.length, pattern.length);
|
||||
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
};
|
||||
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
||||
var bs = bodySegments[bodyIndex];
|
||||
if (!bs) {
|
||||
for (var i = fileIndex; i < file.length; i++) {
|
||||
sawTail = true;
|
||||
var f = file[i];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return sawTail;
|
||||
}
|
||||
var body = bs[0];
|
||||
var after = bs[1];
|
||||
while (fileIndex <= after) {
|
||||
var m = this._matchOne(
|
||||
file.slice(0, fileIndex + body.length),
|
||||
body,
|
||||
partial,
|
||||
fileIndex,
|
||||
0
|
||||
);
|
||||
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
||||
var sub = this._matchGlobStarBodySections(
|
||||
file,
|
||||
bodySegments,
|
||||
fileIndex + body.length,
|
||||
bodyIndex + 1,
|
||||
partial,
|
||||
globStarDepth + 1,
|
||||
sawTail
|
||||
);
|
||||
if (sub !== false) {
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
var f = file[fileIndex];
|
||||
if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
|
||||
return false;
|
||||
}
|
||||
fileIndex++;
|
||||
}
|
||||
return partial || null;
|
||||
};
|
||||
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
||||
var fi, pi, fl, pl;
|
||||
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
||||
this.debug("matchOne loop");
|
||||
var p = pattern[pi];
|
||||
var f = file[fi];
|
||||
this.debug(pattern, p, f);
|
||||
if (p === false) return false;
|
||||
if (p === GLOBSTAR) {
|
||||
this.debug("GLOBSTAR", [pattern, p, f]);
|
||||
var fr = fi;
|
||||
var pr = pi + 1;
|
||||
if (pr === pl) {
|
||||
this.debug("** at the end");
|
||||
for (; fi < fl; fi++) {
|
||||
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
while (fr < fl) {
|
||||
var swallowee = file[fr];
|
||||
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
||||
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
||||
this.debug("globstar found match!", fr, fl, swallowee);
|
||||
return true;
|
||||
} else {
|
||||
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
||||
this.debug("dot detected!", file, fr, pattern, pr);
|
||||
break;
|
||||
}
|
||||
this.debug("globstar swallow a segment, and continue");
|
||||
fr++;
|
||||
}
|
||||
}
|
||||
if (partial) {
|
||||
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
||||
if (fr === fl) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (p === false || p === GLOBSTAR) return false;
|
||||
var hit;
|
||||
if (typeof p === "string") {
|
||||
hit = f === p;
|
||||
|
||||
53
package-lock.json
generated
53
package-lock.json
generated
@@ -2786,27 +2786,14 @@
|
||||
"typescript": ">=4.8.4 <6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
|
||||
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",
|
||||
"integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
||||
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^4.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/debug": {
|
||||
@@ -2828,13 +2815,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
|
||||
"version": "9.0.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.6.tgz",
|
||||
"integrity": "sha512-kQAVowdR33euIqeA0+VZTDqU+qo1IeVY+hrKYtZMio3Pg0P0vuh/kwRylLUddJhB6pf3q/botcOvRtx4IN1wqQ==",
|
||||
"version": "9.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
|
||||
"integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^5.0.2"
|
||||
"brace-expansion": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
@@ -5127,9 +5114,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import-x/node_modules/minimatch": {
|
||||
"version": "10.2.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz",
|
||||
"integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==",
|
||||
"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": {
|
||||
@@ -6037,9 +6024,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/glob/node_modules/minimatch": {
|
||||
"version": "10.2.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz",
|
||||
"integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==",
|
||||
"version": "10.2.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
|
||||
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^5.0.2"
|
||||
@@ -7253,9 +7240,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.3.tgz",
|
||||
"integrity": "sha512-M2GCs7Vk83NxkUyQV1bkABc4yxgz9kILhHImZiBPAZ9ybuvCb0/H7lEl5XvIg3g+9d4eNotkZA5IWwYl0tibaA==",
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
|
||||
"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
@@ -7941,9 +7928,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/readdir-glob/node_modules/minimatch": {
|
||||
"version": "5.1.7",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.7.tgz",
|
||||
"integrity": "sha512-FjiwU9HaHW6YB3H4a1sFudnv93lvydNjz2lmyUXR6IwKhGI+bgL3SOZrBGn6kvvX2pJvhEkGSGjyTHN47O4rqA==",
|
||||
"version": "5.1.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz",
|
||||
"integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
|
||||
Reference in New Issue
Block a user