@storybook/cli 10.1.0-alpha.8 → 10.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node-chunks/{block-dependencies-versions-HTRZA7NK.js → block-dependencies-versions-3PIVQXIU.js} +13 -16
- package/dist/_node-chunks/{block-experimental-addon-test-RCEI7ZNN.js → block-experimental-addon-test-KE2C4JGB.js} +16 -23
- package/dist/_node-chunks/block-major-version-KRIJK2YQ.js +77 -0
- package/dist/_node-chunks/block-node-version-L6HENKCD.js +38 -0
- package/dist/_node-chunks/{block-webpack5-frameworks-T3V3TWUF.js → block-webpack5-frameworks-OMXLUWQP.js} +14 -19
- package/dist/_node-chunks/chunk-72NUUKPO.js +591 -0
- package/dist/_node-chunks/chunk-BHESI2CN.js +4375 -0
- package/dist/_node-chunks/chunk-PG6QB7FH.js +11 -0
- package/dist/_node-chunks/chunk-RYVNNZMV.js +45 -0
- package/dist/_node-chunks/chunk-XARGUZ3T.js +1160 -0
- package/dist/_node-chunks/{globby-2OFECE6D.js → globby-5YY2Y7DB.js} +8 -8
- package/dist/_node-chunks/p-limit-IDS5JGBQ.js +116 -0
- package/dist/_node-chunks/run-SE5SJ4IO.js +9627 -0
- package/dist/bin/index.js +10 -13
- package/package.json +5 -9
- package/dist/_node-chunks/block-major-version-5EWJKQ37.js +0 -100
- package/dist/_node-chunks/block-node-version-G56GAL3A.js +0 -43
- package/dist/_node-chunks/chunk-3SQ32WLK.js +0 -50
- package/dist/_node-chunks/chunk-BJB5ZHE4.js +0 -1939
- package/dist/_node-chunks/chunk-HL6AJJ6S.js +0 -6737
- package/dist/_node-chunks/chunk-IWMIPYGD.js +0 -24
- package/dist/_node-chunks/chunk-N52FW6OW.js +0 -1770
- package/dist/_node-chunks/p-limit-QY5RPRLQ.js +0 -168
- package/dist/_node-chunks/run-FI4DEZHJ.js +0 -11461
|
@@ -0,0 +1,4375 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_s47ofujcb4 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_s47ofujcb4 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_s47ofujcb4 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_s47ofujcb4.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_s47ofujcb4.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_s47ofujcb4.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__commonJS,
|
|
14
|
+
__require,
|
|
15
|
+
__toESM
|
|
16
|
+
} from "./chunk-RYVNNZMV.js";
|
|
17
|
+
|
|
18
|
+
// ../../node_modules/fast-glob/out/utils/array.js
|
|
19
|
+
var require_array = __commonJS({
|
|
20
|
+
"../../node_modules/fast-glob/out/utils/array.js"(exports) {
|
|
21
|
+
"use strict";
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
23
|
+
exports.splitWhen = exports.flatten = void 0;
|
|
24
|
+
function flatten(items) {
|
|
25
|
+
return items.reduce((collection, item) => [].concat(collection, item), []);
|
|
26
|
+
}
|
|
27
|
+
exports.flatten = flatten;
|
|
28
|
+
function splitWhen(items, predicate) {
|
|
29
|
+
let result = [[]], groupIndex = 0;
|
|
30
|
+
for (let item of items)
|
|
31
|
+
predicate(item) ? (groupIndex++, result[groupIndex] = []) : result[groupIndex].push(item);
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
exports.splitWhen = splitWhen;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// ../../node_modules/fast-glob/out/utils/errno.js
|
|
39
|
+
var require_errno = __commonJS({
|
|
40
|
+
"../../node_modules/fast-glob/out/utils/errno.js"(exports) {
|
|
41
|
+
"use strict";
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
43
|
+
exports.isEnoentCodeError = void 0;
|
|
44
|
+
function isEnoentCodeError(error) {
|
|
45
|
+
return error.code === "ENOENT";
|
|
46
|
+
}
|
|
47
|
+
exports.isEnoentCodeError = isEnoentCodeError;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// ../../node_modules/fast-glob/out/utils/fs.js
|
|
52
|
+
var require_fs = __commonJS({
|
|
53
|
+
"../../node_modules/fast-glob/out/utils/fs.js"(exports) {
|
|
54
|
+
"use strict";
|
|
55
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
56
|
+
exports.createDirentFromStats = void 0;
|
|
57
|
+
var DirentFromStats = class {
|
|
58
|
+
constructor(name, stats) {
|
|
59
|
+
this.name = name, this.isBlockDevice = stats.isBlockDevice.bind(stats), this.isCharacterDevice = stats.isCharacterDevice.bind(stats), this.isDirectory = stats.isDirectory.bind(stats), this.isFIFO = stats.isFIFO.bind(stats), this.isFile = stats.isFile.bind(stats), this.isSocket = stats.isSocket.bind(stats), this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function createDirentFromStats(name, stats) {
|
|
63
|
+
return new DirentFromStats(name, stats);
|
|
64
|
+
}
|
|
65
|
+
exports.createDirentFromStats = createDirentFromStats;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// ../../node_modules/fast-glob/out/utils/path.js
|
|
70
|
+
var require_path = __commonJS({
|
|
71
|
+
"../../node_modules/fast-glob/out/utils/path.js"(exports) {
|
|
72
|
+
"use strict";
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
74
|
+
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
|
75
|
+
var os = __require("os"), path2 = __require("path"), IS_WINDOWS_PLATFORM = os.platform() === "win32", LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2, POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g, WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g, DOS_DEVICE_PATH_RE = /^\\\\([.?])/, WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
|
|
76
|
+
function unixify(filepath) {
|
|
77
|
+
return filepath.replace(/\\/g, "/");
|
|
78
|
+
}
|
|
79
|
+
exports.unixify = unixify;
|
|
80
|
+
function makeAbsolute(cwd, filepath) {
|
|
81
|
+
return path2.resolve(cwd, filepath);
|
|
82
|
+
}
|
|
83
|
+
exports.makeAbsolute = makeAbsolute;
|
|
84
|
+
function removeLeadingDotSegment(entry) {
|
|
85
|
+
if (entry.charAt(0) === ".") {
|
|
86
|
+
let secondCharactery = entry.charAt(1);
|
|
87
|
+
if (secondCharactery === "/" || secondCharactery === "\\")
|
|
88
|
+
return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
|
|
89
|
+
}
|
|
90
|
+
return entry;
|
|
91
|
+
}
|
|
92
|
+
exports.removeLeadingDotSegment = removeLeadingDotSegment;
|
|
93
|
+
exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
|
|
94
|
+
function escapeWindowsPath(pattern) {
|
|
95
|
+
return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
|
|
96
|
+
}
|
|
97
|
+
exports.escapeWindowsPath = escapeWindowsPath;
|
|
98
|
+
function escapePosixPath(pattern) {
|
|
99
|
+
return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
|
|
100
|
+
}
|
|
101
|
+
exports.escapePosixPath = escapePosixPath;
|
|
102
|
+
exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
|
|
103
|
+
function convertWindowsPathToPattern(filepath) {
|
|
104
|
+
return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/");
|
|
105
|
+
}
|
|
106
|
+
exports.convertWindowsPathToPattern = convertWindowsPathToPattern;
|
|
107
|
+
function convertPosixPathToPattern(filepath) {
|
|
108
|
+
return escapePosixPath(filepath);
|
|
109
|
+
}
|
|
110
|
+
exports.convertPosixPathToPattern = convertPosixPathToPattern;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// ../../node_modules/is-extglob/index.js
|
|
115
|
+
var require_is_extglob = __commonJS({
|
|
116
|
+
"../../node_modules/is-extglob/index.js"(exports, module) {
|
|
117
|
+
module.exports = function(str) {
|
|
118
|
+
if (typeof str != "string" || str === "")
|
|
119
|
+
return !1;
|
|
120
|
+
for (var match; match = /(\\).|([@?!+*]\(.*\))/g.exec(str); ) {
|
|
121
|
+
if (match[2]) return !0;
|
|
122
|
+
str = str.slice(match.index + match[0].length);
|
|
123
|
+
}
|
|
124
|
+
return !1;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// ../../node_modules/is-glob/index.js
|
|
130
|
+
var require_is_glob = __commonJS({
|
|
131
|
+
"../../node_modules/is-glob/index.js"(exports, module) {
|
|
132
|
+
var isExtglob = require_is_extglob(), chars = { "{": "}", "(": ")", "[": "]" }, strictCheck = function(str) {
|
|
133
|
+
if (str[0] === "!")
|
|
134
|
+
return !0;
|
|
135
|
+
for (var index = 0, pipeIndex = -2, closeSquareIndex = -2, closeCurlyIndex = -2, closeParenIndex = -2, backSlashIndex = -2; index < str.length; ) {
|
|
136
|
+
if (str[index] === "*" || str[index + 1] === "?" && /[\].+)]/.test(str[index]) || closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]" && (closeSquareIndex < index && (closeSquareIndex = str.indexOf("]", index)), closeSquareIndex > index && (backSlashIndex === -1 || backSlashIndex > closeSquareIndex || (backSlashIndex = str.indexOf("\\", index), backSlashIndex === -1 || backSlashIndex > closeSquareIndex))) || closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}" && (closeCurlyIndex = str.indexOf("}", index), closeCurlyIndex > index && (backSlashIndex = str.indexOf("\\", index), backSlashIndex === -1 || backSlashIndex > closeCurlyIndex)) || closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")" && (closeParenIndex = str.indexOf(")", index), closeParenIndex > index && (backSlashIndex = str.indexOf("\\", index), backSlashIndex === -1 || backSlashIndex > closeParenIndex)) || pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|" && (pipeIndex < index && (pipeIndex = str.indexOf("|", index)), pipeIndex !== -1 && str[pipeIndex + 1] !== ")" && (closeParenIndex = str.indexOf(")", pipeIndex), closeParenIndex > pipeIndex && (backSlashIndex = str.indexOf("\\", pipeIndex), backSlashIndex === -1 || backSlashIndex > closeParenIndex))))
|
|
137
|
+
return !0;
|
|
138
|
+
if (str[index] === "\\") {
|
|
139
|
+
var open = str[index + 1];
|
|
140
|
+
index += 2;
|
|
141
|
+
var close = chars[open];
|
|
142
|
+
if (close) {
|
|
143
|
+
var n = str.indexOf(close, index);
|
|
144
|
+
n !== -1 && (index = n + 1);
|
|
145
|
+
}
|
|
146
|
+
if (str[index] === "!")
|
|
147
|
+
return !0;
|
|
148
|
+
} else
|
|
149
|
+
index++;
|
|
150
|
+
}
|
|
151
|
+
return !1;
|
|
152
|
+
}, relaxedCheck = function(str) {
|
|
153
|
+
if (str[0] === "!")
|
|
154
|
+
return !0;
|
|
155
|
+
for (var index = 0; index < str.length; ) {
|
|
156
|
+
if (/[*?{}()[\]]/.test(str[index]))
|
|
157
|
+
return !0;
|
|
158
|
+
if (str[index] === "\\") {
|
|
159
|
+
var open = str[index + 1];
|
|
160
|
+
index += 2;
|
|
161
|
+
var close = chars[open];
|
|
162
|
+
if (close) {
|
|
163
|
+
var n = str.indexOf(close, index);
|
|
164
|
+
n !== -1 && (index = n + 1);
|
|
165
|
+
}
|
|
166
|
+
if (str[index] === "!")
|
|
167
|
+
return !0;
|
|
168
|
+
} else
|
|
169
|
+
index++;
|
|
170
|
+
}
|
|
171
|
+
return !1;
|
|
172
|
+
};
|
|
173
|
+
module.exports = function(str, options) {
|
|
174
|
+
if (typeof str != "string" || str === "")
|
|
175
|
+
return !1;
|
|
176
|
+
if (isExtglob(str))
|
|
177
|
+
return !0;
|
|
178
|
+
var check = strictCheck;
|
|
179
|
+
return options && options.strict === !1 && (check = relaxedCheck), check(str);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// ../../node_modules/fast-glob/node_modules/glob-parent/index.js
|
|
185
|
+
var require_glob_parent = __commonJS({
|
|
186
|
+
"../../node_modules/fast-glob/node_modules/glob-parent/index.js"(exports, module) {
|
|
187
|
+
"use strict";
|
|
188
|
+
var isGlob = require_is_glob(), pathPosixDirname = __require("path").posix.dirname, isWin32 = __require("os").platform() === "win32", slash2 = "/", backslash = /\\/g, enclosure = /[\{\[].*[\}\]]$/, globby2 = /(^|[^\\])([\{\[]|\([^\)]+$)/, escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
189
|
+
module.exports = function(str, opts) {
|
|
190
|
+
var options = Object.assign({ flipBackslashes: !0 }, opts);
|
|
191
|
+
options.flipBackslashes && isWin32 && str.indexOf(slash2) < 0 && (str = str.replace(backslash, slash2)), enclosure.test(str) && (str += slash2), str += "a";
|
|
192
|
+
do
|
|
193
|
+
str = pathPosixDirname(str);
|
|
194
|
+
while (isGlob(str) || globby2.test(str));
|
|
195
|
+
return str.replace(escaped, "$1");
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// ../../node_modules/braces/lib/utils.js
|
|
201
|
+
var require_utils = __commonJS({
|
|
202
|
+
"../../node_modules/braces/lib/utils.js"(exports) {
|
|
203
|
+
"use strict";
|
|
204
|
+
exports.isInteger = (num) => typeof num == "number" ? Number.isInteger(num) : typeof num == "string" && num.trim() !== "" ? Number.isInteger(Number(num)) : !1;
|
|
205
|
+
exports.find = (node, type) => node.nodes.find((node2) => node2.type === type);
|
|
206
|
+
exports.exceedsLimit = (min, max, step = 1, limit) => limit === !1 || !exports.isInteger(min) || !exports.isInteger(max) ? !1 : (Number(max) - Number(min)) / Number(step) >= limit;
|
|
207
|
+
exports.escapeNode = (block, n = 0, type) => {
|
|
208
|
+
let node = block.nodes[n];
|
|
209
|
+
node && (type && node.type === type || node.type === "open" || node.type === "close") && node.escaped !== !0 && (node.value = "\\" + node.value, node.escaped = !0);
|
|
210
|
+
};
|
|
211
|
+
exports.encloseBrace = (node) => node.type !== "brace" ? !1 : node.commas >> 0 + node.ranges >> 0 === 0 ? (node.invalid = !0, !0) : !1;
|
|
212
|
+
exports.isInvalidBrace = (block) => block.type !== "brace" ? !1 : block.invalid === !0 || block.dollar ? !0 : block.commas >> 0 + block.ranges >> 0 === 0 || block.open !== !0 || block.close !== !0 ? (block.invalid = !0, !0) : !1;
|
|
213
|
+
exports.isOpenOrClose = (node) => node.type === "open" || node.type === "close" ? !0 : node.open === !0 || node.close === !0;
|
|
214
|
+
exports.reduce = (nodes) => nodes.reduce((acc, node) => (node.type === "text" && acc.push(node.value), node.type === "range" && (node.type = "text"), acc), []);
|
|
215
|
+
exports.flatten = (...args) => {
|
|
216
|
+
let result = [], flat = (arr) => {
|
|
217
|
+
for (let i = 0; i < arr.length; i++) {
|
|
218
|
+
let ele = arr[i];
|
|
219
|
+
if (Array.isArray(ele)) {
|
|
220
|
+
flat(ele);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
ele !== void 0 && result.push(ele);
|
|
224
|
+
}
|
|
225
|
+
return result;
|
|
226
|
+
};
|
|
227
|
+
return flat(args), result;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// ../../node_modules/braces/lib/stringify.js
|
|
233
|
+
var require_stringify = __commonJS({
|
|
234
|
+
"../../node_modules/braces/lib/stringify.js"(exports, module) {
|
|
235
|
+
"use strict";
|
|
236
|
+
var utils = require_utils();
|
|
237
|
+
module.exports = (ast, options = {}) => {
|
|
238
|
+
let stringify = (node, parent = {}) => {
|
|
239
|
+
let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent), invalidNode = node.invalid === !0 && options.escapeInvalid === !0, output = "";
|
|
240
|
+
if (node.value)
|
|
241
|
+
return (invalidBlock || invalidNode) && utils.isOpenOrClose(node) ? "\\" + node.value : node.value;
|
|
242
|
+
if (node.value)
|
|
243
|
+
return node.value;
|
|
244
|
+
if (node.nodes)
|
|
245
|
+
for (let child of node.nodes)
|
|
246
|
+
output += stringify(child);
|
|
247
|
+
return output;
|
|
248
|
+
};
|
|
249
|
+
return stringify(ast);
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
// ../../node_modules/is-number/index.js
|
|
255
|
+
var require_is_number = __commonJS({
|
|
256
|
+
"../../node_modules/is-number/index.js"(exports, module) {
|
|
257
|
+
"use strict";
|
|
258
|
+
module.exports = function(num) {
|
|
259
|
+
return typeof num == "number" ? num - num === 0 : typeof num == "string" && num.trim() !== "" ? Number.isFinite ? Number.isFinite(+num) : isFinite(+num) : !1;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// ../../node_modules/to-regex-range/index.js
|
|
265
|
+
var require_to_regex_range = __commonJS({
|
|
266
|
+
"../../node_modules/to-regex-range/index.js"(exports, module) {
|
|
267
|
+
"use strict";
|
|
268
|
+
var isNumber = require_is_number(), toRegexRange = (min, max, options) => {
|
|
269
|
+
if (isNumber(min) === !1)
|
|
270
|
+
throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
271
|
+
if (max === void 0 || min === max)
|
|
272
|
+
return String(min);
|
|
273
|
+
if (isNumber(max) === !1)
|
|
274
|
+
throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
275
|
+
let opts = { relaxZeros: !0, ...options };
|
|
276
|
+
typeof opts.strictZeros == "boolean" && (opts.relaxZeros = opts.strictZeros === !1);
|
|
277
|
+
let relax = String(opts.relaxZeros), shorthand = String(opts.shorthand), capture = String(opts.capture), wrap = String(opts.wrap), cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
|
|
278
|
+
if (toRegexRange.cache.hasOwnProperty(cacheKey))
|
|
279
|
+
return toRegexRange.cache[cacheKey].result;
|
|
280
|
+
let a = Math.min(min, max), b = Math.max(min, max);
|
|
281
|
+
if (Math.abs(a - b) === 1) {
|
|
282
|
+
let result = min + "|" + max;
|
|
283
|
+
return opts.capture ? `(${result})` : opts.wrap === !1 ? result : `(?:${result})`;
|
|
284
|
+
}
|
|
285
|
+
let isPadded = hasPadding(min) || hasPadding(max), state = { min, max, a, b }, positives = [], negatives = [];
|
|
286
|
+
if (isPadded && (state.isPadded = isPadded, state.maxLen = String(state.max).length), a < 0) {
|
|
287
|
+
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
288
|
+
negatives = splitToPatterns(newMin, Math.abs(a), state, opts), a = state.a = 0;
|
|
289
|
+
}
|
|
290
|
+
return b >= 0 && (positives = splitToPatterns(a, b, state, opts)), state.negatives = negatives, state.positives = positives, state.result = collatePatterns(negatives, positives, opts), opts.capture === !0 ? state.result = `(${state.result})` : opts.wrap !== !1 && positives.length + negatives.length > 1 && (state.result = `(?:${state.result})`), toRegexRange.cache[cacheKey] = state, state.result;
|
|
291
|
+
};
|
|
292
|
+
function collatePatterns(neg, pos, options) {
|
|
293
|
+
let onlyNegative = filterPatterns(neg, pos, "-", !1, options) || [], onlyPositive = filterPatterns(pos, neg, "", !1, options) || [], intersected = filterPatterns(neg, pos, "-?", !0, options) || [];
|
|
294
|
+
return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
|
|
295
|
+
}
|
|
296
|
+
function splitToRanges(min, max) {
|
|
297
|
+
let nines = 1, zeros = 1, stop = countNines(min, nines), stops = /* @__PURE__ */ new Set([max]);
|
|
298
|
+
for (; min <= stop && stop <= max; )
|
|
299
|
+
stops.add(stop), nines += 1, stop = countNines(min, nines);
|
|
300
|
+
for (stop = countZeros(max + 1, zeros) - 1; min < stop && stop <= max; )
|
|
301
|
+
stops.add(stop), zeros += 1, stop = countZeros(max + 1, zeros) - 1;
|
|
302
|
+
return stops = [...stops], stops.sort(compare), stops;
|
|
303
|
+
}
|
|
304
|
+
function rangeToPattern(start, stop, options) {
|
|
305
|
+
if (start === stop)
|
|
306
|
+
return { pattern: start, count: [], digits: 0 };
|
|
307
|
+
let zipped = zip(start, stop), digits = zipped.length, pattern = "", count = 0;
|
|
308
|
+
for (let i = 0; i < digits; i++) {
|
|
309
|
+
let [startDigit, stopDigit] = zipped[i];
|
|
310
|
+
startDigit === stopDigit ? pattern += startDigit : startDigit !== "0" || stopDigit !== "9" ? pattern += toCharacterClass(startDigit, stopDigit, options) : count++;
|
|
311
|
+
}
|
|
312
|
+
return count && (pattern += options.shorthand === !0 ? "\\d" : "[0-9]"), { pattern, count: [count], digits };
|
|
313
|
+
}
|
|
314
|
+
function splitToPatterns(min, max, tok, options) {
|
|
315
|
+
let ranges = splitToRanges(min, max), tokens = [], start = min, prev;
|
|
316
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
317
|
+
let max2 = ranges[i], obj = rangeToPattern(String(start), String(max2), options), zeros = "";
|
|
318
|
+
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
319
|
+
prev.count.length > 1 && prev.count.pop(), prev.count.push(obj.count[0]), prev.string = prev.pattern + toQuantifier(prev.count), start = max2 + 1;
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
tok.isPadded && (zeros = padZeros(max2, tok, options)), obj.string = zeros + obj.pattern + toQuantifier(obj.count), tokens.push(obj), start = max2 + 1, prev = obj;
|
|
323
|
+
}
|
|
324
|
+
return tokens;
|
|
325
|
+
}
|
|
326
|
+
function filterPatterns(arr, comparison, prefix, intersection, options) {
|
|
327
|
+
let result = [];
|
|
328
|
+
for (let ele of arr) {
|
|
329
|
+
let { string } = ele;
|
|
330
|
+
!intersection && !contains(comparison, "string", string) && result.push(prefix + string), intersection && contains(comparison, "string", string) && result.push(prefix + string);
|
|
331
|
+
}
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
334
|
+
function zip(a, b) {
|
|
335
|
+
let arr = [];
|
|
336
|
+
for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
|
|
337
|
+
return arr;
|
|
338
|
+
}
|
|
339
|
+
function compare(a, b) {
|
|
340
|
+
return a > b ? 1 : b > a ? -1 : 0;
|
|
341
|
+
}
|
|
342
|
+
function contains(arr, key, val) {
|
|
343
|
+
return arr.some((ele) => ele[key] === val);
|
|
344
|
+
}
|
|
345
|
+
function countNines(min, len) {
|
|
346
|
+
return Number(String(min).slice(0, -len) + "9".repeat(len));
|
|
347
|
+
}
|
|
348
|
+
function countZeros(integer, zeros) {
|
|
349
|
+
return integer - integer % Math.pow(10, zeros);
|
|
350
|
+
}
|
|
351
|
+
function toQuantifier(digits) {
|
|
352
|
+
let [start = 0, stop = ""] = digits;
|
|
353
|
+
return stop || start > 1 ? `{${start + (stop ? "," + stop : "")}}` : "";
|
|
354
|
+
}
|
|
355
|
+
function toCharacterClass(a, b, options) {
|
|
356
|
+
return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
|
|
357
|
+
}
|
|
358
|
+
function hasPadding(str) {
|
|
359
|
+
return /^-?(0+)\d/.test(str);
|
|
360
|
+
}
|
|
361
|
+
function padZeros(value, tok, options) {
|
|
362
|
+
if (!tok.isPadded)
|
|
363
|
+
return value;
|
|
364
|
+
let diff = Math.abs(tok.maxLen - String(value).length), relax = options.relaxZeros !== !1;
|
|
365
|
+
switch (diff) {
|
|
366
|
+
case 0:
|
|
367
|
+
return "";
|
|
368
|
+
case 1:
|
|
369
|
+
return relax ? "0?" : "0";
|
|
370
|
+
case 2:
|
|
371
|
+
return relax ? "0{0,2}" : "00";
|
|
372
|
+
default:
|
|
373
|
+
return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
toRegexRange.cache = {};
|
|
377
|
+
toRegexRange.clearCache = () => toRegexRange.cache = {};
|
|
378
|
+
module.exports = toRegexRange;
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
// ../../node_modules/fill-range/index.js
|
|
383
|
+
var require_fill_range = __commonJS({
|
|
384
|
+
"../../node_modules/fill-range/index.js"(exports, module) {
|
|
385
|
+
"use strict";
|
|
386
|
+
var util = __require("util"), toRegexRange = require_to_regex_range(), isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val), transform = (toNumber) => (value) => toNumber === !0 ? Number(value) : String(value), isValidValue = (value) => typeof value == "number" || typeof value == "string" && value !== "", isNumber = (num) => Number.isInteger(+num), zeros = (input) => {
|
|
387
|
+
let value = `${input}`, index = -1;
|
|
388
|
+
if (value[0] === "-" && (value = value.slice(1)), value === "0") return !1;
|
|
389
|
+
for (; value[++index] === "0"; ) ;
|
|
390
|
+
return index > 0;
|
|
391
|
+
}, stringify = (start, end, options) => typeof start == "string" || typeof end == "string" ? !0 : options.stringify === !0, pad = (input, maxLength, toNumber) => {
|
|
392
|
+
if (maxLength > 0) {
|
|
393
|
+
let dash = input[0] === "-" ? "-" : "";
|
|
394
|
+
dash && (input = input.slice(1)), input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
|
|
395
|
+
}
|
|
396
|
+
return toNumber === !1 ? String(input) : input;
|
|
397
|
+
}, toMaxLen = (input, maxLength) => {
|
|
398
|
+
let negative = input[0] === "-" ? "-" : "";
|
|
399
|
+
for (negative && (input = input.slice(1), maxLength--); input.length < maxLength; ) input = "0" + input;
|
|
400
|
+
return negative ? "-" + input : input;
|
|
401
|
+
}, toSequence = (parts, options, maxLen) => {
|
|
402
|
+
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0), parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
403
|
+
let prefix = options.capture ? "" : "?:", positives = "", negatives = "", result;
|
|
404
|
+
return parts.positives.length && (positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|")), parts.negatives.length && (negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`), positives && negatives ? result = `${positives}|${negatives}` : result = positives || negatives, options.wrap ? `(${prefix}${result})` : result;
|
|
405
|
+
}, toRange = (a, b, isNumbers, options) => {
|
|
406
|
+
if (isNumbers)
|
|
407
|
+
return toRegexRange(a, b, { wrap: !1, ...options });
|
|
408
|
+
let start = String.fromCharCode(a);
|
|
409
|
+
if (a === b) return start;
|
|
410
|
+
let stop = String.fromCharCode(b);
|
|
411
|
+
return `[${start}-${stop}]`;
|
|
412
|
+
}, toRegex = (start, end, options) => {
|
|
413
|
+
if (Array.isArray(start)) {
|
|
414
|
+
let wrap = options.wrap === !0, prefix = options.capture ? "" : "?:";
|
|
415
|
+
return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
|
|
416
|
+
}
|
|
417
|
+
return toRegexRange(start, end, options);
|
|
418
|
+
}, rangeError = (...args) => new RangeError("Invalid range arguments: " + util.inspect(...args)), invalidRange = (start, end, options) => {
|
|
419
|
+
if (options.strictRanges === !0) throw rangeError([start, end]);
|
|
420
|
+
return [];
|
|
421
|
+
}, invalidStep = (step, options) => {
|
|
422
|
+
if (options.strictRanges === !0)
|
|
423
|
+
throw new TypeError(`Expected step "${step}" to be a number`);
|
|
424
|
+
return [];
|
|
425
|
+
}, fillNumbers = (start, end, step = 1, options = {}) => {
|
|
426
|
+
let a = Number(start), b = Number(end);
|
|
427
|
+
if (!Number.isInteger(a) || !Number.isInteger(b)) {
|
|
428
|
+
if (options.strictRanges === !0) throw rangeError([start, end]);
|
|
429
|
+
return [];
|
|
430
|
+
}
|
|
431
|
+
a === 0 && (a = 0), b === 0 && (b = 0);
|
|
432
|
+
let descending = a > b, startString = String(start), endString = String(end), stepString = String(step);
|
|
433
|
+
step = Math.max(Math.abs(step), 1);
|
|
434
|
+
let padded = zeros(startString) || zeros(endString) || zeros(stepString), maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0, toNumber = padded === !1 && stringify(start, end, options) === !1, format = options.transform || transform(toNumber);
|
|
435
|
+
if (options.toRegex && step === 1)
|
|
436
|
+
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), !0, options);
|
|
437
|
+
let parts = { negatives: [], positives: [] }, push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)), range = [], index = 0;
|
|
438
|
+
for (; descending ? a >= b : a <= b; )
|
|
439
|
+
options.toRegex === !0 && step > 1 ? push(a) : range.push(pad(format(a, index), maxLen, toNumber)), a = descending ? a - step : a + step, index++;
|
|
440
|
+
return options.toRegex === !0 ? step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: !1, ...options }) : range;
|
|
441
|
+
}, fillLetters = (start, end, step = 1, options = {}) => {
|
|
442
|
+
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1)
|
|
443
|
+
return invalidRange(start, end, options);
|
|
444
|
+
let format = options.transform || ((val) => String.fromCharCode(val)), a = `${start}`.charCodeAt(0), b = `${end}`.charCodeAt(0), descending = a > b, min = Math.min(a, b), max = Math.max(a, b);
|
|
445
|
+
if (options.toRegex && step === 1)
|
|
446
|
+
return toRange(min, max, !1, options);
|
|
447
|
+
let range = [], index = 0;
|
|
448
|
+
for (; descending ? a >= b : a <= b; )
|
|
449
|
+
range.push(format(a, index)), a = descending ? a - step : a + step, index++;
|
|
450
|
+
return options.toRegex === !0 ? toRegex(range, null, { wrap: !1, options }) : range;
|
|
451
|
+
}, fill = (start, end, step, options = {}) => {
|
|
452
|
+
if (end == null && isValidValue(start))
|
|
453
|
+
return [start];
|
|
454
|
+
if (!isValidValue(start) || !isValidValue(end))
|
|
455
|
+
return invalidRange(start, end, options);
|
|
456
|
+
if (typeof step == "function")
|
|
457
|
+
return fill(start, end, 1, { transform: step });
|
|
458
|
+
if (isObject(step))
|
|
459
|
+
return fill(start, end, 0, step);
|
|
460
|
+
let opts = { ...options };
|
|
461
|
+
return opts.capture === !0 && (opts.wrap = !0), step = step || opts.step || 1, isNumber(step) ? isNumber(start) && isNumber(end) ? fillNumbers(start, end, step, opts) : fillLetters(start, end, Math.max(Math.abs(step), 1), opts) : step != null && !isObject(step) ? invalidStep(step, opts) : fill(start, end, 1, step);
|
|
462
|
+
};
|
|
463
|
+
module.exports = fill;
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
// ../../node_modules/braces/lib/compile.js
|
|
468
|
+
var require_compile = __commonJS({
|
|
469
|
+
"../../node_modules/braces/lib/compile.js"(exports, module) {
|
|
470
|
+
"use strict";
|
|
471
|
+
var fill = require_fill_range(), utils = require_utils(), compile = (ast, options = {}) => {
|
|
472
|
+
let walk = (node, parent = {}) => {
|
|
473
|
+
let invalidBlock = utils.isInvalidBrace(parent), invalidNode = node.invalid === !0 && options.escapeInvalid === !0, invalid = invalidBlock === !0 || invalidNode === !0, prefix = options.escapeInvalid === !0 ? "\\" : "", output = "";
|
|
474
|
+
if (node.isOpen === !0)
|
|
475
|
+
return prefix + node.value;
|
|
476
|
+
if (node.isClose === !0)
|
|
477
|
+
return console.log("node.isClose", prefix, node.value), prefix + node.value;
|
|
478
|
+
if (node.type === "open")
|
|
479
|
+
return invalid ? prefix + node.value : "(";
|
|
480
|
+
if (node.type === "close")
|
|
481
|
+
return invalid ? prefix + node.value : ")";
|
|
482
|
+
if (node.type === "comma")
|
|
483
|
+
return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
|
|
484
|
+
if (node.value)
|
|
485
|
+
return node.value;
|
|
486
|
+
if (node.nodes && node.ranges > 0) {
|
|
487
|
+
let args = utils.reduce(node.nodes), range = fill(...args, { ...options, wrap: !1, toRegex: !0, strictZeros: !0 });
|
|
488
|
+
if (range.length !== 0)
|
|
489
|
+
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
490
|
+
}
|
|
491
|
+
if (node.nodes)
|
|
492
|
+
for (let child of node.nodes)
|
|
493
|
+
output += walk(child, node);
|
|
494
|
+
return output;
|
|
495
|
+
};
|
|
496
|
+
return walk(ast);
|
|
497
|
+
};
|
|
498
|
+
module.exports = compile;
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
// ../../node_modules/braces/lib/expand.js
|
|
503
|
+
var require_expand = __commonJS({
|
|
504
|
+
"../../node_modules/braces/lib/expand.js"(exports, module) {
|
|
505
|
+
"use strict";
|
|
506
|
+
var fill = require_fill_range(), stringify = require_stringify(), utils = require_utils(), append = (queue = "", stash = "", enclose = !1) => {
|
|
507
|
+
let result = [];
|
|
508
|
+
if (queue = [].concat(queue), stash = [].concat(stash), !stash.length) return queue;
|
|
509
|
+
if (!queue.length)
|
|
510
|
+
return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
|
511
|
+
for (let item of queue)
|
|
512
|
+
if (Array.isArray(item))
|
|
513
|
+
for (let value of item)
|
|
514
|
+
result.push(append(value, stash, enclose));
|
|
515
|
+
else
|
|
516
|
+
for (let ele of stash)
|
|
517
|
+
enclose === !0 && typeof ele == "string" && (ele = `{${ele}}`), result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
518
|
+
return utils.flatten(result);
|
|
519
|
+
}, expand = (ast, options = {}) => {
|
|
520
|
+
let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit, walk = (node, parent = {}) => {
|
|
521
|
+
node.queue = [];
|
|
522
|
+
let p = parent, q = parent.queue;
|
|
523
|
+
for (; p.type !== "brace" && p.type !== "root" && p.parent; )
|
|
524
|
+
p = p.parent, q = p.queue;
|
|
525
|
+
if (node.invalid || node.dollar) {
|
|
526
|
+
q.push(append(q.pop(), stringify(node, options)));
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
if (node.type === "brace" && node.invalid !== !0 && node.nodes.length === 2) {
|
|
530
|
+
q.push(append(q.pop(), ["{}"]));
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (node.nodes && node.ranges > 0) {
|
|
534
|
+
let args = utils.reduce(node.nodes);
|
|
535
|
+
if (utils.exceedsLimit(...args, options.step, rangeLimit))
|
|
536
|
+
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
537
|
+
let range = fill(...args, options);
|
|
538
|
+
range.length === 0 && (range = stringify(node, options)), q.push(append(q.pop(), range)), node.nodes = [];
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
let enclose = utils.encloseBrace(node), queue = node.queue, block = node;
|
|
542
|
+
for (; block.type !== "brace" && block.type !== "root" && block.parent; )
|
|
543
|
+
block = block.parent, queue = block.queue;
|
|
544
|
+
for (let i = 0; i < node.nodes.length; i++) {
|
|
545
|
+
let child = node.nodes[i];
|
|
546
|
+
if (child.type === "comma" && node.type === "brace") {
|
|
547
|
+
i === 1 && queue.push(""), queue.push("");
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
if (child.type === "close") {
|
|
551
|
+
q.push(append(q.pop(), queue, enclose));
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
if (child.value && child.type !== "open") {
|
|
555
|
+
queue.push(append(queue.pop(), child.value));
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
child.nodes && walk(child, node);
|
|
559
|
+
}
|
|
560
|
+
return queue;
|
|
561
|
+
};
|
|
562
|
+
return utils.flatten(walk(ast));
|
|
563
|
+
};
|
|
564
|
+
module.exports = expand;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
// ../../node_modules/braces/lib/constants.js
|
|
569
|
+
var require_constants = __commonJS({
|
|
570
|
+
"../../node_modules/braces/lib/constants.js"(exports, module) {
|
|
571
|
+
"use strict";
|
|
572
|
+
module.exports = {
|
|
573
|
+
MAX_LENGTH: 1e4,
|
|
574
|
+
// Digits
|
|
575
|
+
CHAR_0: "0",
|
|
576
|
+
/* 0 */
|
|
577
|
+
CHAR_9: "9",
|
|
578
|
+
/* 9 */
|
|
579
|
+
// Alphabet chars.
|
|
580
|
+
CHAR_UPPERCASE_A: "A",
|
|
581
|
+
/* A */
|
|
582
|
+
CHAR_LOWERCASE_A: "a",
|
|
583
|
+
/* a */
|
|
584
|
+
CHAR_UPPERCASE_Z: "Z",
|
|
585
|
+
/* Z */
|
|
586
|
+
CHAR_LOWERCASE_Z: "z",
|
|
587
|
+
/* z */
|
|
588
|
+
CHAR_LEFT_PARENTHESES: "(",
|
|
589
|
+
/* ( */
|
|
590
|
+
CHAR_RIGHT_PARENTHESES: ")",
|
|
591
|
+
/* ) */
|
|
592
|
+
CHAR_ASTERISK: "*",
|
|
593
|
+
/* * */
|
|
594
|
+
// Non-alphabetic chars.
|
|
595
|
+
CHAR_AMPERSAND: "&",
|
|
596
|
+
/* & */
|
|
597
|
+
CHAR_AT: "@",
|
|
598
|
+
/* @ */
|
|
599
|
+
CHAR_BACKSLASH: "\\",
|
|
600
|
+
/* \ */
|
|
601
|
+
CHAR_BACKTICK: "`",
|
|
602
|
+
/* ` */
|
|
603
|
+
CHAR_CARRIAGE_RETURN: "\r",
|
|
604
|
+
/* \r */
|
|
605
|
+
CHAR_CIRCUMFLEX_ACCENT: "^",
|
|
606
|
+
/* ^ */
|
|
607
|
+
CHAR_COLON: ":",
|
|
608
|
+
/* : */
|
|
609
|
+
CHAR_COMMA: ",",
|
|
610
|
+
/* , */
|
|
611
|
+
CHAR_DOLLAR: "$",
|
|
612
|
+
/* . */
|
|
613
|
+
CHAR_DOT: ".",
|
|
614
|
+
/* . */
|
|
615
|
+
CHAR_DOUBLE_QUOTE: '"',
|
|
616
|
+
/* " */
|
|
617
|
+
CHAR_EQUAL: "=",
|
|
618
|
+
/* = */
|
|
619
|
+
CHAR_EXCLAMATION_MARK: "!",
|
|
620
|
+
/* ! */
|
|
621
|
+
CHAR_FORM_FEED: "\f",
|
|
622
|
+
/* \f */
|
|
623
|
+
CHAR_FORWARD_SLASH: "/",
|
|
624
|
+
/* / */
|
|
625
|
+
CHAR_HASH: "#",
|
|
626
|
+
/* # */
|
|
627
|
+
CHAR_HYPHEN_MINUS: "-",
|
|
628
|
+
/* - */
|
|
629
|
+
CHAR_LEFT_ANGLE_BRACKET: "<",
|
|
630
|
+
/* < */
|
|
631
|
+
CHAR_LEFT_CURLY_BRACE: "{",
|
|
632
|
+
/* { */
|
|
633
|
+
CHAR_LEFT_SQUARE_BRACKET: "[",
|
|
634
|
+
/* [ */
|
|
635
|
+
CHAR_LINE_FEED: `
|
|
636
|
+
`,
|
|
637
|
+
/* \n */
|
|
638
|
+
CHAR_NO_BREAK_SPACE: "\xA0",
|
|
639
|
+
/* \u00A0 */
|
|
640
|
+
CHAR_PERCENT: "%",
|
|
641
|
+
/* % */
|
|
642
|
+
CHAR_PLUS: "+",
|
|
643
|
+
/* + */
|
|
644
|
+
CHAR_QUESTION_MARK: "?",
|
|
645
|
+
/* ? */
|
|
646
|
+
CHAR_RIGHT_ANGLE_BRACKET: ">",
|
|
647
|
+
/* > */
|
|
648
|
+
CHAR_RIGHT_CURLY_BRACE: "}",
|
|
649
|
+
/* } */
|
|
650
|
+
CHAR_RIGHT_SQUARE_BRACKET: "]",
|
|
651
|
+
/* ] */
|
|
652
|
+
CHAR_SEMICOLON: ";",
|
|
653
|
+
/* ; */
|
|
654
|
+
CHAR_SINGLE_QUOTE: "'",
|
|
655
|
+
/* ' */
|
|
656
|
+
CHAR_SPACE: " ",
|
|
657
|
+
/* */
|
|
658
|
+
CHAR_TAB: " ",
|
|
659
|
+
/* \t */
|
|
660
|
+
CHAR_UNDERSCORE: "_",
|
|
661
|
+
/* _ */
|
|
662
|
+
CHAR_VERTICAL_LINE: "|",
|
|
663
|
+
/* | */
|
|
664
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
|
|
665
|
+
/* \uFEFF */
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
// ../../node_modules/braces/lib/parse.js
|
|
671
|
+
var require_parse = __commonJS({
|
|
672
|
+
"../../node_modules/braces/lib/parse.js"(exports, module) {
|
|
673
|
+
"use strict";
|
|
674
|
+
var stringify = require_stringify(), {
|
|
675
|
+
MAX_LENGTH,
|
|
676
|
+
CHAR_BACKSLASH,
|
|
677
|
+
/* \ */
|
|
678
|
+
CHAR_BACKTICK,
|
|
679
|
+
/* ` */
|
|
680
|
+
CHAR_COMMA,
|
|
681
|
+
/* , */
|
|
682
|
+
CHAR_DOT,
|
|
683
|
+
/* . */
|
|
684
|
+
CHAR_LEFT_PARENTHESES,
|
|
685
|
+
/* ( */
|
|
686
|
+
CHAR_RIGHT_PARENTHESES,
|
|
687
|
+
/* ) */
|
|
688
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
689
|
+
/* { */
|
|
690
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
691
|
+
/* } */
|
|
692
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
693
|
+
/* [ */
|
|
694
|
+
CHAR_RIGHT_SQUARE_BRACKET,
|
|
695
|
+
/* ] */
|
|
696
|
+
CHAR_DOUBLE_QUOTE,
|
|
697
|
+
/* " */
|
|
698
|
+
CHAR_SINGLE_QUOTE,
|
|
699
|
+
/* ' */
|
|
700
|
+
CHAR_NO_BREAK_SPACE,
|
|
701
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
702
|
+
} = require_constants(), parse = (input, options = {}) => {
|
|
703
|
+
if (typeof input != "string")
|
|
704
|
+
throw new TypeError("Expected a string");
|
|
705
|
+
let opts = options || {}, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
706
|
+
if (input.length > max)
|
|
707
|
+
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
708
|
+
let ast = { type: "root", input, nodes: [] }, stack = [ast], block = ast, prev = ast, brackets = 0, length = input.length, index = 0, depth = 0, value, advance = () => input[index++], push = (node) => {
|
|
709
|
+
if (node.type === "text" && prev.type === "dot" && (prev.type = "text"), prev && prev.type === "text" && node.type === "text") {
|
|
710
|
+
prev.value += node.value;
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
return block.nodes.push(node), node.parent = block, node.prev = prev, prev = node, node;
|
|
714
|
+
};
|
|
715
|
+
for (push({ type: "bos" }); index < length; )
|
|
716
|
+
if (block = stack[stack.length - 1], value = advance(), !(value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE)) {
|
|
717
|
+
if (value === CHAR_BACKSLASH) {
|
|
718
|
+
push({ type: "text", value: (options.keepEscaping ? value : "") + advance() });
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
722
|
+
push({ type: "text", value: "\\" + value });
|
|
723
|
+
continue;
|
|
724
|
+
}
|
|
725
|
+
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
726
|
+
brackets++;
|
|
727
|
+
let next;
|
|
728
|
+
for (; index < length && (next = advance()); ) {
|
|
729
|
+
if (value += next, next === CHAR_LEFT_SQUARE_BRACKET) {
|
|
730
|
+
brackets++;
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
if (next === CHAR_BACKSLASH) {
|
|
734
|
+
value += advance();
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET && (brackets--, brackets === 0))
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
push({ type: "text", value });
|
|
741
|
+
continue;
|
|
742
|
+
}
|
|
743
|
+
if (value === CHAR_LEFT_PARENTHESES) {
|
|
744
|
+
block = push({ type: "paren", nodes: [] }), stack.push(block), push({ type: "text", value });
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
748
|
+
if (block.type !== "paren") {
|
|
749
|
+
push({ type: "text", value });
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
block = stack.pop(), push({ type: "text", value }), block = stack[stack.length - 1];
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
755
|
+
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
756
|
+
let open = value, next;
|
|
757
|
+
for (options.keepQuotes !== !0 && (value = ""); index < length && (next = advance()); ) {
|
|
758
|
+
if (next === CHAR_BACKSLASH) {
|
|
759
|
+
value += next + advance();
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
if (next === open) {
|
|
763
|
+
options.keepQuotes === !0 && (value += next);
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
value += next;
|
|
767
|
+
}
|
|
768
|
+
push({ type: "text", value });
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
772
|
+
depth++;
|
|
773
|
+
let brace = {
|
|
774
|
+
type: "brace",
|
|
775
|
+
open: !0,
|
|
776
|
+
close: !1,
|
|
777
|
+
dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === !0,
|
|
778
|
+
depth,
|
|
779
|
+
commas: 0,
|
|
780
|
+
ranges: 0,
|
|
781
|
+
nodes: []
|
|
782
|
+
};
|
|
783
|
+
block = push(brace), stack.push(block), push({ type: "open", value });
|
|
784
|
+
continue;
|
|
785
|
+
}
|
|
786
|
+
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
787
|
+
if (block.type !== "brace") {
|
|
788
|
+
push({ type: "text", value });
|
|
789
|
+
continue;
|
|
790
|
+
}
|
|
791
|
+
let type = "close";
|
|
792
|
+
block = stack.pop(), block.close = !0, push({ type, value }), depth--, block = stack[stack.length - 1];
|
|
793
|
+
continue;
|
|
794
|
+
}
|
|
795
|
+
if (value === CHAR_COMMA && depth > 0) {
|
|
796
|
+
if (block.ranges > 0) {
|
|
797
|
+
block.ranges = 0;
|
|
798
|
+
let open = block.nodes.shift();
|
|
799
|
+
block.nodes = [open, { type: "text", value: stringify(block) }];
|
|
800
|
+
}
|
|
801
|
+
push({ type: "comma", value }), block.commas++;
|
|
802
|
+
continue;
|
|
803
|
+
}
|
|
804
|
+
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
805
|
+
let siblings = block.nodes;
|
|
806
|
+
if (depth === 0 || siblings.length === 0) {
|
|
807
|
+
push({ type: "text", value });
|
|
808
|
+
continue;
|
|
809
|
+
}
|
|
810
|
+
if (prev.type === "dot") {
|
|
811
|
+
if (block.range = [], prev.value += value, prev.type = "range", block.nodes.length !== 3 && block.nodes.length !== 5) {
|
|
812
|
+
block.invalid = !0, block.ranges = 0, prev.type = "text";
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
815
|
+
block.ranges++, block.args = [];
|
|
816
|
+
continue;
|
|
817
|
+
}
|
|
818
|
+
if (prev.type === "range") {
|
|
819
|
+
siblings.pop();
|
|
820
|
+
let before = siblings[siblings.length - 1];
|
|
821
|
+
before.value += prev.value + value, prev = before, block.ranges--;
|
|
822
|
+
continue;
|
|
823
|
+
}
|
|
824
|
+
push({ type: "dot", value });
|
|
825
|
+
continue;
|
|
826
|
+
}
|
|
827
|
+
push({ type: "text", value });
|
|
828
|
+
}
|
|
829
|
+
do
|
|
830
|
+
if (block = stack.pop(), block.type !== "root") {
|
|
831
|
+
block.nodes.forEach((node) => {
|
|
832
|
+
node.nodes || (node.type === "open" && (node.isOpen = !0), node.type === "close" && (node.isClose = !0), node.nodes || (node.type = "text"), node.invalid = !0);
|
|
833
|
+
});
|
|
834
|
+
let parent = stack[stack.length - 1], index2 = parent.nodes.indexOf(block);
|
|
835
|
+
parent.nodes.splice(index2, 1, ...block.nodes);
|
|
836
|
+
}
|
|
837
|
+
while (stack.length > 0);
|
|
838
|
+
return push({ type: "eos" }), ast;
|
|
839
|
+
};
|
|
840
|
+
module.exports = parse;
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
// ../../node_modules/braces/index.js
|
|
845
|
+
var require_braces = __commonJS({
|
|
846
|
+
"../../node_modules/braces/index.js"(exports, module) {
|
|
847
|
+
"use strict";
|
|
848
|
+
var stringify = require_stringify(), compile = require_compile(), expand = require_expand(), parse = require_parse(), braces = (input, options = {}) => {
|
|
849
|
+
let output = [];
|
|
850
|
+
if (Array.isArray(input))
|
|
851
|
+
for (let pattern of input) {
|
|
852
|
+
let result = braces.create(pattern, options);
|
|
853
|
+
Array.isArray(result) ? output.push(...result) : output.push(result);
|
|
854
|
+
}
|
|
855
|
+
else
|
|
856
|
+
output = [].concat(braces.create(input, options));
|
|
857
|
+
return options && options.expand === !0 && options.nodupes === !0 && (output = [...new Set(output)]), output;
|
|
858
|
+
};
|
|
859
|
+
braces.parse = (input, options = {}) => parse(input, options);
|
|
860
|
+
braces.stringify = (input, options = {}) => stringify(typeof input == "string" ? braces.parse(input, options) : input, options);
|
|
861
|
+
braces.compile = (input, options = {}) => (typeof input == "string" && (input = braces.parse(input, options)), compile(input, options));
|
|
862
|
+
braces.expand = (input, options = {}) => {
|
|
863
|
+
typeof input == "string" && (input = braces.parse(input, options));
|
|
864
|
+
let result = expand(input, options);
|
|
865
|
+
return options.noempty === !0 && (result = result.filter(Boolean)), options.nodupes === !0 && (result = [...new Set(result)]), result;
|
|
866
|
+
};
|
|
867
|
+
braces.create = (input, options = {}) => input === "" || input.length < 3 ? [input] : options.expand !== !0 ? braces.compile(input, options) : braces.expand(input, options);
|
|
868
|
+
module.exports = braces;
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// ../../node_modules/picomatch/lib/constants.js
|
|
873
|
+
var require_constants2 = __commonJS({
|
|
874
|
+
"../../node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
875
|
+
"use strict";
|
|
876
|
+
var path2 = __require("path"), WIN_SLASH = "\\\\/", WIN_NO_SLASH = `[^${WIN_SLASH}]`, DOT_LITERAL = "\\.", PLUS_LITERAL = "\\+", QMARK_LITERAL = "\\?", SLASH_LITERAL = "\\/", ONE_CHAR = "(?=.)", QMARK = "[^/]", END_ANCHOR = `(?:${SLASH_LITERAL}|$)`, START_ANCHOR = `(?:^|${SLASH_LITERAL})`, DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`, NO_DOT = `(?!${DOT_LITERAL})`, NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`, STAR = `${QMARK}*?`, POSIX_CHARS = {
|
|
877
|
+
DOT_LITERAL,
|
|
878
|
+
PLUS_LITERAL,
|
|
879
|
+
QMARK_LITERAL,
|
|
880
|
+
SLASH_LITERAL,
|
|
881
|
+
ONE_CHAR,
|
|
882
|
+
QMARK,
|
|
883
|
+
END_ANCHOR,
|
|
884
|
+
DOTS_SLASH,
|
|
885
|
+
NO_DOT,
|
|
886
|
+
NO_DOTS,
|
|
887
|
+
NO_DOT_SLASH,
|
|
888
|
+
NO_DOTS_SLASH,
|
|
889
|
+
QMARK_NO_DOT,
|
|
890
|
+
STAR,
|
|
891
|
+
START_ANCHOR
|
|
892
|
+
}, WINDOWS_CHARS = {
|
|
893
|
+
...POSIX_CHARS,
|
|
894
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
895
|
+
QMARK: WIN_NO_SLASH,
|
|
896
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
897
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
898
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
899
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
900
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
901
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
902
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
903
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
904
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
905
|
+
}, POSIX_REGEX_SOURCE = {
|
|
906
|
+
alnum: "a-zA-Z0-9",
|
|
907
|
+
alpha: "a-zA-Z",
|
|
908
|
+
ascii: "\\x00-\\x7F",
|
|
909
|
+
blank: " \\t",
|
|
910
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
911
|
+
digit: "0-9",
|
|
912
|
+
graph: "\\x21-\\x7E",
|
|
913
|
+
lower: "a-z",
|
|
914
|
+
print: "\\x20-\\x7E ",
|
|
915
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
916
|
+
space: " \\t\\r\\n\\v\\f",
|
|
917
|
+
upper: "A-Z",
|
|
918
|
+
word: "A-Za-z0-9_",
|
|
919
|
+
xdigit: "A-Fa-f0-9"
|
|
920
|
+
};
|
|
921
|
+
module.exports = {
|
|
922
|
+
MAX_LENGTH: 1024 * 64,
|
|
923
|
+
POSIX_REGEX_SOURCE,
|
|
924
|
+
// regular expressions
|
|
925
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
926
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
927
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
928
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
929
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
930
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
931
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
932
|
+
REPLACEMENTS: {
|
|
933
|
+
"***": "*",
|
|
934
|
+
"**/**": "**",
|
|
935
|
+
"**/**/**": "**"
|
|
936
|
+
},
|
|
937
|
+
// Digits
|
|
938
|
+
CHAR_0: 48,
|
|
939
|
+
/* 0 */
|
|
940
|
+
CHAR_9: 57,
|
|
941
|
+
/* 9 */
|
|
942
|
+
// Alphabet chars.
|
|
943
|
+
CHAR_UPPERCASE_A: 65,
|
|
944
|
+
/* A */
|
|
945
|
+
CHAR_LOWERCASE_A: 97,
|
|
946
|
+
/* a */
|
|
947
|
+
CHAR_UPPERCASE_Z: 90,
|
|
948
|
+
/* Z */
|
|
949
|
+
CHAR_LOWERCASE_Z: 122,
|
|
950
|
+
/* z */
|
|
951
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
952
|
+
/* ( */
|
|
953
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
954
|
+
/* ) */
|
|
955
|
+
CHAR_ASTERISK: 42,
|
|
956
|
+
/* * */
|
|
957
|
+
// Non-alphabetic chars.
|
|
958
|
+
CHAR_AMPERSAND: 38,
|
|
959
|
+
/* & */
|
|
960
|
+
CHAR_AT: 64,
|
|
961
|
+
/* @ */
|
|
962
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
963
|
+
/* \ */
|
|
964
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
965
|
+
/* \r */
|
|
966
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
967
|
+
/* ^ */
|
|
968
|
+
CHAR_COLON: 58,
|
|
969
|
+
/* : */
|
|
970
|
+
CHAR_COMMA: 44,
|
|
971
|
+
/* , */
|
|
972
|
+
CHAR_DOT: 46,
|
|
973
|
+
/* . */
|
|
974
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
975
|
+
/* " */
|
|
976
|
+
CHAR_EQUAL: 61,
|
|
977
|
+
/* = */
|
|
978
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
979
|
+
/* ! */
|
|
980
|
+
CHAR_FORM_FEED: 12,
|
|
981
|
+
/* \f */
|
|
982
|
+
CHAR_FORWARD_SLASH: 47,
|
|
983
|
+
/* / */
|
|
984
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
985
|
+
/* ` */
|
|
986
|
+
CHAR_HASH: 35,
|
|
987
|
+
/* # */
|
|
988
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
989
|
+
/* - */
|
|
990
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
991
|
+
/* < */
|
|
992
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
993
|
+
/* { */
|
|
994
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
995
|
+
/* [ */
|
|
996
|
+
CHAR_LINE_FEED: 10,
|
|
997
|
+
/* \n */
|
|
998
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
999
|
+
/* \u00A0 */
|
|
1000
|
+
CHAR_PERCENT: 37,
|
|
1001
|
+
/* % */
|
|
1002
|
+
CHAR_PLUS: 43,
|
|
1003
|
+
/* + */
|
|
1004
|
+
CHAR_QUESTION_MARK: 63,
|
|
1005
|
+
/* ? */
|
|
1006
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
1007
|
+
/* > */
|
|
1008
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
1009
|
+
/* } */
|
|
1010
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
1011
|
+
/* ] */
|
|
1012
|
+
CHAR_SEMICOLON: 59,
|
|
1013
|
+
/* ; */
|
|
1014
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
1015
|
+
/* ' */
|
|
1016
|
+
CHAR_SPACE: 32,
|
|
1017
|
+
/* */
|
|
1018
|
+
CHAR_TAB: 9,
|
|
1019
|
+
/* \t */
|
|
1020
|
+
CHAR_UNDERSCORE: 95,
|
|
1021
|
+
/* _ */
|
|
1022
|
+
CHAR_VERTICAL_LINE: 124,
|
|
1023
|
+
/* | */
|
|
1024
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
1025
|
+
/* \uFEFF */
|
|
1026
|
+
SEP: path2.sep,
|
|
1027
|
+
/**
|
|
1028
|
+
* Create EXTGLOB_CHARS
|
|
1029
|
+
*/
|
|
1030
|
+
extglobChars(chars) {
|
|
1031
|
+
return {
|
|
1032
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
1033
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
1034
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
1035
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
1036
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
1037
|
+
};
|
|
1038
|
+
},
|
|
1039
|
+
/**
|
|
1040
|
+
* Create GLOB_CHARS
|
|
1041
|
+
*/
|
|
1042
|
+
globChars(win32) {
|
|
1043
|
+
return win32 === !0 ? WINDOWS_CHARS : POSIX_CHARS;
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
// ../../node_modules/picomatch/lib/utils.js
|
|
1050
|
+
var require_utils2 = __commonJS({
|
|
1051
|
+
"../../node_modules/picomatch/lib/utils.js"(exports) {
|
|
1052
|
+
"use strict";
|
|
1053
|
+
var path2 = __require("path"), win32 = process.platform === "win32", {
|
|
1054
|
+
REGEX_BACKSLASH,
|
|
1055
|
+
REGEX_REMOVE_BACKSLASH,
|
|
1056
|
+
REGEX_SPECIAL_CHARS,
|
|
1057
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
1058
|
+
} = require_constants2();
|
|
1059
|
+
exports.isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val);
|
|
1060
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
1061
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
1062
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
1063
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
1064
|
+
exports.removeBackslashes = (str) => str.replace(REGEX_REMOVE_BACKSLASH, (match) => match === "\\" ? "" : match);
|
|
1065
|
+
exports.supportsLookbehinds = () => {
|
|
1066
|
+
let segs = process.version.slice(1).split(".").map(Number);
|
|
1067
|
+
return segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10;
|
|
1068
|
+
};
|
|
1069
|
+
exports.isWindows = (options) => options && typeof options.windows == "boolean" ? options.windows : win32 === !0 || path2.sep === "\\";
|
|
1070
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
1071
|
+
let idx = input.lastIndexOf(char, lastIdx);
|
|
1072
|
+
return idx === -1 ? input : input[idx - 1] === "\\" ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
1073
|
+
};
|
|
1074
|
+
exports.removePrefix = (input, state = {}) => {
|
|
1075
|
+
let output = input;
|
|
1076
|
+
return output.startsWith("./") && (output = output.slice(2), state.prefix = "./"), output;
|
|
1077
|
+
};
|
|
1078
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
1079
|
+
let prepend = options.contains ? "" : "^", append = options.contains ? "" : "$", output = `${prepend}(?:${input})${append}`;
|
|
1080
|
+
return state.negated === !0 && (output = `(?:^(?!${output}).*$)`), output;
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
|
|
1085
|
+
// ../../node_modules/picomatch/lib/scan.js
|
|
1086
|
+
var require_scan = __commonJS({
|
|
1087
|
+
"../../node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
1088
|
+
"use strict";
|
|
1089
|
+
var utils = require_utils2(), {
|
|
1090
|
+
CHAR_ASTERISK,
|
|
1091
|
+
/* * */
|
|
1092
|
+
CHAR_AT,
|
|
1093
|
+
/* @ */
|
|
1094
|
+
CHAR_BACKWARD_SLASH,
|
|
1095
|
+
/* \ */
|
|
1096
|
+
CHAR_COMMA,
|
|
1097
|
+
/* , */
|
|
1098
|
+
CHAR_DOT,
|
|
1099
|
+
/* . */
|
|
1100
|
+
CHAR_EXCLAMATION_MARK,
|
|
1101
|
+
/* ! */
|
|
1102
|
+
CHAR_FORWARD_SLASH,
|
|
1103
|
+
/* / */
|
|
1104
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
1105
|
+
/* { */
|
|
1106
|
+
CHAR_LEFT_PARENTHESES,
|
|
1107
|
+
/* ( */
|
|
1108
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
1109
|
+
/* [ */
|
|
1110
|
+
CHAR_PLUS,
|
|
1111
|
+
/* + */
|
|
1112
|
+
CHAR_QUESTION_MARK,
|
|
1113
|
+
/* ? */
|
|
1114
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
1115
|
+
/* } */
|
|
1116
|
+
CHAR_RIGHT_PARENTHESES,
|
|
1117
|
+
/* ) */
|
|
1118
|
+
CHAR_RIGHT_SQUARE_BRACKET
|
|
1119
|
+
/* ] */
|
|
1120
|
+
} = require_constants2(), isPathSeparator = (code) => code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token) => {
|
|
1121
|
+
token.isPrefix !== !0 && (token.depth = token.isGlobstar ? 1 / 0 : 1);
|
|
1122
|
+
}, scan = (input, options) => {
|
|
1123
|
+
let opts = options || {}, length = input.length - 1, scanToEnd = opts.parts === !0 || opts.scanToEnd === !0, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished2 = !1, braces = 0, prev, code, token = { value: "", depth: 0, isGlob: !1 }, eos = () => index >= length, peek = () => str.charCodeAt(index + 1), advance = () => (prev = code, str.charCodeAt(++index));
|
|
1124
|
+
for (; index < length; ) {
|
|
1125
|
+
code = advance();
|
|
1126
|
+
let next;
|
|
1127
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1128
|
+
backslashes = token.backslashes = !0, code = advance(), code === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
|
|
1129
|
+
continue;
|
|
1130
|
+
}
|
|
1131
|
+
if (braceEscaped === !0 || code === CHAR_LEFT_CURLY_BRACE) {
|
|
1132
|
+
for (braces++; eos() !== !0 && (code = advance()); ) {
|
|
1133
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1134
|
+
backslashes = token.backslashes = !0, advance();
|
|
1135
|
+
continue;
|
|
1136
|
+
}
|
|
1137
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1138
|
+
braces++;
|
|
1139
|
+
continue;
|
|
1140
|
+
}
|
|
1141
|
+
if (braceEscaped !== !0 && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
1142
|
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished2 = !0, scanToEnd === !0)
|
|
1143
|
+
continue;
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1146
|
+
if (braceEscaped !== !0 && code === CHAR_COMMA) {
|
|
1147
|
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished2 = !0, scanToEnd === !0)
|
|
1148
|
+
continue;
|
|
1149
|
+
break;
|
|
1150
|
+
}
|
|
1151
|
+
if (code === CHAR_RIGHT_CURLY_BRACE && (braces--, braces === 0)) {
|
|
1152
|
+
braceEscaped = !1, isBrace = token.isBrace = !0, finished2 = !0;
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
if (scanToEnd === !0)
|
|
1157
|
+
continue;
|
|
1158
|
+
break;
|
|
1159
|
+
}
|
|
1160
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
1161
|
+
if (slashes.push(index), tokens.push(token), token = { value: "", depth: 0, isGlob: !1 }, finished2 === !0) continue;
|
|
1162
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
1163
|
+
start += 2;
|
|
1164
|
+
continue;
|
|
1165
|
+
}
|
|
1166
|
+
lastIndex = index + 1;
|
|
1167
|
+
continue;
|
|
1168
|
+
}
|
|
1169
|
+
if (opts.noext !== !0 && (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === !0 && peek() === CHAR_LEFT_PARENTHESES) {
|
|
1170
|
+
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished2 = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), scanToEnd === !0) {
|
|
1171
|
+
for (; eos() !== !0 && (code = advance()); ) {
|
|
1172
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1173
|
+
backslashes = token.backslashes = !0, code = advance();
|
|
1174
|
+
continue;
|
|
1175
|
+
}
|
|
1176
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1177
|
+
isGlob = token.isGlob = !0, finished2 = !0;
|
|
1178
|
+
break;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
continue;
|
|
1182
|
+
}
|
|
1183
|
+
break;
|
|
1184
|
+
}
|
|
1185
|
+
if (code === CHAR_ASTERISK) {
|
|
1186
|
+
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished2 = !0, scanToEnd === !0)
|
|
1187
|
+
continue;
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
1191
|
+
if (isGlob = token.isGlob = !0, finished2 = !0, scanToEnd === !0)
|
|
1192
|
+
continue;
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1196
|
+
for (; eos() !== !0 && (next = advance()); ) {
|
|
1197
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
1198
|
+
backslashes = token.backslashes = !0, advance();
|
|
1199
|
+
continue;
|
|
1200
|
+
}
|
|
1201
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1202
|
+
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished2 = !0;
|
|
1203
|
+
break;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
if (scanToEnd === !0)
|
|
1207
|
+
continue;
|
|
1208
|
+
break;
|
|
1209
|
+
}
|
|
1210
|
+
if (opts.nonegate !== !0 && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1211
|
+
negated = token.negated = !0, start++;
|
|
1212
|
+
continue;
|
|
1213
|
+
}
|
|
1214
|
+
if (opts.noparen !== !0 && code === CHAR_LEFT_PARENTHESES) {
|
|
1215
|
+
if (isGlob = token.isGlob = !0, scanToEnd === !0) {
|
|
1216
|
+
for (; eos() !== !0 && (code = advance()); ) {
|
|
1217
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
1218
|
+
backslashes = token.backslashes = !0, code = advance();
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1222
|
+
finished2 = !0;
|
|
1223
|
+
break;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
continue;
|
|
1227
|
+
}
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
if (isGlob === !0) {
|
|
1231
|
+
if (finished2 = !0, scanToEnd === !0)
|
|
1232
|
+
continue;
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
opts.noext === !0 && (isExtglob = !1, isGlob = !1);
|
|
1237
|
+
let base = str, prefix = "", glob = "";
|
|
1238
|
+
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && isGlob === !0 && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : isGlob === !0 ? (base = "", glob = str) : base = str, base && base !== "" && base !== "/" && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), opts.unescape === !0 && (glob && (glob = utils.removeBackslashes(glob)), base && backslashes === !0 && (base = utils.removeBackslashes(base)));
|
|
1239
|
+
let state = {
|
|
1240
|
+
prefix,
|
|
1241
|
+
input,
|
|
1242
|
+
start,
|
|
1243
|
+
base,
|
|
1244
|
+
glob,
|
|
1245
|
+
isBrace,
|
|
1246
|
+
isBracket,
|
|
1247
|
+
isGlob,
|
|
1248
|
+
isExtglob,
|
|
1249
|
+
isGlobstar,
|
|
1250
|
+
negated,
|
|
1251
|
+
negatedExtglob
|
|
1252
|
+
};
|
|
1253
|
+
if (opts.tokens === !0 && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), opts.parts === !0 || opts.tokens === !0) {
|
|
1254
|
+
let prevIndex;
|
|
1255
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
1256
|
+
let n = prevIndex ? prevIndex + 1 : start, i = slashes[idx], value = input.slice(n, i);
|
|
1257
|
+
opts.tokens && (idx === 0 && start !== 0 ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), (idx !== 0 || value !== "") && parts.push(value), prevIndex = i;
|
|
1258
|
+
}
|
|
1259
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
1260
|
+
let value = input.slice(prevIndex + 1);
|
|
1261
|
+
parts.push(value), opts.tokens && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth);
|
|
1262
|
+
}
|
|
1263
|
+
state.slashes = slashes, state.parts = parts;
|
|
1264
|
+
}
|
|
1265
|
+
return state;
|
|
1266
|
+
};
|
|
1267
|
+
module.exports = scan;
|
|
1268
|
+
}
|
|
1269
|
+
});
|
|
1270
|
+
|
|
1271
|
+
// ../../node_modules/picomatch/lib/parse.js
|
|
1272
|
+
var require_parse2 = __commonJS({
|
|
1273
|
+
"../../node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
1274
|
+
"use strict";
|
|
1275
|
+
var constants = require_constants2(), utils = require_utils2(), {
|
|
1276
|
+
MAX_LENGTH,
|
|
1277
|
+
POSIX_REGEX_SOURCE,
|
|
1278
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
1279
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
1280
|
+
REPLACEMENTS
|
|
1281
|
+
} = constants, expandRange = (args, options) => {
|
|
1282
|
+
if (typeof options.expandRange == "function")
|
|
1283
|
+
return options.expandRange(...args, options);
|
|
1284
|
+
args.sort();
|
|
1285
|
+
let value = `[${args.join("-")}]`;
|
|
1286
|
+
try {
|
|
1287
|
+
new RegExp(value);
|
|
1288
|
+
} catch {
|
|
1289
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
1290
|
+
}
|
|
1291
|
+
return value;
|
|
1292
|
+
}, syntaxError = (type, char) => `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, parse = (input, options) => {
|
|
1293
|
+
if (typeof input != "string")
|
|
1294
|
+
throw new TypeError("Expected a string");
|
|
1295
|
+
input = REPLACEMENTS[input] || input;
|
|
1296
|
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
1297
|
+
if (len > max)
|
|
1298
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1299
|
+
let bos = { type: "bos", value: "", output: opts.prepend || "" }, tokens = [bos], capture = opts.capture ? "" : "?:", win32 = utils.isWindows(options), PLATFORM_CHARS = constants.globChars(win32), EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS), {
|
|
1300
|
+
DOT_LITERAL,
|
|
1301
|
+
PLUS_LITERAL,
|
|
1302
|
+
SLASH_LITERAL,
|
|
1303
|
+
ONE_CHAR,
|
|
1304
|
+
DOTS_SLASH,
|
|
1305
|
+
NO_DOT,
|
|
1306
|
+
NO_DOT_SLASH,
|
|
1307
|
+
NO_DOTS_SLASH,
|
|
1308
|
+
QMARK,
|
|
1309
|
+
QMARK_NO_DOT,
|
|
1310
|
+
STAR,
|
|
1311
|
+
START_ANCHOR
|
|
1312
|
+
} = PLATFORM_CHARS, globstar = (opts2) => `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? "" : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = opts.bash === !0 ? globstar(opts) : STAR;
|
|
1313
|
+
opts.capture && (star = `(${star})`), typeof opts.noext == "boolean" && (opts.noextglob = opts.noext);
|
|
1314
|
+
let state = {
|
|
1315
|
+
input,
|
|
1316
|
+
index: -1,
|
|
1317
|
+
start: 0,
|
|
1318
|
+
dot: opts.dot === !0,
|
|
1319
|
+
consumed: "",
|
|
1320
|
+
output: "",
|
|
1321
|
+
prefix: "",
|
|
1322
|
+
backtrack: !1,
|
|
1323
|
+
negated: !1,
|
|
1324
|
+
brackets: 0,
|
|
1325
|
+
braces: 0,
|
|
1326
|
+
parens: 0,
|
|
1327
|
+
quotes: 0,
|
|
1328
|
+
globstar: !1,
|
|
1329
|
+
tokens
|
|
1330
|
+
};
|
|
1331
|
+
input = utils.removePrefix(input, state), len = input.length;
|
|
1332
|
+
let extglobs = [], braces = [], stack = [], prev = bos, value, eos = () => state.index === len - 1, peek = state.peek = (n = 1) => input[state.index + n], advance = state.advance = () => input[++state.index] || "", remaining = () => input.slice(state.index + 1), consume = (value2 = "", num = 0) => {
|
|
1333
|
+
state.consumed += value2, state.index += num;
|
|
1334
|
+
}, append = (token) => {
|
|
1335
|
+
state.output += token.output != null ? token.output : token.value, consume(token.value);
|
|
1336
|
+
}, negate = () => {
|
|
1337
|
+
let count = 1;
|
|
1338
|
+
for (; peek() === "!" && (peek(2) !== "(" || peek(3) === "?"); )
|
|
1339
|
+
advance(), state.start++, count++;
|
|
1340
|
+
return count % 2 === 0 ? !1 : (state.negated = !0, state.start++, !0);
|
|
1341
|
+
}, increment = (type) => {
|
|
1342
|
+
state[type]++, stack.push(type);
|
|
1343
|
+
}, decrement = (type) => {
|
|
1344
|
+
state[type]--, stack.pop();
|
|
1345
|
+
}, push = (tok) => {
|
|
1346
|
+
if (prev.type === "globstar") {
|
|
1347
|
+
let isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"), isExtglob = tok.extglob === !0 || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
1348
|
+
tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob && (state.output = state.output.slice(0, -prev.output.length), prev.type = "star", prev.value = "*", prev.output = star, state.output += prev.output);
|
|
1349
|
+
}
|
|
1350
|
+
if (extglobs.length && tok.type !== "paren" && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && prev.type === "text" && tok.type === "text") {
|
|
1351
|
+
prev.value += tok.value, prev.output = (prev.output || "") + tok.value;
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1354
|
+
tok.prev = prev, tokens.push(tok), prev = tok;
|
|
1355
|
+
}, extglobOpen = (type, value2) => {
|
|
1356
|
+
let token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
1357
|
+
token.prev = prev, token.parens = state.parens, token.output = state.output;
|
|
1358
|
+
let output = (opts.capture ? "(" : "") + token.open;
|
|
1359
|
+
increment("parens"), push({ type, value: value2, output: state.output ? "" : ONE_CHAR }), push({ type: "paren", extglob: !0, value: advance(), output }), extglobs.push(token);
|
|
1360
|
+
}, extglobClose = (token) => {
|
|
1361
|
+
let output = token.close + (opts.capture ? ")" : ""), rest;
|
|
1362
|
+
if (token.type === "negate") {
|
|
1363
|
+
let extglobStar = star;
|
|
1364
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/") && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
1365
|
+
let expression = parse(rest, { ...options, fastpaths: !1 }).output;
|
|
1366
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
1367
|
+
}
|
|
1368
|
+
token.prev.type === "bos" && (state.negatedExtglob = !0);
|
|
1369
|
+
}
|
|
1370
|
+
push({ type: "paren", extglob: !0, value, output }), decrement("parens");
|
|
1371
|
+
};
|
|
1372
|
+
if (opts.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
1373
|
+
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => first === "\\" ? (backslashes = !0, m) : first === "?" ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : "") : index === 0 ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "") : QMARK.repeat(chars.length) : first === "." ? DOT_LITERAL.repeat(chars.length) : first === "*" ? esc ? esc + first + (rest ? star : "") : star : esc ? m : `\\${m}`);
|
|
1374
|
+
return backslashes === !0 && (opts.unescape === !0 ? output = output.replace(/\\/g, "") : output = output.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), output === input && opts.contains === !0 ? (state.output = input, state) : (state.output = utils.wrapOutput(output, state, options), state);
|
|
1375
|
+
}
|
|
1376
|
+
for (; !eos(); ) {
|
|
1377
|
+
if (value = advance(), value === "\0")
|
|
1378
|
+
continue;
|
|
1379
|
+
if (value === "\\") {
|
|
1380
|
+
let next = peek();
|
|
1381
|
+
if (next === "/" && opts.bash !== !0 || next === "." || next === ";")
|
|
1382
|
+
continue;
|
|
1383
|
+
if (!next) {
|
|
1384
|
+
value += "\\", push({ type: "text", value });
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
let match = /^\\+/.exec(remaining()), slashes = 0;
|
|
1388
|
+
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 !== 0 && (value += "\\")), opts.unescape === !0 ? value = advance() : value += advance(), state.brackets === 0) {
|
|
1389
|
+
push({ type: "text", value });
|
|
1390
|
+
continue;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
1394
|
+
if (opts.posix !== !1 && value === ":") {
|
|
1395
|
+
let inner = prev.value.slice(1);
|
|
1396
|
+
if (inner.includes("[") && (prev.posix = !0, inner.includes(":"))) {
|
|
1397
|
+
let idx = prev.value.lastIndexOf("["), pre = prev.value.slice(0, idx), rest2 = prev.value.slice(idx + 2), posix = POSIX_REGEX_SOURCE[rest2];
|
|
1398
|
+
if (posix) {
|
|
1399
|
+
prev.value = pre + posix, state.backtrack = !0, advance(), !bos.output && tokens.indexOf(prev) === 1 && (bos.output = ONE_CHAR);
|
|
1400
|
+
continue;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
(value === "[" && peek() !== ":" || value === "-" && peek() === "]") && (value = `\\${value}`), value === "]" && (prev.value === "[" || prev.value === "[^") && (value = `\\${value}`), opts.posix === !0 && value === "!" && prev.value === "[" && (value = "^"), prev.value += value, append({ value });
|
|
1405
|
+
continue;
|
|
1406
|
+
}
|
|
1407
|
+
if (state.quotes === 1 && value !== '"') {
|
|
1408
|
+
value = utils.escapeRegex(value), prev.value += value, append({ value });
|
|
1409
|
+
continue;
|
|
1410
|
+
}
|
|
1411
|
+
if (value === '"') {
|
|
1412
|
+
state.quotes = state.quotes === 1 ? 0 : 1, opts.keepQuotes === !0 && push({ type: "text", value });
|
|
1413
|
+
continue;
|
|
1414
|
+
}
|
|
1415
|
+
if (value === "(") {
|
|
1416
|
+
increment("parens"), push({ type: "paren", value });
|
|
1417
|
+
continue;
|
|
1418
|
+
}
|
|
1419
|
+
if (value === ")") {
|
|
1420
|
+
if (state.parens === 0 && opts.strictBrackets === !0)
|
|
1421
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
1422
|
+
let extglob = extglobs[extglobs.length - 1];
|
|
1423
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
1424
|
+
extglobClose(extglobs.pop());
|
|
1425
|
+
continue;
|
|
1426
|
+
}
|
|
1427
|
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" }), decrement("parens");
|
|
1428
|
+
continue;
|
|
1429
|
+
}
|
|
1430
|
+
if (value === "[") {
|
|
1431
|
+
if (opts.nobracket === !0 || !remaining().includes("]")) {
|
|
1432
|
+
if (opts.nobracket !== !0 && opts.strictBrackets === !0)
|
|
1433
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
1434
|
+
value = `\\${value}`;
|
|
1435
|
+
} else
|
|
1436
|
+
increment("brackets");
|
|
1437
|
+
push({ type: "bracket", value });
|
|
1438
|
+
continue;
|
|
1439
|
+
}
|
|
1440
|
+
if (value === "]") {
|
|
1441
|
+
if (opts.nobracket === !0 || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
1442
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
1443
|
+
continue;
|
|
1444
|
+
}
|
|
1445
|
+
if (state.brackets === 0) {
|
|
1446
|
+
if (opts.strictBrackets === !0)
|
|
1447
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
1448
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
1449
|
+
continue;
|
|
1450
|
+
}
|
|
1451
|
+
decrement("brackets");
|
|
1452
|
+
let prevValue = prev.value.slice(1);
|
|
1453
|
+
if (prev.posix !== !0 && prevValue[0] === "^" && !prevValue.includes("/") && (value = `/${value}`), prev.value += value, append({ value }), opts.literalBrackets === !1 || utils.hasRegexChars(prevValue))
|
|
1454
|
+
continue;
|
|
1455
|
+
let escaped = utils.escapeRegex(prev.value);
|
|
1456
|
+
if (state.output = state.output.slice(0, -prev.value.length), opts.literalBrackets === !0) {
|
|
1457
|
+
state.output += escaped, prev.value = escaped;
|
|
1458
|
+
continue;
|
|
1459
|
+
}
|
|
1460
|
+
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
|
|
1461
|
+
continue;
|
|
1462
|
+
}
|
|
1463
|
+
if (value === "{" && opts.nobrace !== !0) {
|
|
1464
|
+
increment("braces");
|
|
1465
|
+
let open = {
|
|
1466
|
+
type: "brace",
|
|
1467
|
+
value,
|
|
1468
|
+
output: "(",
|
|
1469
|
+
outputIndex: state.output.length,
|
|
1470
|
+
tokensIndex: state.tokens.length
|
|
1471
|
+
};
|
|
1472
|
+
braces.push(open), push(open);
|
|
1473
|
+
continue;
|
|
1474
|
+
}
|
|
1475
|
+
if (value === "}") {
|
|
1476
|
+
let brace = braces[braces.length - 1];
|
|
1477
|
+
if (opts.nobrace === !0 || !brace) {
|
|
1478
|
+
push({ type: "text", value, output: value });
|
|
1479
|
+
continue;
|
|
1480
|
+
}
|
|
1481
|
+
let output = ")";
|
|
1482
|
+
if (brace.dots === !0) {
|
|
1483
|
+
let arr = tokens.slice(), range = [];
|
|
1484
|
+
for (let i = arr.length - 1; i >= 0 && (tokens.pop(), arr[i].type !== "brace"); i--)
|
|
1485
|
+
arr[i].type !== "dots" && range.unshift(arr[i].value);
|
|
1486
|
+
output = expandRange(range, opts), state.backtrack = !0;
|
|
1487
|
+
}
|
|
1488
|
+
if (brace.comma !== !0 && brace.dots !== !0) {
|
|
1489
|
+
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
|
|
1490
|
+
brace.value = brace.output = "\\{", value = output = "\\}", state.output = out;
|
|
1491
|
+
for (let t of toks)
|
|
1492
|
+
state.output += t.output || t.value;
|
|
1493
|
+
}
|
|
1494
|
+
push({ type: "brace", value, output }), decrement("braces"), braces.pop();
|
|
1495
|
+
continue;
|
|
1496
|
+
}
|
|
1497
|
+
if (value === "|") {
|
|
1498
|
+
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({ type: "text", value });
|
|
1499
|
+
continue;
|
|
1500
|
+
}
|
|
1501
|
+
if (value === ",") {
|
|
1502
|
+
let output = value, brace = braces[braces.length - 1];
|
|
1503
|
+
brace && stack[stack.length - 1] === "braces" && (brace.comma = !0, output = "|"), push({ type: "comma", value, output });
|
|
1504
|
+
continue;
|
|
1505
|
+
}
|
|
1506
|
+
if (value === "/") {
|
|
1507
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
1508
|
+
state.start = state.index + 1, state.consumed = "", state.output = "", tokens.pop(), prev = bos;
|
|
1509
|
+
continue;
|
|
1510
|
+
}
|
|
1511
|
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
1512
|
+
continue;
|
|
1513
|
+
}
|
|
1514
|
+
if (value === ".") {
|
|
1515
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
1516
|
+
prev.value === "." && (prev.output = DOT_LITERAL);
|
|
1517
|
+
let brace = braces[braces.length - 1];
|
|
1518
|
+
prev.type = "dots", prev.output += value, prev.value += value, brace.dots = !0;
|
|
1519
|
+
continue;
|
|
1520
|
+
}
|
|
1521
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
1522
|
+
push({ type: "text", value, output: DOT_LITERAL });
|
|
1523
|
+
continue;
|
|
1524
|
+
}
|
|
1525
|
+
push({ type: "dot", value, output: DOT_LITERAL });
|
|
1526
|
+
continue;
|
|
1527
|
+
}
|
|
1528
|
+
if (value === "?") {
|
|
1529
|
+
if (!(prev && prev.value === "(") && opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
1530
|
+
extglobOpen("qmark", value);
|
|
1531
|
+
continue;
|
|
1532
|
+
}
|
|
1533
|
+
if (prev && prev.type === "paren") {
|
|
1534
|
+
let next = peek(), output = value;
|
|
1535
|
+
if (next === "<" && !utils.supportsLookbehinds())
|
|
1536
|
+
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
1537
|
+
(prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) && (output = `\\${value}`), push({ type: "text", value, output });
|
|
1538
|
+
continue;
|
|
1539
|
+
}
|
|
1540
|
+
if (opts.dot !== !0 && (prev.type === "slash" || prev.type === "bos")) {
|
|
1541
|
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
1542
|
+
continue;
|
|
1543
|
+
}
|
|
1544
|
+
push({ type: "qmark", value, output: QMARK });
|
|
1545
|
+
continue;
|
|
1546
|
+
}
|
|
1547
|
+
if (value === "!") {
|
|
1548
|
+
if (opts.noextglob !== !0 && peek() === "(" && (peek(2) !== "?" || !/[!=<:]/.test(peek(3)))) {
|
|
1549
|
+
extglobOpen("negate", value);
|
|
1550
|
+
continue;
|
|
1551
|
+
}
|
|
1552
|
+
if (opts.nonegate !== !0 && state.index === 0) {
|
|
1553
|
+
negate();
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
if (value === "+") {
|
|
1558
|
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
1559
|
+
extglobOpen("plus", value);
|
|
1560
|
+
continue;
|
|
1561
|
+
}
|
|
1562
|
+
if (prev && prev.value === "(" || opts.regex === !1) {
|
|
1563
|
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
1564
|
+
continue;
|
|
1565
|
+
}
|
|
1566
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
1567
|
+
push({ type: "plus", value });
|
|
1568
|
+
continue;
|
|
1569
|
+
}
|
|
1570
|
+
push({ type: "plus", value: PLUS_LITERAL });
|
|
1571
|
+
continue;
|
|
1572
|
+
}
|
|
1573
|
+
if (value === "@") {
|
|
1574
|
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
1575
|
+
push({ type: "at", extglob: !0, value, output: "" });
|
|
1576
|
+
continue;
|
|
1577
|
+
}
|
|
1578
|
+
push({ type: "text", value });
|
|
1579
|
+
continue;
|
|
1580
|
+
}
|
|
1581
|
+
if (value !== "*") {
|
|
1582
|
+
(value === "$" || value === "^") && (value = `\\${value}`);
|
|
1583
|
+
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
1584
|
+
match && (value += match[0], state.index += match[0].length), push({ type: "text", value });
|
|
1585
|
+
continue;
|
|
1586
|
+
}
|
|
1587
|
+
if (prev && (prev.type === "globstar" || prev.star === !0)) {
|
|
1588
|
+
prev.type = "star", prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
|
|
1589
|
+
continue;
|
|
1590
|
+
}
|
|
1591
|
+
let rest = remaining();
|
|
1592
|
+
if (opts.noextglob !== !0 && /^\([^?]/.test(rest)) {
|
|
1593
|
+
extglobOpen("star", value);
|
|
1594
|
+
continue;
|
|
1595
|
+
}
|
|
1596
|
+
if (prev.type === "star") {
|
|
1597
|
+
if (opts.noglobstar === !0) {
|
|
1598
|
+
consume(value);
|
|
1599
|
+
continue;
|
|
1600
|
+
}
|
|
1601
|
+
let prior = prev.prev, before = prior.prev, isStart = prior.type === "slash" || prior.type === "bos", afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
1602
|
+
if (opts.bash === !0 && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
1603
|
+
push({ type: "star", value, output: "" });
|
|
1604
|
+
continue;
|
|
1605
|
+
}
|
|
1606
|
+
let isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"), isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
1607
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
1608
|
+
push({ type: "star", value, output: "" });
|
|
1609
|
+
continue;
|
|
1610
|
+
}
|
|
1611
|
+
for (; rest.slice(0, 3) === "/**"; ) {
|
|
1612
|
+
let after = input[state.index + 4];
|
|
1613
|
+
if (after && after !== "/")
|
|
1614
|
+
break;
|
|
1615
|
+
rest = rest.slice(3), consume("/**", 3);
|
|
1616
|
+
}
|
|
1617
|
+
if (prior.type === "bos" && eos()) {
|
|
1618
|
+
prev.type = "globstar", prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
|
|
1619
|
+
continue;
|
|
1620
|
+
}
|
|
1621
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
1622
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
|
|
1623
|
+
continue;
|
|
1624
|
+
}
|
|
1625
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
1626
|
+
let end = rest[1] !== void 0 ? "|$" : "";
|
|
1627
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
1628
|
+
continue;
|
|
1629
|
+
}
|
|
1630
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
1631
|
+
prev.type = "globstar", prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
1632
|
+
continue;
|
|
1633
|
+
}
|
|
1634
|
+
state.output = state.output.slice(0, -prev.output.length), prev.type = "globstar", prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
|
|
1635
|
+
continue;
|
|
1636
|
+
}
|
|
1637
|
+
let token = { type: "star", value, output: star };
|
|
1638
|
+
if (opts.bash === !0) {
|
|
1639
|
+
token.output = ".*?", (prev.type === "bos" || prev.type === "slash") && (token.output = nodot + token.output), push(token);
|
|
1640
|
+
continue;
|
|
1641
|
+
}
|
|
1642
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === !0) {
|
|
1643
|
+
token.output = value, push(token);
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
(state.index === state.start || prev.type === "slash" || prev.type === "dot") && (prev.type === "dot" ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : opts.dot === !0 ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), peek() !== "*" && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
|
|
1647
|
+
}
|
|
1648
|
+
for (; state.brackets > 0; ) {
|
|
1649
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1650
|
+
state.output = utils.escapeLast(state.output, "["), decrement("brackets");
|
|
1651
|
+
}
|
|
1652
|
+
for (; state.parens > 0; ) {
|
|
1653
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", ")"));
|
|
1654
|
+
state.output = utils.escapeLast(state.output, "("), decrement("parens");
|
|
1655
|
+
}
|
|
1656
|
+
for (; state.braces > 0; ) {
|
|
1657
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "}"));
|
|
1658
|
+
state.output = utils.escapeLast(state.output, "{"), decrement("braces");
|
|
1659
|
+
}
|
|
1660
|
+
if (opts.strictSlashes !== !0 && (prev.type === "star" || prev.type === "bracket") && push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }), state.backtrack === !0) {
|
|
1661
|
+
state.output = "";
|
|
1662
|
+
for (let token of state.tokens)
|
|
1663
|
+
state.output += token.output != null ? token.output : token.value, token.suffix && (state.output += token.suffix);
|
|
1664
|
+
}
|
|
1665
|
+
return state;
|
|
1666
|
+
};
|
|
1667
|
+
parse.fastpaths = (input, options) => {
|
|
1668
|
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
1669
|
+
if (len > max)
|
|
1670
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1671
|
+
input = REPLACEMENTS[input] || input;
|
|
1672
|
+
let win32 = utils.isWindows(options), {
|
|
1673
|
+
DOT_LITERAL,
|
|
1674
|
+
SLASH_LITERAL,
|
|
1675
|
+
ONE_CHAR,
|
|
1676
|
+
DOTS_SLASH,
|
|
1677
|
+
NO_DOT,
|
|
1678
|
+
NO_DOTS,
|
|
1679
|
+
NO_DOTS_SLASH,
|
|
1680
|
+
STAR,
|
|
1681
|
+
START_ANCHOR
|
|
1682
|
+
} = constants.globChars(win32), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? "" : "?:", state = { negated: !1, prefix: "" }, star = opts.bash === !0 ? ".*?" : STAR;
|
|
1683
|
+
opts.capture && (star = `(${star})`);
|
|
1684
|
+
let globstar = (opts2) => opts2.noglobstar === !0 ? star : `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str) => {
|
|
1685
|
+
switch (str) {
|
|
1686
|
+
case "*":
|
|
1687
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
1688
|
+
case ".*":
|
|
1689
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1690
|
+
case "*.*":
|
|
1691
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1692
|
+
case "*/*":
|
|
1693
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1694
|
+
case "**":
|
|
1695
|
+
return nodot + globstar(opts);
|
|
1696
|
+
case "**/*":
|
|
1697
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1698
|
+
case "**/*.*":
|
|
1699
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1700
|
+
case "**/.*":
|
|
1701
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1702
|
+
default: {
|
|
1703
|
+
let match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1704
|
+
if (!match) return;
|
|
1705
|
+
let source2 = create(match[1]);
|
|
1706
|
+
return source2 ? source2 + DOT_LITERAL + match[2] : void 0;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
}, output = utils.removePrefix(input, state), source = create(output);
|
|
1710
|
+
return source && opts.strictSlashes !== !0 && (source += `${SLASH_LITERAL}?`), source;
|
|
1711
|
+
};
|
|
1712
|
+
module.exports = parse;
|
|
1713
|
+
}
|
|
1714
|
+
});
|
|
1715
|
+
|
|
1716
|
+
// ../../node_modules/picomatch/lib/picomatch.js
|
|
1717
|
+
var require_picomatch = __commonJS({
|
|
1718
|
+
"../../node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
1719
|
+
"use strict";
|
|
1720
|
+
var path2 = __require("path"), scan = require_scan(), parse = require_parse2(), utils = require_utils2(), constants = require_constants2(), isObject = (val) => val && typeof val == "object" && !Array.isArray(val), picomatch = (glob, options, returnState = !1) => {
|
|
1721
|
+
if (Array.isArray(glob)) {
|
|
1722
|
+
let fns = glob.map((input) => picomatch(input, options, returnState));
|
|
1723
|
+
return (str) => {
|
|
1724
|
+
for (let isMatch of fns) {
|
|
1725
|
+
let state2 = isMatch(str);
|
|
1726
|
+
if (state2) return state2;
|
|
1727
|
+
}
|
|
1728
|
+
return !1;
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
let isState = isObject(glob) && glob.tokens && glob.input;
|
|
1732
|
+
if (glob === "" || typeof glob != "string" && !isState)
|
|
1733
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
1734
|
+
let opts = options || {}, posix = utils.isWindows(options), regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, !1, !0), state = regex.state;
|
|
1735
|
+
delete regex.state;
|
|
1736
|
+
let isIgnored = () => !1;
|
|
1737
|
+
if (opts.ignore) {
|
|
1738
|
+
let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
1739
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
1740
|
+
}
|
|
1741
|
+
let matcher = (input, returnObject = !1) => {
|
|
1742
|
+
let { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }), result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
1743
|
+
return typeof opts.onResult == "function" && opts.onResult(result), isMatch === !1 ? (result.isMatch = !1, returnObject ? result : !1) : isIgnored(input) ? (typeof opts.onIgnore == "function" && opts.onIgnore(result), result.isMatch = !1, returnObject ? result : !1) : (typeof opts.onMatch == "function" && opts.onMatch(result), returnObject ? result : !0);
|
|
1744
|
+
};
|
|
1745
|
+
return returnState && (matcher.state = state), matcher;
|
|
1746
|
+
};
|
|
1747
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
1748
|
+
if (typeof input != "string")
|
|
1749
|
+
throw new TypeError("Expected input to be a string");
|
|
1750
|
+
if (input === "")
|
|
1751
|
+
return { isMatch: !1, output: "" };
|
|
1752
|
+
let opts = options || {}, format = opts.format || (posix ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
|
|
1753
|
+
return match === !1 && (output = format ? format(input) : input, match = output === glob), (match === !1 || opts.capture === !0) && (opts.matchBase === !0 || opts.basename === !0 ? match = picomatch.matchBase(input, regex, options, posix) : match = regex.exec(output)), { isMatch: !!match, match, output };
|
|
1754
|
+
};
|
|
1755
|
+
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path2.basename(input));
|
|
1756
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
1757
|
+
picomatch.parse = (pattern, options) => Array.isArray(pattern) ? pattern.map((p) => picomatch.parse(p, options)) : parse(pattern, { ...options, fastpaths: !1 });
|
|
1758
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
1759
|
+
picomatch.compileRe = (state, options, returnOutput = !1, returnState = !1) => {
|
|
1760
|
+
if (returnOutput === !0)
|
|
1761
|
+
return state.output;
|
|
1762
|
+
let opts = options || {}, prepend = opts.contains ? "" : "^", append = opts.contains ? "" : "$", source = `${prepend}(?:${state.output})${append}`;
|
|
1763
|
+
state && state.negated === !0 && (source = `^(?!${source}).*$`);
|
|
1764
|
+
let regex = picomatch.toRegex(source, options);
|
|
1765
|
+
return returnState === !0 && (regex.state = state), regex;
|
|
1766
|
+
};
|
|
1767
|
+
picomatch.makeRe = (input, options = {}, returnOutput = !1, returnState = !1) => {
|
|
1768
|
+
if (!input || typeof input != "string")
|
|
1769
|
+
throw new TypeError("Expected a non-empty string");
|
|
1770
|
+
let parsed = { negated: !1, fastpaths: !0 };
|
|
1771
|
+
return options.fastpaths !== !1 && (input[0] === "." || input[0] === "*") && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
1772
|
+
};
|
|
1773
|
+
picomatch.toRegex = (source, options) => {
|
|
1774
|
+
try {
|
|
1775
|
+
let opts = options || {};
|
|
1776
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
1777
|
+
} catch (err) {
|
|
1778
|
+
if (options && options.debug === !0) throw err;
|
|
1779
|
+
return /$^/;
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
picomatch.constants = constants;
|
|
1783
|
+
module.exports = picomatch;
|
|
1784
|
+
}
|
|
1785
|
+
});
|
|
1786
|
+
|
|
1787
|
+
// ../../node_modules/picomatch/index.js
|
|
1788
|
+
var require_picomatch2 = __commonJS({
|
|
1789
|
+
"../../node_modules/picomatch/index.js"(exports, module) {
|
|
1790
|
+
"use strict";
|
|
1791
|
+
module.exports = require_picomatch();
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
|
|
1795
|
+
// ../../node_modules/micromatch/index.js
|
|
1796
|
+
var require_micromatch = __commonJS({
|
|
1797
|
+
"../../node_modules/micromatch/index.js"(exports, module) {
|
|
1798
|
+
"use strict";
|
|
1799
|
+
var util = __require("util"), braces = require_braces(), picomatch = require_picomatch2(), utils = require_utils2(), isEmptyString = (v) => v === "" || v === "./", hasBraces = (v) => {
|
|
1800
|
+
let index = v.indexOf("{");
|
|
1801
|
+
return index > -1 && v.indexOf("}", index) > -1;
|
|
1802
|
+
}, micromatch = (list, patterns, options) => {
|
|
1803
|
+
patterns = [].concat(patterns), list = [].concat(list);
|
|
1804
|
+
let omit = /* @__PURE__ */ new Set(), keep = /* @__PURE__ */ new Set(), items = /* @__PURE__ */ new Set(), negatives = 0, onResult = (state) => {
|
|
1805
|
+
items.add(state.output), options && options.onResult && options.onResult(state);
|
|
1806
|
+
};
|
|
1807
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
1808
|
+
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, !0), negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
1809
|
+
negated && negatives++;
|
|
1810
|
+
for (let item of list) {
|
|
1811
|
+
let matched = isMatch(item, !0);
|
|
1812
|
+
(negated ? !matched.isMatch : matched.isMatch) && (negated ? omit.add(matched.output) : (omit.delete(matched.output), keep.add(matched.output)));
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
|
|
1816
|
+
if (options && matches.length === 0) {
|
|
1817
|
+
if (options.failglob === !0)
|
|
1818
|
+
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
1819
|
+
if (options.nonull === !0 || options.nullglob === !0)
|
|
1820
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
1821
|
+
}
|
|
1822
|
+
return matches;
|
|
1823
|
+
};
|
|
1824
|
+
micromatch.match = micromatch;
|
|
1825
|
+
micromatch.matcher = (pattern, options) => picomatch(pattern, options);
|
|
1826
|
+
micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
1827
|
+
micromatch.any = micromatch.isMatch;
|
|
1828
|
+
micromatch.not = (list, patterns, options = {}) => {
|
|
1829
|
+
patterns = [].concat(patterns).map(String);
|
|
1830
|
+
let result = /* @__PURE__ */ new Set(), items = [], onResult = (state) => {
|
|
1831
|
+
options.onResult && options.onResult(state), items.push(state.output);
|
|
1832
|
+
}, matches = new Set(micromatch(list, patterns, { ...options, onResult }));
|
|
1833
|
+
for (let item of items)
|
|
1834
|
+
matches.has(item) || result.add(item);
|
|
1835
|
+
return [...result];
|
|
1836
|
+
};
|
|
1837
|
+
micromatch.contains = (str, pattern, options) => {
|
|
1838
|
+
if (typeof str != "string")
|
|
1839
|
+
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
1840
|
+
if (Array.isArray(pattern))
|
|
1841
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
1842
|
+
if (typeof pattern == "string") {
|
|
1843
|
+
if (isEmptyString(str) || isEmptyString(pattern))
|
|
1844
|
+
return !1;
|
|
1845
|
+
if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern))
|
|
1846
|
+
return !0;
|
|
1847
|
+
}
|
|
1848
|
+
return micromatch.isMatch(str, pattern, { ...options, contains: !0 });
|
|
1849
|
+
};
|
|
1850
|
+
micromatch.matchKeys = (obj, patterns, options) => {
|
|
1851
|
+
if (!utils.isObject(obj))
|
|
1852
|
+
throw new TypeError("Expected the first argument to be an object");
|
|
1853
|
+
let keys = micromatch(Object.keys(obj), patterns, options), res = {};
|
|
1854
|
+
for (let key of keys) res[key] = obj[key];
|
|
1855
|
+
return res;
|
|
1856
|
+
};
|
|
1857
|
+
micromatch.some = (list, patterns, options) => {
|
|
1858
|
+
let items = [].concat(list);
|
|
1859
|
+
for (let pattern of [].concat(patterns)) {
|
|
1860
|
+
let isMatch = picomatch(String(pattern), options);
|
|
1861
|
+
if (items.some((item) => isMatch(item)))
|
|
1862
|
+
return !0;
|
|
1863
|
+
}
|
|
1864
|
+
return !1;
|
|
1865
|
+
};
|
|
1866
|
+
micromatch.every = (list, patterns, options) => {
|
|
1867
|
+
let items = [].concat(list);
|
|
1868
|
+
for (let pattern of [].concat(patterns)) {
|
|
1869
|
+
let isMatch = picomatch(String(pattern), options);
|
|
1870
|
+
if (!items.every((item) => isMatch(item)))
|
|
1871
|
+
return !1;
|
|
1872
|
+
}
|
|
1873
|
+
return !0;
|
|
1874
|
+
};
|
|
1875
|
+
micromatch.all = (str, patterns, options) => {
|
|
1876
|
+
if (typeof str != "string")
|
|
1877
|
+
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
1878
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
1879
|
+
};
|
|
1880
|
+
micromatch.capture = (glob, input, options) => {
|
|
1881
|
+
let posix = utils.isWindows(options), match = picomatch.makeRe(String(glob), { ...options, capture: !0 }).exec(posix ? utils.toPosixSlashes(input) : input);
|
|
1882
|
+
if (match)
|
|
1883
|
+
return match.slice(1).map((v) => v === void 0 ? "" : v);
|
|
1884
|
+
};
|
|
1885
|
+
micromatch.makeRe = (...args) => picomatch.makeRe(...args);
|
|
1886
|
+
micromatch.scan = (...args) => picomatch.scan(...args);
|
|
1887
|
+
micromatch.parse = (patterns, options) => {
|
|
1888
|
+
let res = [];
|
|
1889
|
+
for (let pattern of [].concat(patterns || []))
|
|
1890
|
+
for (let str of braces(String(pattern), options))
|
|
1891
|
+
res.push(picomatch.parse(str, options));
|
|
1892
|
+
return res;
|
|
1893
|
+
};
|
|
1894
|
+
micromatch.braces = (pattern, options) => {
|
|
1895
|
+
if (typeof pattern != "string") throw new TypeError("Expected a string");
|
|
1896
|
+
return options && options.nobrace === !0 || !hasBraces(pattern) ? [pattern] : braces(pattern, options);
|
|
1897
|
+
};
|
|
1898
|
+
micromatch.braceExpand = (pattern, options) => {
|
|
1899
|
+
if (typeof pattern != "string") throw new TypeError("Expected a string");
|
|
1900
|
+
return micromatch.braces(pattern, { ...options, expand: !0 });
|
|
1901
|
+
};
|
|
1902
|
+
micromatch.hasBraces = hasBraces;
|
|
1903
|
+
module.exports = micromatch;
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
|
|
1907
|
+
// ../../node_modules/fast-glob/out/utils/pattern.js
|
|
1908
|
+
var require_pattern = __commonJS({
|
|
1909
|
+
"../../node_modules/fast-glob/out/utils/pattern.js"(exports) {
|
|
1910
|
+
"use strict";
|
|
1911
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
1912
|
+
exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
|
1913
|
+
var path2 = __require("path"), globParent = require_glob_parent(), micromatch = require_micromatch(), GLOBSTAR = "**", ESCAPE_SYMBOL = "\\", COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/, REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/, REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/, GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/, BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./, DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
|
|
1914
|
+
function isStaticPattern(pattern, options = {}) {
|
|
1915
|
+
return !isDynamicPattern2(pattern, options);
|
|
1916
|
+
}
|
|
1917
|
+
exports.isStaticPattern = isStaticPattern;
|
|
1918
|
+
function isDynamicPattern2(pattern, options = {}) {
|
|
1919
|
+
return pattern === "" ? !1 : !!(options.caseSensitiveMatch === !1 || pattern.includes(ESCAPE_SYMBOL) || COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern) || options.extglob !== !1 && GLOB_EXTENSION_SYMBOLS_RE.test(pattern) || options.braceExpansion !== !1 && hasBraceExpansion(pattern));
|
|
1920
|
+
}
|
|
1921
|
+
exports.isDynamicPattern = isDynamicPattern2;
|
|
1922
|
+
function hasBraceExpansion(pattern) {
|
|
1923
|
+
let openingBraceIndex = pattern.indexOf("{");
|
|
1924
|
+
if (openingBraceIndex === -1)
|
|
1925
|
+
return !1;
|
|
1926
|
+
let closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
|
|
1927
|
+
if (closingBraceIndex === -1)
|
|
1928
|
+
return !1;
|
|
1929
|
+
let braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
|
|
1930
|
+
return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
|
|
1931
|
+
}
|
|
1932
|
+
function convertToPositivePattern(pattern) {
|
|
1933
|
+
return isNegativePattern2(pattern) ? pattern.slice(1) : pattern;
|
|
1934
|
+
}
|
|
1935
|
+
exports.convertToPositivePattern = convertToPositivePattern;
|
|
1936
|
+
function convertToNegativePattern(pattern) {
|
|
1937
|
+
return "!" + pattern;
|
|
1938
|
+
}
|
|
1939
|
+
exports.convertToNegativePattern = convertToNegativePattern;
|
|
1940
|
+
function isNegativePattern2(pattern) {
|
|
1941
|
+
return pattern.startsWith("!") && pattern[1] !== "(";
|
|
1942
|
+
}
|
|
1943
|
+
exports.isNegativePattern = isNegativePattern2;
|
|
1944
|
+
function isPositivePattern(pattern) {
|
|
1945
|
+
return !isNegativePattern2(pattern);
|
|
1946
|
+
}
|
|
1947
|
+
exports.isPositivePattern = isPositivePattern;
|
|
1948
|
+
function getNegativePatterns(patterns) {
|
|
1949
|
+
return patterns.filter(isNegativePattern2);
|
|
1950
|
+
}
|
|
1951
|
+
exports.getNegativePatterns = getNegativePatterns;
|
|
1952
|
+
function getPositivePatterns(patterns) {
|
|
1953
|
+
return patterns.filter(isPositivePattern);
|
|
1954
|
+
}
|
|
1955
|
+
exports.getPositivePatterns = getPositivePatterns;
|
|
1956
|
+
function getPatternsInsideCurrentDirectory(patterns) {
|
|
1957
|
+
return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
|
|
1958
|
+
}
|
|
1959
|
+
exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
|
|
1960
|
+
function getPatternsOutsideCurrentDirectory(patterns) {
|
|
1961
|
+
return patterns.filter(isPatternRelatedToParentDirectory);
|
|
1962
|
+
}
|
|
1963
|
+
exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
|
|
1964
|
+
function isPatternRelatedToParentDirectory(pattern) {
|
|
1965
|
+
return pattern.startsWith("..") || pattern.startsWith("./..");
|
|
1966
|
+
}
|
|
1967
|
+
exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
|
|
1968
|
+
function getBaseDirectory(pattern) {
|
|
1969
|
+
return globParent(pattern, { flipBackslashes: !1 });
|
|
1970
|
+
}
|
|
1971
|
+
exports.getBaseDirectory = getBaseDirectory;
|
|
1972
|
+
function hasGlobStar(pattern) {
|
|
1973
|
+
return pattern.includes(GLOBSTAR);
|
|
1974
|
+
}
|
|
1975
|
+
exports.hasGlobStar = hasGlobStar;
|
|
1976
|
+
function endsWithSlashGlobStar(pattern) {
|
|
1977
|
+
return pattern.endsWith("/" + GLOBSTAR);
|
|
1978
|
+
}
|
|
1979
|
+
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
1980
|
+
function isAffectDepthOfReadingPattern(pattern) {
|
|
1981
|
+
let basename = path2.basename(pattern);
|
|
1982
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
1983
|
+
}
|
|
1984
|
+
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
1985
|
+
function expandPatternsWithBraceExpansion(patterns) {
|
|
1986
|
+
return patterns.reduce((collection, pattern) => collection.concat(expandBraceExpansion(pattern)), []);
|
|
1987
|
+
}
|
|
1988
|
+
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
1989
|
+
function expandBraceExpansion(pattern) {
|
|
1990
|
+
let patterns = micromatch.braces(pattern, { expand: !0, nodupes: !0, keepEscaping: !0 });
|
|
1991
|
+
return patterns.sort((a, b) => a.length - b.length), patterns.filter((pattern2) => pattern2 !== "");
|
|
1992
|
+
}
|
|
1993
|
+
exports.expandBraceExpansion = expandBraceExpansion;
|
|
1994
|
+
function getPatternParts(pattern, options) {
|
|
1995
|
+
let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: !0 }));
|
|
1996
|
+
return parts.length === 0 && (parts = [pattern]), parts[0].startsWith("/") && (parts[0] = parts[0].slice(1), parts.unshift("")), parts;
|
|
1997
|
+
}
|
|
1998
|
+
exports.getPatternParts = getPatternParts;
|
|
1999
|
+
function makeRe(pattern, options) {
|
|
2000
|
+
return micromatch.makeRe(pattern, options);
|
|
2001
|
+
}
|
|
2002
|
+
exports.makeRe = makeRe;
|
|
2003
|
+
function convertPatternsToRe(patterns, options) {
|
|
2004
|
+
return patterns.map((pattern) => makeRe(pattern, options));
|
|
2005
|
+
}
|
|
2006
|
+
exports.convertPatternsToRe = convertPatternsToRe;
|
|
2007
|
+
function matchAny(entry, patternsRe) {
|
|
2008
|
+
return patternsRe.some((patternRe) => patternRe.test(entry));
|
|
2009
|
+
}
|
|
2010
|
+
exports.matchAny = matchAny;
|
|
2011
|
+
function removeDuplicateSlashes(pattern) {
|
|
2012
|
+
return pattern.replace(DOUBLE_SLASH_RE, "/");
|
|
2013
|
+
}
|
|
2014
|
+
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
2015
|
+
function partitionAbsoluteAndRelative(patterns) {
|
|
2016
|
+
let absolute = [], relative = [];
|
|
2017
|
+
for (let pattern of patterns)
|
|
2018
|
+
isAbsolute(pattern) ? absolute.push(pattern) : relative.push(pattern);
|
|
2019
|
+
return [absolute, relative];
|
|
2020
|
+
}
|
|
2021
|
+
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
2022
|
+
function isAbsolute(pattern) {
|
|
2023
|
+
return path2.isAbsolute(pattern);
|
|
2024
|
+
}
|
|
2025
|
+
exports.isAbsolute = isAbsolute;
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
|
|
2029
|
+
// ../../node_modules/merge2/index.js
|
|
2030
|
+
var require_merge2 = __commonJS({
|
|
2031
|
+
"../../node_modules/merge2/index.js"(exports, module) {
|
|
2032
|
+
"use strict";
|
|
2033
|
+
var Stream = __require("stream"), PassThrough = Stream.PassThrough, slice = Array.prototype.slice;
|
|
2034
|
+
module.exports = merge2;
|
|
2035
|
+
function merge2() {
|
|
2036
|
+
let streamsQueue = [], args = slice.call(arguments), merging = !1, options = args[args.length - 1];
|
|
2037
|
+
options && !Array.isArray(options) && options.pipe == null ? args.pop() : options = {};
|
|
2038
|
+
let doEnd = options.end !== !1, doPipeError = options.pipeError === !0;
|
|
2039
|
+
options.objectMode == null && (options.objectMode = !0), options.highWaterMark == null && (options.highWaterMark = 64 * 1024);
|
|
2040
|
+
let mergedStream = PassThrough(options);
|
|
2041
|
+
function addStream() {
|
|
2042
|
+
for (let i = 0, len = arguments.length; i < len; i++)
|
|
2043
|
+
streamsQueue.push(pauseStreams(arguments[i], options));
|
|
2044
|
+
return mergeStream(), this;
|
|
2045
|
+
}
|
|
2046
|
+
function mergeStream() {
|
|
2047
|
+
if (merging)
|
|
2048
|
+
return;
|
|
2049
|
+
merging = !0;
|
|
2050
|
+
let streams = streamsQueue.shift();
|
|
2051
|
+
if (!streams) {
|
|
2052
|
+
process.nextTick(endStream2);
|
|
2053
|
+
return;
|
|
2054
|
+
}
|
|
2055
|
+
Array.isArray(streams) || (streams = [streams]);
|
|
2056
|
+
let pipesCount = streams.length + 1;
|
|
2057
|
+
function next() {
|
|
2058
|
+
--pipesCount > 0 || (merging = !1, mergeStream());
|
|
2059
|
+
}
|
|
2060
|
+
function pipe(stream) {
|
|
2061
|
+
function onend() {
|
|
2062
|
+
stream.removeListener("merge2UnpipeEnd", onend), stream.removeListener("end", onend), doPipeError && stream.removeListener("error", onerror), next();
|
|
2063
|
+
}
|
|
2064
|
+
function onerror(err) {
|
|
2065
|
+
mergedStream.emit("error", err);
|
|
2066
|
+
}
|
|
2067
|
+
if (stream._readableState.endEmitted)
|
|
2068
|
+
return next();
|
|
2069
|
+
stream.on("merge2UnpipeEnd", onend), stream.on("end", onend), doPipeError && stream.on("error", onerror), stream.pipe(mergedStream, { end: !1 }), stream.resume();
|
|
2070
|
+
}
|
|
2071
|
+
for (let i = 0; i < streams.length; i++)
|
|
2072
|
+
pipe(streams[i]);
|
|
2073
|
+
next();
|
|
2074
|
+
}
|
|
2075
|
+
function endStream2() {
|
|
2076
|
+
merging = !1, mergedStream.emit("queueDrain"), doEnd && mergedStream.end();
|
|
2077
|
+
}
|
|
2078
|
+
return mergedStream.setMaxListeners(0), mergedStream.add = addStream, mergedStream.on("unpipe", function(stream) {
|
|
2079
|
+
stream.emit("merge2UnpipeEnd");
|
|
2080
|
+
}), args.length && addStream.apply(null, args), mergedStream;
|
|
2081
|
+
}
|
|
2082
|
+
function pauseStreams(streams, options) {
|
|
2083
|
+
if (Array.isArray(streams))
|
|
2084
|
+
for (let i = 0, len = streams.length; i < len; i++)
|
|
2085
|
+
streams[i] = pauseStreams(streams[i], options);
|
|
2086
|
+
else {
|
|
2087
|
+
if (!streams._readableState && streams.pipe && (streams = streams.pipe(PassThrough(options))), !streams._readableState || !streams.pause || !streams.pipe)
|
|
2088
|
+
throw new Error("Only readable stream can be merged.");
|
|
2089
|
+
streams.pause();
|
|
2090
|
+
}
|
|
2091
|
+
return streams;
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
});
|
|
2095
|
+
|
|
2096
|
+
// ../../node_modules/fast-glob/out/utils/stream.js
|
|
2097
|
+
var require_stream = __commonJS({
|
|
2098
|
+
"../../node_modules/fast-glob/out/utils/stream.js"(exports) {
|
|
2099
|
+
"use strict";
|
|
2100
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2101
|
+
exports.merge = void 0;
|
|
2102
|
+
var merge2 = require_merge2();
|
|
2103
|
+
function merge(streams) {
|
|
2104
|
+
let mergedStream = merge2(streams);
|
|
2105
|
+
return streams.forEach((stream) => {
|
|
2106
|
+
stream.once("error", (error) => mergedStream.emit("error", error));
|
|
2107
|
+
}), mergedStream.once("close", () => propagateCloseEventToSources(streams)), mergedStream.once("end", () => propagateCloseEventToSources(streams)), mergedStream;
|
|
2108
|
+
}
|
|
2109
|
+
exports.merge = merge;
|
|
2110
|
+
function propagateCloseEventToSources(streams) {
|
|
2111
|
+
streams.forEach((stream) => stream.emit("close"));
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
});
|
|
2115
|
+
|
|
2116
|
+
// ../../node_modules/fast-glob/out/utils/string.js
|
|
2117
|
+
var require_string = __commonJS({
|
|
2118
|
+
"../../node_modules/fast-glob/out/utils/string.js"(exports) {
|
|
2119
|
+
"use strict";
|
|
2120
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2121
|
+
exports.isEmpty = exports.isString = void 0;
|
|
2122
|
+
function isString(input) {
|
|
2123
|
+
return typeof input == "string";
|
|
2124
|
+
}
|
|
2125
|
+
exports.isString = isString;
|
|
2126
|
+
function isEmpty(input) {
|
|
2127
|
+
return input === "";
|
|
2128
|
+
}
|
|
2129
|
+
exports.isEmpty = isEmpty;
|
|
2130
|
+
}
|
|
2131
|
+
});
|
|
2132
|
+
|
|
2133
|
+
// ../../node_modules/fast-glob/out/utils/index.js
|
|
2134
|
+
var require_utils3 = __commonJS({
|
|
2135
|
+
"../../node_modules/fast-glob/out/utils/index.js"(exports) {
|
|
2136
|
+
"use strict";
|
|
2137
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2138
|
+
exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
|
|
2139
|
+
var array = require_array();
|
|
2140
|
+
exports.array = array;
|
|
2141
|
+
var errno = require_errno();
|
|
2142
|
+
exports.errno = errno;
|
|
2143
|
+
var fs4 = require_fs();
|
|
2144
|
+
exports.fs = fs4;
|
|
2145
|
+
var path2 = require_path();
|
|
2146
|
+
exports.path = path2;
|
|
2147
|
+
var pattern = require_pattern();
|
|
2148
|
+
exports.pattern = pattern;
|
|
2149
|
+
var stream = require_stream();
|
|
2150
|
+
exports.stream = stream;
|
|
2151
|
+
var string = require_string();
|
|
2152
|
+
exports.string = string;
|
|
2153
|
+
}
|
|
2154
|
+
});
|
|
2155
|
+
|
|
2156
|
+
// ../../node_modules/fast-glob/out/managers/tasks.js
|
|
2157
|
+
var require_tasks = __commonJS({
|
|
2158
|
+
"../../node_modules/fast-glob/out/managers/tasks.js"(exports) {
|
|
2159
|
+
"use strict";
|
|
2160
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2161
|
+
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
2162
|
+
var utils = require_utils3();
|
|
2163
|
+
function generate(input, settings) {
|
|
2164
|
+
let patterns = processPatterns(input, settings), ignore = processPatterns(settings.ignore, settings), positivePatterns = getPositivePatterns(patterns), negativePatterns = getNegativePatternsAsPositive(patterns, ignore), staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)), dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)), staticTasks = convertPatternsToTasks(
|
|
2165
|
+
staticPatterns,
|
|
2166
|
+
negativePatterns,
|
|
2167
|
+
/* dynamic */
|
|
2168
|
+
!1
|
|
2169
|
+
), dynamicTasks = convertPatternsToTasks(
|
|
2170
|
+
dynamicPatterns,
|
|
2171
|
+
negativePatterns,
|
|
2172
|
+
/* dynamic */
|
|
2173
|
+
!0
|
|
2174
|
+
);
|
|
2175
|
+
return staticTasks.concat(dynamicTasks);
|
|
2176
|
+
}
|
|
2177
|
+
exports.generate = generate;
|
|
2178
|
+
function processPatterns(input, settings) {
|
|
2179
|
+
let patterns = input;
|
|
2180
|
+
return settings.braceExpansion && (patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns)), settings.baseNameMatch && (patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`)), patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
2181
|
+
}
|
|
2182
|
+
function convertPatternsToTasks(positive, negative, dynamic) {
|
|
2183
|
+
let tasks = [], patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive), patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive), outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory), insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
|
|
2184
|
+
return tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)), "." in insideCurrentDirectoryGroup ? tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)) : tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)), tasks;
|
|
2185
|
+
}
|
|
2186
|
+
exports.convertPatternsToTasks = convertPatternsToTasks;
|
|
2187
|
+
function getPositivePatterns(patterns) {
|
|
2188
|
+
return utils.pattern.getPositivePatterns(patterns);
|
|
2189
|
+
}
|
|
2190
|
+
exports.getPositivePatterns = getPositivePatterns;
|
|
2191
|
+
function getNegativePatternsAsPositive(patterns, ignore) {
|
|
2192
|
+
return utils.pattern.getNegativePatterns(patterns).concat(ignore).map(utils.pattern.convertToPositivePattern);
|
|
2193
|
+
}
|
|
2194
|
+
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
2195
|
+
function groupPatternsByBaseDirectory(patterns) {
|
|
2196
|
+
let group = {};
|
|
2197
|
+
return patterns.reduce((collection, pattern) => {
|
|
2198
|
+
let base = utils.pattern.getBaseDirectory(pattern);
|
|
2199
|
+
return base in collection ? collection[base].push(pattern) : collection[base] = [pattern], collection;
|
|
2200
|
+
}, group);
|
|
2201
|
+
}
|
|
2202
|
+
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
2203
|
+
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
2204
|
+
return Object.keys(positive).map((base) => convertPatternGroupToTask(base, positive[base], negative, dynamic));
|
|
2205
|
+
}
|
|
2206
|
+
exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
|
2207
|
+
function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
|
2208
|
+
return {
|
|
2209
|
+
dynamic,
|
|
2210
|
+
positive,
|
|
2211
|
+
negative,
|
|
2212
|
+
base,
|
|
2213
|
+
patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
exports.convertPatternGroupToTask = convertPatternGroupToTask;
|
|
2217
|
+
}
|
|
2218
|
+
});
|
|
2219
|
+
|
|
2220
|
+
// ../../node_modules/@nodelib/fs.stat/out/providers/async.js
|
|
2221
|
+
var require_async = __commonJS({
|
|
2222
|
+
"../../node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) {
|
|
2223
|
+
"use strict";
|
|
2224
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2225
|
+
exports.read = void 0;
|
|
2226
|
+
function read(path2, settings, callback) {
|
|
2227
|
+
settings.fs.lstat(path2, (lstatError, lstat) => {
|
|
2228
|
+
if (lstatError !== null) {
|
|
2229
|
+
callFailureCallback(callback, lstatError);
|
|
2230
|
+
return;
|
|
2231
|
+
}
|
|
2232
|
+
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
|
2233
|
+
callSuccessCallback(callback, lstat);
|
|
2234
|
+
return;
|
|
2235
|
+
}
|
|
2236
|
+
settings.fs.stat(path2, (statError, stat) => {
|
|
2237
|
+
if (statError !== null) {
|
|
2238
|
+
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
2239
|
+
callFailureCallback(callback, statError);
|
|
2240
|
+
return;
|
|
2241
|
+
}
|
|
2242
|
+
callSuccessCallback(callback, lstat);
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
settings.markSymbolicLink && (stat.isSymbolicLink = () => !0), callSuccessCallback(callback, stat);
|
|
2246
|
+
});
|
|
2247
|
+
});
|
|
2248
|
+
}
|
|
2249
|
+
exports.read = read;
|
|
2250
|
+
function callFailureCallback(callback, error) {
|
|
2251
|
+
callback(error);
|
|
2252
|
+
}
|
|
2253
|
+
function callSuccessCallback(callback, result) {
|
|
2254
|
+
callback(null, result);
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
});
|
|
2258
|
+
|
|
2259
|
+
// ../../node_modules/@nodelib/fs.stat/out/providers/sync.js
|
|
2260
|
+
var require_sync = __commonJS({
|
|
2261
|
+
"../../node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) {
|
|
2262
|
+
"use strict";
|
|
2263
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2264
|
+
exports.read = void 0;
|
|
2265
|
+
function read(path2, settings) {
|
|
2266
|
+
let lstat = settings.fs.lstatSync(path2);
|
|
2267
|
+
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink)
|
|
2268
|
+
return lstat;
|
|
2269
|
+
try {
|
|
2270
|
+
let stat = settings.fs.statSync(path2);
|
|
2271
|
+
return settings.markSymbolicLink && (stat.isSymbolicLink = () => !0), stat;
|
|
2272
|
+
} catch (error) {
|
|
2273
|
+
if (!settings.throwErrorOnBrokenSymbolicLink)
|
|
2274
|
+
return lstat;
|
|
2275
|
+
throw error;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
exports.read = read;
|
|
2279
|
+
}
|
|
2280
|
+
});
|
|
2281
|
+
|
|
2282
|
+
// ../../node_modules/@nodelib/fs.stat/out/adapters/fs.js
|
|
2283
|
+
var require_fs2 = __commonJS({
|
|
2284
|
+
"../../node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) {
|
|
2285
|
+
"use strict";
|
|
2286
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2287
|
+
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
2288
|
+
var fs4 = __require("fs");
|
|
2289
|
+
exports.FILE_SYSTEM_ADAPTER = {
|
|
2290
|
+
lstat: fs4.lstat,
|
|
2291
|
+
stat: fs4.stat,
|
|
2292
|
+
lstatSync: fs4.lstatSync,
|
|
2293
|
+
statSync: fs4.statSync
|
|
2294
|
+
};
|
|
2295
|
+
function createFileSystemAdapter(fsMethods) {
|
|
2296
|
+
return fsMethods === void 0 ? exports.FILE_SYSTEM_ADAPTER : Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
|
2297
|
+
}
|
|
2298
|
+
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
2299
|
+
}
|
|
2300
|
+
});
|
|
2301
|
+
|
|
2302
|
+
// ../../node_modules/@nodelib/fs.stat/out/settings.js
|
|
2303
|
+
var require_settings = __commonJS({
|
|
2304
|
+
"../../node_modules/@nodelib/fs.stat/out/settings.js"(exports) {
|
|
2305
|
+
"use strict";
|
|
2306
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2307
|
+
var fs4 = require_fs2(), Settings = class {
|
|
2308
|
+
constructor(_options = {}) {
|
|
2309
|
+
this._options = _options, this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, !0), this.fs = fs4.createFileSystemAdapter(this._options.fs), this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, !1), this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, !0);
|
|
2310
|
+
}
|
|
2311
|
+
_getValue(option, value) {
|
|
2312
|
+
return option ?? value;
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
exports.default = Settings;
|
|
2316
|
+
}
|
|
2317
|
+
});
|
|
2318
|
+
|
|
2319
|
+
// ../../node_modules/@nodelib/fs.stat/out/index.js
|
|
2320
|
+
var require_out = __commonJS({
|
|
2321
|
+
"../../node_modules/@nodelib/fs.stat/out/index.js"(exports) {
|
|
2322
|
+
"use strict";
|
|
2323
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2324
|
+
exports.statSync = exports.stat = exports.Settings = void 0;
|
|
2325
|
+
var async = require_async(), sync = require_sync(), settings_1 = require_settings();
|
|
2326
|
+
exports.Settings = settings_1.default;
|
|
2327
|
+
function stat(path2, optionsOrSettingsOrCallback, callback) {
|
|
2328
|
+
if (typeof optionsOrSettingsOrCallback == "function") {
|
|
2329
|
+
async.read(path2, getSettings(), optionsOrSettingsOrCallback);
|
|
2330
|
+
return;
|
|
2331
|
+
}
|
|
2332
|
+
async.read(path2, getSettings(optionsOrSettingsOrCallback), callback);
|
|
2333
|
+
}
|
|
2334
|
+
exports.stat = stat;
|
|
2335
|
+
function statSync(path2, optionsOrSettings) {
|
|
2336
|
+
let settings = getSettings(optionsOrSettings);
|
|
2337
|
+
return sync.read(path2, settings);
|
|
2338
|
+
}
|
|
2339
|
+
exports.statSync = statSync;
|
|
2340
|
+
function getSettings(settingsOrOptions = {}) {
|
|
2341
|
+
return settingsOrOptions instanceof settings_1.default ? settingsOrOptions : new settings_1.default(settingsOrOptions);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
});
|
|
2345
|
+
|
|
2346
|
+
// ../../node_modules/queue-microtask/index.js
|
|
2347
|
+
var require_queue_microtask = __commonJS({
|
|
2348
|
+
"../../node_modules/queue-microtask/index.js"(exports, module) {
|
|
2349
|
+
var promise;
|
|
2350
|
+
module.exports = typeof queueMicrotask == "function" ? queueMicrotask.bind(typeof window < "u" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
|
|
2351
|
+
throw err;
|
|
2352
|
+
}, 0));
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2355
|
+
|
|
2356
|
+
// ../../node_modules/run-parallel/index.js
|
|
2357
|
+
var require_run_parallel = __commonJS({
|
|
2358
|
+
"../../node_modules/run-parallel/index.js"(exports, module) {
|
|
2359
|
+
module.exports = runParallel;
|
|
2360
|
+
var queueMicrotask2 = require_queue_microtask();
|
|
2361
|
+
function runParallel(tasks, cb) {
|
|
2362
|
+
let results, pending, keys, isSync = !0;
|
|
2363
|
+
Array.isArray(tasks) ? (results = [], pending = tasks.length) : (keys = Object.keys(tasks), results = {}, pending = keys.length);
|
|
2364
|
+
function done(err) {
|
|
2365
|
+
function end() {
|
|
2366
|
+
cb && cb(err, results), cb = null;
|
|
2367
|
+
}
|
|
2368
|
+
isSync ? queueMicrotask2(end) : end();
|
|
2369
|
+
}
|
|
2370
|
+
function each(i, err, result) {
|
|
2371
|
+
results[i] = result, (--pending === 0 || err) && done(err);
|
|
2372
|
+
}
|
|
2373
|
+
pending ? keys ? keys.forEach(function(key) {
|
|
2374
|
+
tasks[key](function(err, result) {
|
|
2375
|
+
each(key, err, result);
|
|
2376
|
+
});
|
|
2377
|
+
}) : tasks.forEach(function(task, i) {
|
|
2378
|
+
task(function(err, result) {
|
|
2379
|
+
each(i, err, result);
|
|
2380
|
+
});
|
|
2381
|
+
}) : done(null), isSync = !1;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
|
|
2386
|
+
// ../../node_modules/@nodelib/fs.scandir/out/constants.js
|
|
2387
|
+
var require_constants3 = __commonJS({
|
|
2388
|
+
"../../node_modules/@nodelib/fs.scandir/out/constants.js"(exports) {
|
|
2389
|
+
"use strict";
|
|
2390
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2391
|
+
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
|
|
2392
|
+
var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
|
|
2393
|
+
if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0)
|
|
2394
|
+
throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
|
|
2395
|
+
var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10), MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10), SUPPORTED_MAJOR_VERSION = 10, SUPPORTED_MINOR_VERSION = 10, IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION, IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
|
|
2396
|
+
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
|
|
2397
|
+
}
|
|
2398
|
+
});
|
|
2399
|
+
|
|
2400
|
+
// ../../node_modules/@nodelib/fs.scandir/out/utils/fs.js
|
|
2401
|
+
var require_fs3 = __commonJS({
|
|
2402
|
+
"../../node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) {
|
|
2403
|
+
"use strict";
|
|
2404
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2405
|
+
exports.createDirentFromStats = void 0;
|
|
2406
|
+
var DirentFromStats = class {
|
|
2407
|
+
constructor(name, stats) {
|
|
2408
|
+
this.name = name, this.isBlockDevice = stats.isBlockDevice.bind(stats), this.isCharacterDevice = stats.isCharacterDevice.bind(stats), this.isDirectory = stats.isDirectory.bind(stats), this.isFIFO = stats.isFIFO.bind(stats), this.isFile = stats.isFile.bind(stats), this.isSocket = stats.isSocket.bind(stats), this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
function createDirentFromStats(name, stats) {
|
|
2412
|
+
return new DirentFromStats(name, stats);
|
|
2413
|
+
}
|
|
2414
|
+
exports.createDirentFromStats = createDirentFromStats;
|
|
2415
|
+
}
|
|
2416
|
+
});
|
|
2417
|
+
|
|
2418
|
+
// ../../node_modules/@nodelib/fs.scandir/out/utils/index.js
|
|
2419
|
+
var require_utils4 = __commonJS({
|
|
2420
|
+
"../../node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) {
|
|
2421
|
+
"use strict";
|
|
2422
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2423
|
+
exports.fs = void 0;
|
|
2424
|
+
var fs4 = require_fs3();
|
|
2425
|
+
exports.fs = fs4;
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
|
|
2429
|
+
// ../../node_modules/@nodelib/fs.scandir/out/providers/common.js
|
|
2430
|
+
var require_common = __commonJS({
|
|
2431
|
+
"../../node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) {
|
|
2432
|
+
"use strict";
|
|
2433
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2434
|
+
exports.joinPathSegments = void 0;
|
|
2435
|
+
function joinPathSegments(a, b, separator) {
|
|
2436
|
+
return a.endsWith(separator) ? a + b : a + separator + b;
|
|
2437
|
+
}
|
|
2438
|
+
exports.joinPathSegments = joinPathSegments;
|
|
2439
|
+
}
|
|
2440
|
+
});
|
|
2441
|
+
|
|
2442
|
+
// ../../node_modules/@nodelib/fs.scandir/out/providers/async.js
|
|
2443
|
+
var require_async2 = __commonJS({
|
|
2444
|
+
"../../node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) {
|
|
2445
|
+
"use strict";
|
|
2446
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2447
|
+
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
|
|
2448
|
+
var fsStat = require_out(), rpl = require_run_parallel(), constants_1 = require_constants3(), utils = require_utils4(), common = require_common();
|
|
2449
|
+
function read(directory, settings, callback) {
|
|
2450
|
+
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
2451
|
+
readdirWithFileTypes(directory, settings, callback);
|
|
2452
|
+
return;
|
|
2453
|
+
}
|
|
2454
|
+
readdir(directory, settings, callback);
|
|
2455
|
+
}
|
|
2456
|
+
exports.read = read;
|
|
2457
|
+
function readdirWithFileTypes(directory, settings, callback) {
|
|
2458
|
+
settings.fs.readdir(directory, { withFileTypes: !0 }, (readdirError, dirents) => {
|
|
2459
|
+
if (readdirError !== null) {
|
|
2460
|
+
callFailureCallback(callback, readdirError);
|
|
2461
|
+
return;
|
|
2462
|
+
}
|
|
2463
|
+
let entries = dirents.map((dirent) => ({
|
|
2464
|
+
dirent,
|
|
2465
|
+
name: dirent.name,
|
|
2466
|
+
path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
|
2467
|
+
}));
|
|
2468
|
+
if (!settings.followSymbolicLinks) {
|
|
2469
|
+
callSuccessCallback(callback, entries);
|
|
2470
|
+
return;
|
|
2471
|
+
}
|
|
2472
|
+
let tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
|
|
2473
|
+
rpl(tasks, (rplError, rplEntries) => {
|
|
2474
|
+
if (rplError !== null) {
|
|
2475
|
+
callFailureCallback(callback, rplError);
|
|
2476
|
+
return;
|
|
2477
|
+
}
|
|
2478
|
+
callSuccessCallback(callback, rplEntries);
|
|
2479
|
+
});
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
2483
|
+
function makeRplTaskEntry(entry, settings) {
|
|
2484
|
+
return (done) => {
|
|
2485
|
+
if (!entry.dirent.isSymbolicLink()) {
|
|
2486
|
+
done(null, entry);
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
settings.fs.stat(entry.path, (statError, stats) => {
|
|
2490
|
+
if (statError !== null) {
|
|
2491
|
+
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
2492
|
+
done(statError);
|
|
2493
|
+
return;
|
|
2494
|
+
}
|
|
2495
|
+
done(null, entry);
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2498
|
+
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats), done(null, entry);
|
|
2499
|
+
});
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
function readdir(directory, settings, callback) {
|
|
2503
|
+
settings.fs.readdir(directory, (readdirError, names) => {
|
|
2504
|
+
if (readdirError !== null) {
|
|
2505
|
+
callFailureCallback(callback, readdirError);
|
|
2506
|
+
return;
|
|
2507
|
+
}
|
|
2508
|
+
let tasks = names.map((name) => {
|
|
2509
|
+
let path2 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
2510
|
+
return (done) => {
|
|
2511
|
+
fsStat.stat(path2, settings.fsStatSettings, (error, stats) => {
|
|
2512
|
+
if (error !== null) {
|
|
2513
|
+
done(error);
|
|
2514
|
+
return;
|
|
2515
|
+
}
|
|
2516
|
+
let entry = {
|
|
2517
|
+
name,
|
|
2518
|
+
path: path2,
|
|
2519
|
+
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
2520
|
+
};
|
|
2521
|
+
settings.stats && (entry.stats = stats), done(null, entry);
|
|
2522
|
+
});
|
|
2523
|
+
};
|
|
2524
|
+
});
|
|
2525
|
+
rpl(tasks, (rplError, entries) => {
|
|
2526
|
+
if (rplError !== null) {
|
|
2527
|
+
callFailureCallback(callback, rplError);
|
|
2528
|
+
return;
|
|
2529
|
+
}
|
|
2530
|
+
callSuccessCallback(callback, entries);
|
|
2531
|
+
});
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
2534
|
+
exports.readdir = readdir;
|
|
2535
|
+
function callFailureCallback(callback, error) {
|
|
2536
|
+
callback(error);
|
|
2537
|
+
}
|
|
2538
|
+
function callSuccessCallback(callback, result) {
|
|
2539
|
+
callback(null, result);
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
});
|
|
2543
|
+
|
|
2544
|
+
// ../../node_modules/@nodelib/fs.scandir/out/providers/sync.js
|
|
2545
|
+
var require_sync2 = __commonJS({
|
|
2546
|
+
"../../node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) {
|
|
2547
|
+
"use strict";
|
|
2548
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2549
|
+
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
|
|
2550
|
+
var fsStat = require_out(), constants_1 = require_constants3(), utils = require_utils4(), common = require_common();
|
|
2551
|
+
function read(directory, settings) {
|
|
2552
|
+
return !settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES ? readdirWithFileTypes(directory, settings) : readdir(directory, settings);
|
|
2553
|
+
}
|
|
2554
|
+
exports.read = read;
|
|
2555
|
+
function readdirWithFileTypes(directory, settings) {
|
|
2556
|
+
return settings.fs.readdirSync(directory, { withFileTypes: !0 }).map((dirent) => {
|
|
2557
|
+
let entry = {
|
|
2558
|
+
dirent,
|
|
2559
|
+
name: dirent.name,
|
|
2560
|
+
path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
|
2561
|
+
};
|
|
2562
|
+
if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks)
|
|
2563
|
+
try {
|
|
2564
|
+
let stats = settings.fs.statSync(entry.path);
|
|
2565
|
+
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
2566
|
+
} catch (error) {
|
|
2567
|
+
if (settings.throwErrorOnBrokenSymbolicLink)
|
|
2568
|
+
throw error;
|
|
2569
|
+
}
|
|
2570
|
+
return entry;
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
2574
|
+
function readdir(directory, settings) {
|
|
2575
|
+
return settings.fs.readdirSync(directory).map((name) => {
|
|
2576
|
+
let entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator), stats = fsStat.statSync(entryPath, settings.fsStatSettings), entry = {
|
|
2577
|
+
name,
|
|
2578
|
+
path: entryPath,
|
|
2579
|
+
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
2580
|
+
};
|
|
2581
|
+
return settings.stats && (entry.stats = stats), entry;
|
|
2582
|
+
});
|
|
2583
|
+
}
|
|
2584
|
+
exports.readdir = readdir;
|
|
2585
|
+
}
|
|
2586
|
+
});
|
|
2587
|
+
|
|
2588
|
+
// ../../node_modules/@nodelib/fs.scandir/out/adapters/fs.js
|
|
2589
|
+
var require_fs4 = __commonJS({
|
|
2590
|
+
"../../node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) {
|
|
2591
|
+
"use strict";
|
|
2592
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2593
|
+
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
2594
|
+
var fs4 = __require("fs");
|
|
2595
|
+
exports.FILE_SYSTEM_ADAPTER = {
|
|
2596
|
+
lstat: fs4.lstat,
|
|
2597
|
+
stat: fs4.stat,
|
|
2598
|
+
lstatSync: fs4.lstatSync,
|
|
2599
|
+
statSync: fs4.statSync,
|
|
2600
|
+
readdir: fs4.readdir,
|
|
2601
|
+
readdirSync: fs4.readdirSync
|
|
2602
|
+
};
|
|
2603
|
+
function createFileSystemAdapter(fsMethods) {
|
|
2604
|
+
return fsMethods === void 0 ? exports.FILE_SYSTEM_ADAPTER : Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
|
2605
|
+
}
|
|
2606
|
+
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
2607
|
+
}
|
|
2608
|
+
});
|
|
2609
|
+
|
|
2610
|
+
// ../../node_modules/@nodelib/fs.scandir/out/settings.js
|
|
2611
|
+
var require_settings2 = __commonJS({
|
|
2612
|
+
"../../node_modules/@nodelib/fs.scandir/out/settings.js"(exports) {
|
|
2613
|
+
"use strict";
|
|
2614
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2615
|
+
var path2 = __require("path"), fsStat = require_out(), fs4 = require_fs4(), Settings = class {
|
|
2616
|
+
constructor(_options = {}) {
|
|
2617
|
+
this._options = _options, this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, !1), this.fs = fs4.createFileSystemAdapter(this._options.fs), this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path2.sep), this.stats = this._getValue(this._options.stats, !1), this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, !0), this.fsStatSettings = new fsStat.Settings({
|
|
2618
|
+
followSymbolicLink: this.followSymbolicLinks,
|
|
2619
|
+
fs: this.fs,
|
|
2620
|
+
throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
|
|
2621
|
+
});
|
|
2622
|
+
}
|
|
2623
|
+
_getValue(option, value) {
|
|
2624
|
+
return option ?? value;
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2627
|
+
exports.default = Settings;
|
|
2628
|
+
}
|
|
2629
|
+
});
|
|
2630
|
+
|
|
2631
|
+
// ../../node_modules/@nodelib/fs.scandir/out/index.js
|
|
2632
|
+
var require_out2 = __commonJS({
|
|
2633
|
+
"../../node_modules/@nodelib/fs.scandir/out/index.js"(exports) {
|
|
2634
|
+
"use strict";
|
|
2635
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2636
|
+
exports.Settings = exports.scandirSync = exports.scandir = void 0;
|
|
2637
|
+
var async = require_async2(), sync = require_sync2(), settings_1 = require_settings2();
|
|
2638
|
+
exports.Settings = settings_1.default;
|
|
2639
|
+
function scandir(path2, optionsOrSettingsOrCallback, callback) {
|
|
2640
|
+
if (typeof optionsOrSettingsOrCallback == "function") {
|
|
2641
|
+
async.read(path2, getSettings(), optionsOrSettingsOrCallback);
|
|
2642
|
+
return;
|
|
2643
|
+
}
|
|
2644
|
+
async.read(path2, getSettings(optionsOrSettingsOrCallback), callback);
|
|
2645
|
+
}
|
|
2646
|
+
exports.scandir = scandir;
|
|
2647
|
+
function scandirSync(path2, optionsOrSettings) {
|
|
2648
|
+
let settings = getSettings(optionsOrSettings);
|
|
2649
|
+
return sync.read(path2, settings);
|
|
2650
|
+
}
|
|
2651
|
+
exports.scandirSync = scandirSync;
|
|
2652
|
+
function getSettings(settingsOrOptions = {}) {
|
|
2653
|
+
return settingsOrOptions instanceof settings_1.default ? settingsOrOptions : new settings_1.default(settingsOrOptions);
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
});
|
|
2657
|
+
|
|
2658
|
+
// ../../node_modules/reusify/reusify.js
|
|
2659
|
+
var require_reusify = __commonJS({
|
|
2660
|
+
"../../node_modules/reusify/reusify.js"(exports, module) {
|
|
2661
|
+
"use strict";
|
|
2662
|
+
function reusify(Constructor) {
|
|
2663
|
+
var head = new Constructor(), tail = head;
|
|
2664
|
+
function get() {
|
|
2665
|
+
var current = head;
|
|
2666
|
+
return current.next ? head = current.next : (head = new Constructor(), tail = head), current.next = null, current;
|
|
2667
|
+
}
|
|
2668
|
+
function release(obj) {
|
|
2669
|
+
tail.next = obj, tail = obj;
|
|
2670
|
+
}
|
|
2671
|
+
return {
|
|
2672
|
+
get,
|
|
2673
|
+
release
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
module.exports = reusify;
|
|
2677
|
+
}
|
|
2678
|
+
});
|
|
2679
|
+
|
|
2680
|
+
// ../../node_modules/fastq/queue.js
|
|
2681
|
+
var require_queue = __commonJS({
|
|
2682
|
+
"../../node_modules/fastq/queue.js"(exports, module) {
|
|
2683
|
+
"use strict";
|
|
2684
|
+
var reusify = require_reusify();
|
|
2685
|
+
function fastqueue(context, worker, _concurrency) {
|
|
2686
|
+
if (typeof context == "function" && (_concurrency = worker, worker = context, context = null), !(_concurrency >= 1))
|
|
2687
|
+
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
2688
|
+
var cache = reusify(Task), queueHead = null, queueTail = null, _running = 0, errorHandler = null, self = {
|
|
2689
|
+
push,
|
|
2690
|
+
drain: noop2,
|
|
2691
|
+
saturated: noop2,
|
|
2692
|
+
pause,
|
|
2693
|
+
paused: !1,
|
|
2694
|
+
get concurrency() {
|
|
2695
|
+
return _concurrency;
|
|
2696
|
+
},
|
|
2697
|
+
set concurrency(value) {
|
|
2698
|
+
if (!(value >= 1))
|
|
2699
|
+
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
2700
|
+
if (_concurrency = value, !self.paused)
|
|
2701
|
+
for (; queueHead && _running < _concurrency; )
|
|
2702
|
+
_running++, release();
|
|
2703
|
+
},
|
|
2704
|
+
running,
|
|
2705
|
+
resume,
|
|
2706
|
+
idle,
|
|
2707
|
+
length,
|
|
2708
|
+
getQueue,
|
|
2709
|
+
unshift,
|
|
2710
|
+
empty: noop2,
|
|
2711
|
+
kill,
|
|
2712
|
+
killAndDrain,
|
|
2713
|
+
error
|
|
2714
|
+
};
|
|
2715
|
+
return self;
|
|
2716
|
+
function running() {
|
|
2717
|
+
return _running;
|
|
2718
|
+
}
|
|
2719
|
+
function pause() {
|
|
2720
|
+
self.paused = !0;
|
|
2721
|
+
}
|
|
2722
|
+
function length() {
|
|
2723
|
+
for (var current = queueHead, counter = 0; current; )
|
|
2724
|
+
current = current.next, counter++;
|
|
2725
|
+
return counter;
|
|
2726
|
+
}
|
|
2727
|
+
function getQueue() {
|
|
2728
|
+
for (var current = queueHead, tasks = []; current; )
|
|
2729
|
+
tasks.push(current.value), current = current.next;
|
|
2730
|
+
return tasks;
|
|
2731
|
+
}
|
|
2732
|
+
function resume() {
|
|
2733
|
+
if (self.paused) {
|
|
2734
|
+
if (self.paused = !1, queueHead === null) {
|
|
2735
|
+
_running++, release();
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2738
|
+
for (; queueHead && _running < _concurrency; )
|
|
2739
|
+
_running++, release();
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
function idle() {
|
|
2743
|
+
return _running === 0 && self.length() === 0;
|
|
2744
|
+
}
|
|
2745
|
+
function push(value, done) {
|
|
2746
|
+
var current = cache.get();
|
|
2747
|
+
current.context = context, current.release = release, current.value = value, current.callback = done || noop2, current.errorHandler = errorHandler, _running >= _concurrency || self.paused ? queueTail ? (queueTail.next = current, queueTail = current) : (queueHead = current, queueTail = current, self.saturated()) : (_running++, worker.call(context, current.value, current.worked));
|
|
2748
|
+
}
|
|
2749
|
+
function unshift(value, done) {
|
|
2750
|
+
var current = cache.get();
|
|
2751
|
+
current.context = context, current.release = release, current.value = value, current.callback = done || noop2, current.errorHandler = errorHandler, _running >= _concurrency || self.paused ? queueHead ? (current.next = queueHead, queueHead = current) : (queueHead = current, queueTail = current, self.saturated()) : (_running++, worker.call(context, current.value, current.worked));
|
|
2752
|
+
}
|
|
2753
|
+
function release(holder) {
|
|
2754
|
+
holder && cache.release(holder);
|
|
2755
|
+
var next = queueHead;
|
|
2756
|
+
next && _running <= _concurrency ? self.paused ? _running-- : (queueTail === queueHead && (queueTail = null), queueHead = next.next, next.next = null, worker.call(context, next.value, next.worked), queueTail === null && self.empty()) : --_running === 0 && self.drain();
|
|
2757
|
+
}
|
|
2758
|
+
function kill() {
|
|
2759
|
+
queueHead = null, queueTail = null, self.drain = noop2;
|
|
2760
|
+
}
|
|
2761
|
+
function killAndDrain() {
|
|
2762
|
+
queueHead = null, queueTail = null, self.drain(), self.drain = noop2;
|
|
2763
|
+
}
|
|
2764
|
+
function error(handler) {
|
|
2765
|
+
errorHandler = handler;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
function noop2() {
|
|
2769
|
+
}
|
|
2770
|
+
function Task() {
|
|
2771
|
+
this.value = null, this.callback = noop2, this.next = null, this.release = noop2, this.context = null, this.errorHandler = null;
|
|
2772
|
+
var self = this;
|
|
2773
|
+
this.worked = function(err, result) {
|
|
2774
|
+
var callback = self.callback, errorHandler = self.errorHandler, val = self.value;
|
|
2775
|
+
self.value = null, self.callback = noop2, self.errorHandler && errorHandler(err, val), callback.call(self.context, err, result), self.release(self);
|
|
2776
|
+
};
|
|
2777
|
+
}
|
|
2778
|
+
function queueAsPromised(context, worker, _concurrency) {
|
|
2779
|
+
typeof context == "function" && (_concurrency = worker, worker = context, context = null);
|
|
2780
|
+
function asyncWrapper(arg, cb) {
|
|
2781
|
+
worker.call(this, arg).then(function(res) {
|
|
2782
|
+
cb(null, res);
|
|
2783
|
+
}, cb);
|
|
2784
|
+
}
|
|
2785
|
+
var queue = fastqueue(context, asyncWrapper, _concurrency), pushCb = queue.push, unshiftCb = queue.unshift;
|
|
2786
|
+
return queue.push = push, queue.unshift = unshift, queue.drained = drained, queue;
|
|
2787
|
+
function push(value) {
|
|
2788
|
+
var p = new Promise(function(resolve, reject) {
|
|
2789
|
+
pushCb(value, function(err, result) {
|
|
2790
|
+
if (err) {
|
|
2791
|
+
reject(err);
|
|
2792
|
+
return;
|
|
2793
|
+
}
|
|
2794
|
+
resolve(result);
|
|
2795
|
+
});
|
|
2796
|
+
});
|
|
2797
|
+
return p.catch(noop2), p;
|
|
2798
|
+
}
|
|
2799
|
+
function unshift(value) {
|
|
2800
|
+
var p = new Promise(function(resolve, reject) {
|
|
2801
|
+
unshiftCb(value, function(err, result) {
|
|
2802
|
+
if (err) {
|
|
2803
|
+
reject(err);
|
|
2804
|
+
return;
|
|
2805
|
+
}
|
|
2806
|
+
resolve(result);
|
|
2807
|
+
});
|
|
2808
|
+
});
|
|
2809
|
+
return p.catch(noop2), p;
|
|
2810
|
+
}
|
|
2811
|
+
function drained() {
|
|
2812
|
+
var p = new Promise(function(resolve) {
|
|
2813
|
+
process.nextTick(function() {
|
|
2814
|
+
if (queue.idle())
|
|
2815
|
+
resolve();
|
|
2816
|
+
else {
|
|
2817
|
+
var previousDrain = queue.drain;
|
|
2818
|
+
queue.drain = function() {
|
|
2819
|
+
typeof previousDrain == "function" && previousDrain(), resolve(), queue.drain = previousDrain;
|
|
2820
|
+
};
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
});
|
|
2824
|
+
return p;
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
module.exports = fastqueue;
|
|
2828
|
+
module.exports.promise = queueAsPromised;
|
|
2829
|
+
}
|
|
2830
|
+
});
|
|
2831
|
+
|
|
2832
|
+
// ../../node_modules/@nodelib/fs.walk/out/readers/common.js
|
|
2833
|
+
var require_common2 = __commonJS({
|
|
2834
|
+
"../../node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) {
|
|
2835
|
+
"use strict";
|
|
2836
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2837
|
+
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
2838
|
+
function isFatalError(settings, error) {
|
|
2839
|
+
return settings.errorFilter === null ? !0 : !settings.errorFilter(error);
|
|
2840
|
+
}
|
|
2841
|
+
exports.isFatalError = isFatalError;
|
|
2842
|
+
function isAppliedFilter(filter, value) {
|
|
2843
|
+
return filter === null || filter(value);
|
|
2844
|
+
}
|
|
2845
|
+
exports.isAppliedFilter = isAppliedFilter;
|
|
2846
|
+
function replacePathSegmentSeparator(filepath, separator) {
|
|
2847
|
+
return filepath.split(/[/\\]/).join(separator);
|
|
2848
|
+
}
|
|
2849
|
+
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
2850
|
+
function joinPathSegments(a, b, separator) {
|
|
2851
|
+
return a === "" ? b : a.endsWith(separator) ? a + b : a + separator + b;
|
|
2852
|
+
}
|
|
2853
|
+
exports.joinPathSegments = joinPathSegments;
|
|
2854
|
+
}
|
|
2855
|
+
});
|
|
2856
|
+
|
|
2857
|
+
// ../../node_modules/@nodelib/fs.walk/out/readers/reader.js
|
|
2858
|
+
var require_reader = __commonJS({
|
|
2859
|
+
"../../node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) {
|
|
2860
|
+
"use strict";
|
|
2861
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2862
|
+
var common = require_common2(), Reader = class {
|
|
2863
|
+
constructor(_root, _settings) {
|
|
2864
|
+
this._root = _root, this._settings = _settings, this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
|
|
2865
|
+
}
|
|
2866
|
+
};
|
|
2867
|
+
exports.default = Reader;
|
|
2868
|
+
}
|
|
2869
|
+
});
|
|
2870
|
+
|
|
2871
|
+
// ../../node_modules/@nodelib/fs.walk/out/readers/async.js
|
|
2872
|
+
var require_async3 = __commonJS({
|
|
2873
|
+
"../../node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) {
|
|
2874
|
+
"use strict";
|
|
2875
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2876
|
+
var events_1 = __require("events"), fsScandir = require_out2(), fastq = require_queue(), common = require_common2(), reader_1 = require_reader(), AsyncReader = class extends reader_1.default {
|
|
2877
|
+
constructor(_root, _settings) {
|
|
2878
|
+
super(_root, _settings), this._settings = _settings, this._scandir = fsScandir.scandir, this._emitter = new events_1.EventEmitter(), this._queue = fastq(this._worker.bind(this), this._settings.concurrency), this._isFatalError = !1, this._isDestroyed = !1, this._queue.drain = () => {
|
|
2879
|
+
this._isFatalError || this._emitter.emit("end");
|
|
2880
|
+
};
|
|
2881
|
+
}
|
|
2882
|
+
read() {
|
|
2883
|
+
return this._isFatalError = !1, this._isDestroyed = !1, setImmediate(() => {
|
|
2884
|
+
this._pushToQueue(this._root, this._settings.basePath);
|
|
2885
|
+
}), this._emitter;
|
|
2886
|
+
}
|
|
2887
|
+
get isDestroyed() {
|
|
2888
|
+
return this._isDestroyed;
|
|
2889
|
+
}
|
|
2890
|
+
destroy() {
|
|
2891
|
+
if (this._isDestroyed)
|
|
2892
|
+
throw new Error("The reader is already destroyed");
|
|
2893
|
+
this._isDestroyed = !0, this._queue.killAndDrain();
|
|
2894
|
+
}
|
|
2895
|
+
onEntry(callback) {
|
|
2896
|
+
this._emitter.on("entry", callback);
|
|
2897
|
+
}
|
|
2898
|
+
onError(callback) {
|
|
2899
|
+
this._emitter.once("error", callback);
|
|
2900
|
+
}
|
|
2901
|
+
onEnd(callback) {
|
|
2902
|
+
this._emitter.once("end", callback);
|
|
2903
|
+
}
|
|
2904
|
+
_pushToQueue(directory, base) {
|
|
2905
|
+
let queueItem = { directory, base };
|
|
2906
|
+
this._queue.push(queueItem, (error) => {
|
|
2907
|
+
error !== null && this._handleError(error);
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
_worker(item, done) {
|
|
2911
|
+
this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
|
|
2912
|
+
if (error !== null) {
|
|
2913
|
+
done(error, void 0);
|
|
2914
|
+
return;
|
|
2915
|
+
}
|
|
2916
|
+
for (let entry of entries)
|
|
2917
|
+
this._handleEntry(entry, item.base);
|
|
2918
|
+
done(null, void 0);
|
|
2919
|
+
});
|
|
2920
|
+
}
|
|
2921
|
+
_handleError(error) {
|
|
2922
|
+
this._isDestroyed || !common.isFatalError(this._settings, error) || (this._isFatalError = !0, this._isDestroyed = !0, this._emitter.emit("error", error));
|
|
2923
|
+
}
|
|
2924
|
+
_handleEntry(entry, base) {
|
|
2925
|
+
if (this._isDestroyed || this._isFatalError)
|
|
2926
|
+
return;
|
|
2927
|
+
let fullpath = entry.path;
|
|
2928
|
+
base !== void 0 && (entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator)), common.isAppliedFilter(this._settings.entryFilter, entry) && this._emitEntry(entry), entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry) && this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
|
|
2929
|
+
}
|
|
2930
|
+
_emitEntry(entry) {
|
|
2931
|
+
this._emitter.emit("entry", entry);
|
|
2932
|
+
}
|
|
2933
|
+
};
|
|
2934
|
+
exports.default = AsyncReader;
|
|
2935
|
+
}
|
|
2936
|
+
});
|
|
2937
|
+
|
|
2938
|
+
// ../../node_modules/@nodelib/fs.walk/out/providers/async.js
|
|
2939
|
+
var require_async4 = __commonJS({
|
|
2940
|
+
"../../node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) {
|
|
2941
|
+
"use strict";
|
|
2942
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2943
|
+
var async_1 = require_async3(), AsyncProvider = class {
|
|
2944
|
+
constructor(_root, _settings) {
|
|
2945
|
+
this._root = _root, this._settings = _settings, this._reader = new async_1.default(this._root, this._settings), this._storage = [];
|
|
2946
|
+
}
|
|
2947
|
+
read(callback) {
|
|
2948
|
+
this._reader.onError((error) => {
|
|
2949
|
+
callFailureCallback(callback, error);
|
|
2950
|
+
}), this._reader.onEntry((entry) => {
|
|
2951
|
+
this._storage.push(entry);
|
|
2952
|
+
}), this._reader.onEnd(() => {
|
|
2953
|
+
callSuccessCallback(callback, this._storage);
|
|
2954
|
+
}), this._reader.read();
|
|
2955
|
+
}
|
|
2956
|
+
};
|
|
2957
|
+
exports.default = AsyncProvider;
|
|
2958
|
+
function callFailureCallback(callback, error) {
|
|
2959
|
+
callback(error);
|
|
2960
|
+
}
|
|
2961
|
+
function callSuccessCallback(callback, entries) {
|
|
2962
|
+
callback(null, entries);
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
});
|
|
2966
|
+
|
|
2967
|
+
// ../../node_modules/@nodelib/fs.walk/out/providers/stream.js
|
|
2968
|
+
var require_stream2 = __commonJS({
|
|
2969
|
+
"../../node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) {
|
|
2970
|
+
"use strict";
|
|
2971
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2972
|
+
var stream_1 = __require("stream"), async_1 = require_async3(), StreamProvider = class {
|
|
2973
|
+
constructor(_root, _settings) {
|
|
2974
|
+
this._root = _root, this._settings = _settings, this._reader = new async_1.default(this._root, this._settings), this._stream = new stream_1.Readable({
|
|
2975
|
+
objectMode: !0,
|
|
2976
|
+
read: () => {
|
|
2977
|
+
},
|
|
2978
|
+
destroy: () => {
|
|
2979
|
+
this._reader.isDestroyed || this._reader.destroy();
|
|
2980
|
+
}
|
|
2981
|
+
});
|
|
2982
|
+
}
|
|
2983
|
+
read() {
|
|
2984
|
+
return this._reader.onError((error) => {
|
|
2985
|
+
this._stream.emit("error", error);
|
|
2986
|
+
}), this._reader.onEntry((entry) => {
|
|
2987
|
+
this._stream.push(entry);
|
|
2988
|
+
}), this._reader.onEnd(() => {
|
|
2989
|
+
this._stream.push(null);
|
|
2990
|
+
}), this._reader.read(), this._stream;
|
|
2991
|
+
}
|
|
2992
|
+
};
|
|
2993
|
+
exports.default = StreamProvider;
|
|
2994
|
+
}
|
|
2995
|
+
});
|
|
2996
|
+
|
|
2997
|
+
// ../../node_modules/@nodelib/fs.walk/out/readers/sync.js
|
|
2998
|
+
var require_sync3 = __commonJS({
|
|
2999
|
+
"../../node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) {
|
|
3000
|
+
"use strict";
|
|
3001
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3002
|
+
var fsScandir = require_out2(), common = require_common2(), reader_1 = require_reader(), SyncReader = class extends reader_1.default {
|
|
3003
|
+
constructor() {
|
|
3004
|
+
super(...arguments), this._scandir = fsScandir.scandirSync, this._storage = [], this._queue = /* @__PURE__ */ new Set();
|
|
3005
|
+
}
|
|
3006
|
+
read() {
|
|
3007
|
+
return this._pushToQueue(this._root, this._settings.basePath), this._handleQueue(), this._storage;
|
|
3008
|
+
}
|
|
3009
|
+
_pushToQueue(directory, base) {
|
|
3010
|
+
this._queue.add({ directory, base });
|
|
3011
|
+
}
|
|
3012
|
+
_handleQueue() {
|
|
3013
|
+
for (let item of this._queue.values())
|
|
3014
|
+
this._handleDirectory(item.directory, item.base);
|
|
3015
|
+
}
|
|
3016
|
+
_handleDirectory(directory, base) {
|
|
3017
|
+
try {
|
|
3018
|
+
let entries = this._scandir(directory, this._settings.fsScandirSettings);
|
|
3019
|
+
for (let entry of entries)
|
|
3020
|
+
this._handleEntry(entry, base);
|
|
3021
|
+
} catch (error) {
|
|
3022
|
+
this._handleError(error);
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
_handleError(error) {
|
|
3026
|
+
if (common.isFatalError(this._settings, error))
|
|
3027
|
+
throw error;
|
|
3028
|
+
}
|
|
3029
|
+
_handleEntry(entry, base) {
|
|
3030
|
+
let fullpath = entry.path;
|
|
3031
|
+
base !== void 0 && (entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator)), common.isAppliedFilter(this._settings.entryFilter, entry) && this._pushToStorage(entry), entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry) && this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
|
|
3032
|
+
}
|
|
3033
|
+
_pushToStorage(entry) {
|
|
3034
|
+
this._storage.push(entry);
|
|
3035
|
+
}
|
|
3036
|
+
};
|
|
3037
|
+
exports.default = SyncReader;
|
|
3038
|
+
}
|
|
3039
|
+
});
|
|
3040
|
+
|
|
3041
|
+
// ../../node_modules/@nodelib/fs.walk/out/providers/sync.js
|
|
3042
|
+
var require_sync4 = __commonJS({
|
|
3043
|
+
"../../node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) {
|
|
3044
|
+
"use strict";
|
|
3045
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3046
|
+
var sync_1 = require_sync3(), SyncProvider = class {
|
|
3047
|
+
constructor(_root, _settings) {
|
|
3048
|
+
this._root = _root, this._settings = _settings, this._reader = new sync_1.default(this._root, this._settings);
|
|
3049
|
+
}
|
|
3050
|
+
read() {
|
|
3051
|
+
return this._reader.read();
|
|
3052
|
+
}
|
|
3053
|
+
};
|
|
3054
|
+
exports.default = SyncProvider;
|
|
3055
|
+
}
|
|
3056
|
+
});
|
|
3057
|
+
|
|
3058
|
+
// ../../node_modules/@nodelib/fs.walk/out/settings.js
|
|
3059
|
+
var require_settings3 = __commonJS({
|
|
3060
|
+
"../../node_modules/@nodelib/fs.walk/out/settings.js"(exports) {
|
|
3061
|
+
"use strict";
|
|
3062
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3063
|
+
var path2 = __require("path"), fsScandir = require_out2(), Settings = class {
|
|
3064
|
+
constructor(_options = {}) {
|
|
3065
|
+
this._options = _options, this.basePath = this._getValue(this._options.basePath, void 0), this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY), this.deepFilter = this._getValue(this._options.deepFilter, null), this.entryFilter = this._getValue(this._options.entryFilter, null), this.errorFilter = this._getValue(this._options.errorFilter, null), this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path2.sep), this.fsScandirSettings = new fsScandir.Settings({
|
|
3066
|
+
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
3067
|
+
fs: this._options.fs,
|
|
3068
|
+
pathSegmentSeparator: this._options.pathSegmentSeparator,
|
|
3069
|
+
stats: this._options.stats,
|
|
3070
|
+
throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
_getValue(option, value) {
|
|
3074
|
+
return option ?? value;
|
|
3075
|
+
}
|
|
3076
|
+
};
|
|
3077
|
+
exports.default = Settings;
|
|
3078
|
+
}
|
|
3079
|
+
});
|
|
3080
|
+
|
|
3081
|
+
// ../../node_modules/@nodelib/fs.walk/out/index.js
|
|
3082
|
+
var require_out3 = __commonJS({
|
|
3083
|
+
"../../node_modules/@nodelib/fs.walk/out/index.js"(exports) {
|
|
3084
|
+
"use strict";
|
|
3085
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3086
|
+
exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
|
|
3087
|
+
var async_1 = require_async4(), stream_1 = require_stream2(), sync_1 = require_sync4(), settings_1 = require_settings3();
|
|
3088
|
+
exports.Settings = settings_1.default;
|
|
3089
|
+
function walk(directory, optionsOrSettingsOrCallback, callback) {
|
|
3090
|
+
if (typeof optionsOrSettingsOrCallback == "function") {
|
|
3091
|
+
new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
|
|
3092
|
+
return;
|
|
3093
|
+
}
|
|
3094
|
+
new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
|
|
3095
|
+
}
|
|
3096
|
+
exports.walk = walk;
|
|
3097
|
+
function walkSync(directory, optionsOrSettings) {
|
|
3098
|
+
let settings = getSettings(optionsOrSettings);
|
|
3099
|
+
return new sync_1.default(directory, settings).read();
|
|
3100
|
+
}
|
|
3101
|
+
exports.walkSync = walkSync;
|
|
3102
|
+
function walkStream(directory, optionsOrSettings) {
|
|
3103
|
+
let settings = getSettings(optionsOrSettings);
|
|
3104
|
+
return new stream_1.default(directory, settings).read();
|
|
3105
|
+
}
|
|
3106
|
+
exports.walkStream = walkStream;
|
|
3107
|
+
function getSettings(settingsOrOptions = {}) {
|
|
3108
|
+
return settingsOrOptions instanceof settings_1.default ? settingsOrOptions : new settings_1.default(settingsOrOptions);
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
});
|
|
3112
|
+
|
|
3113
|
+
// ../../node_modules/fast-glob/out/readers/reader.js
|
|
3114
|
+
var require_reader2 = __commonJS({
|
|
3115
|
+
"../../node_modules/fast-glob/out/readers/reader.js"(exports) {
|
|
3116
|
+
"use strict";
|
|
3117
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3118
|
+
var path2 = __require("path"), fsStat = require_out(), utils = require_utils3(), Reader = class {
|
|
3119
|
+
constructor(_settings) {
|
|
3120
|
+
this._settings = _settings, this._fsStatSettings = new fsStat.Settings({
|
|
3121
|
+
followSymbolicLink: this._settings.followSymbolicLinks,
|
|
3122
|
+
fs: this._settings.fs,
|
|
3123
|
+
throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
|
3124
|
+
});
|
|
3125
|
+
}
|
|
3126
|
+
_getFullEntryPath(filepath) {
|
|
3127
|
+
return path2.resolve(this._settings.cwd, filepath);
|
|
3128
|
+
}
|
|
3129
|
+
_makeEntry(stats, pattern) {
|
|
3130
|
+
let entry = {
|
|
3131
|
+
name: pattern,
|
|
3132
|
+
path: pattern,
|
|
3133
|
+
dirent: utils.fs.createDirentFromStats(pattern, stats)
|
|
3134
|
+
};
|
|
3135
|
+
return this._settings.stats && (entry.stats = stats), entry;
|
|
3136
|
+
}
|
|
3137
|
+
_isFatalError(error) {
|
|
3138
|
+
return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
|
3139
|
+
}
|
|
3140
|
+
};
|
|
3141
|
+
exports.default = Reader;
|
|
3142
|
+
}
|
|
3143
|
+
});
|
|
3144
|
+
|
|
3145
|
+
// ../../node_modules/fast-glob/out/readers/stream.js
|
|
3146
|
+
var require_stream3 = __commonJS({
|
|
3147
|
+
"../../node_modules/fast-glob/out/readers/stream.js"(exports) {
|
|
3148
|
+
"use strict";
|
|
3149
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3150
|
+
var stream_1 = __require("stream"), fsStat = require_out(), fsWalk = require_out3(), reader_1 = require_reader2(), ReaderStream = class extends reader_1.default {
|
|
3151
|
+
constructor() {
|
|
3152
|
+
super(...arguments), this._walkStream = fsWalk.walkStream, this._stat = fsStat.stat;
|
|
3153
|
+
}
|
|
3154
|
+
dynamic(root, options) {
|
|
3155
|
+
return this._walkStream(root, options);
|
|
3156
|
+
}
|
|
3157
|
+
static(patterns, options) {
|
|
3158
|
+
let filepaths = patterns.map(this._getFullEntryPath, this), stream = new stream_1.PassThrough({ objectMode: !0 });
|
|
3159
|
+
stream._write = (index, _enc, done) => this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
|
|
3160
|
+
entry !== null && options.entryFilter(entry) && stream.push(entry), index === filepaths.length - 1 && stream.end(), done();
|
|
3161
|
+
}).catch(done);
|
|
3162
|
+
for (let i = 0; i < filepaths.length; i++)
|
|
3163
|
+
stream.write(i);
|
|
3164
|
+
return stream;
|
|
3165
|
+
}
|
|
3166
|
+
_getEntry(filepath, pattern, options) {
|
|
3167
|
+
return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
|
|
3168
|
+
if (options.errorFilter(error))
|
|
3169
|
+
return null;
|
|
3170
|
+
throw error;
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
3173
|
+
_getStat(filepath) {
|
|
3174
|
+
return new Promise((resolve, reject) => {
|
|
3175
|
+
this._stat(filepath, this._fsStatSettings, (error, stats) => error === null ? resolve(stats) : reject(error));
|
|
3176
|
+
});
|
|
3177
|
+
}
|
|
3178
|
+
};
|
|
3179
|
+
exports.default = ReaderStream;
|
|
3180
|
+
}
|
|
3181
|
+
});
|
|
3182
|
+
|
|
3183
|
+
// ../../node_modules/fast-glob/out/readers/async.js
|
|
3184
|
+
var require_async5 = __commonJS({
|
|
3185
|
+
"../../node_modules/fast-glob/out/readers/async.js"(exports) {
|
|
3186
|
+
"use strict";
|
|
3187
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3188
|
+
var fsWalk = require_out3(), reader_1 = require_reader2(), stream_1 = require_stream3(), ReaderAsync = class extends reader_1.default {
|
|
3189
|
+
constructor() {
|
|
3190
|
+
super(...arguments), this._walkAsync = fsWalk.walk, this._readerStream = new stream_1.default(this._settings);
|
|
3191
|
+
}
|
|
3192
|
+
dynamic(root, options) {
|
|
3193
|
+
return new Promise((resolve, reject) => {
|
|
3194
|
+
this._walkAsync(root, options, (error, entries) => {
|
|
3195
|
+
error === null ? resolve(entries) : reject(error);
|
|
3196
|
+
});
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
async static(patterns, options) {
|
|
3200
|
+
let entries = [], stream = this._readerStream.static(patterns, options);
|
|
3201
|
+
return new Promise((resolve, reject) => {
|
|
3202
|
+
stream.once("error", reject), stream.on("data", (entry) => entries.push(entry)), stream.once("end", () => resolve(entries));
|
|
3203
|
+
});
|
|
3204
|
+
}
|
|
3205
|
+
};
|
|
3206
|
+
exports.default = ReaderAsync;
|
|
3207
|
+
}
|
|
3208
|
+
});
|
|
3209
|
+
|
|
3210
|
+
// ../../node_modules/fast-glob/out/providers/matchers/matcher.js
|
|
3211
|
+
var require_matcher = __commonJS({
|
|
3212
|
+
"../../node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) {
|
|
3213
|
+
"use strict";
|
|
3214
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3215
|
+
var utils = require_utils3(), Matcher = class {
|
|
3216
|
+
constructor(_patterns, _settings, _micromatchOptions) {
|
|
3217
|
+
this._patterns = _patterns, this._settings = _settings, this._micromatchOptions = _micromatchOptions, this._storage = [], this._fillStorage();
|
|
3218
|
+
}
|
|
3219
|
+
_fillStorage() {
|
|
3220
|
+
for (let pattern of this._patterns) {
|
|
3221
|
+
let segments = this._getPatternSegments(pattern), sections = this._splitSegmentsIntoSections(segments);
|
|
3222
|
+
this._storage.push({
|
|
3223
|
+
complete: sections.length <= 1,
|
|
3224
|
+
pattern,
|
|
3225
|
+
segments,
|
|
3226
|
+
sections
|
|
3227
|
+
});
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
_getPatternSegments(pattern) {
|
|
3231
|
+
return utils.pattern.getPatternParts(pattern, this._micromatchOptions).map((part) => utils.pattern.isDynamicPattern(part, this._settings) ? {
|
|
3232
|
+
dynamic: !0,
|
|
3233
|
+
pattern: part,
|
|
3234
|
+
patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
|
|
3235
|
+
} : {
|
|
3236
|
+
dynamic: !1,
|
|
3237
|
+
pattern: part
|
|
3238
|
+
});
|
|
3239
|
+
}
|
|
3240
|
+
_splitSegmentsIntoSections(segments) {
|
|
3241
|
+
return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
|
|
3242
|
+
}
|
|
3243
|
+
};
|
|
3244
|
+
exports.default = Matcher;
|
|
3245
|
+
}
|
|
3246
|
+
});
|
|
3247
|
+
|
|
3248
|
+
// ../../node_modules/fast-glob/out/providers/matchers/partial.js
|
|
3249
|
+
var require_partial = __commonJS({
|
|
3250
|
+
"../../node_modules/fast-glob/out/providers/matchers/partial.js"(exports) {
|
|
3251
|
+
"use strict";
|
|
3252
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3253
|
+
var matcher_1 = require_matcher(), PartialMatcher = class extends matcher_1.default {
|
|
3254
|
+
match(filepath) {
|
|
3255
|
+
let parts = filepath.split("/"), levels = parts.length, patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
|
3256
|
+
for (let pattern of patterns) {
|
|
3257
|
+
let section = pattern.sections[0];
|
|
3258
|
+
if (!pattern.complete && levels > section.length || parts.every((part, index) => {
|
|
3259
|
+
let segment = pattern.segments[index];
|
|
3260
|
+
return !!(segment.dynamic && segment.patternRe.test(part) || !segment.dynamic && segment.pattern === part);
|
|
3261
|
+
}))
|
|
3262
|
+
return !0;
|
|
3263
|
+
}
|
|
3264
|
+
return !1;
|
|
3265
|
+
}
|
|
3266
|
+
};
|
|
3267
|
+
exports.default = PartialMatcher;
|
|
3268
|
+
}
|
|
3269
|
+
});
|
|
3270
|
+
|
|
3271
|
+
// ../../node_modules/fast-glob/out/providers/filters/deep.js
|
|
3272
|
+
var require_deep = __commonJS({
|
|
3273
|
+
"../../node_modules/fast-glob/out/providers/filters/deep.js"(exports) {
|
|
3274
|
+
"use strict";
|
|
3275
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3276
|
+
var utils = require_utils3(), partial_1 = require_partial(), DeepFilter = class {
|
|
3277
|
+
constructor(_settings, _micromatchOptions) {
|
|
3278
|
+
this._settings = _settings, this._micromatchOptions = _micromatchOptions;
|
|
3279
|
+
}
|
|
3280
|
+
getFilter(basePath, positive, negative) {
|
|
3281
|
+
let matcher = this._getMatcher(positive), negativeRe = this._getNegativePatternsRe(negative);
|
|
3282
|
+
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
|
3283
|
+
}
|
|
3284
|
+
_getMatcher(patterns) {
|
|
3285
|
+
return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
|
3286
|
+
}
|
|
3287
|
+
_getNegativePatternsRe(patterns) {
|
|
3288
|
+
let affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
|
|
3289
|
+
return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
|
3290
|
+
}
|
|
3291
|
+
_filter(basePath, entry, matcher, negativeRe) {
|
|
3292
|
+
if (this._isSkippedByDeep(basePath, entry.path) || this._isSkippedSymbolicLink(entry))
|
|
3293
|
+
return !1;
|
|
3294
|
+
let filepath = utils.path.removeLeadingDotSegment(entry.path);
|
|
3295
|
+
return this._isSkippedByPositivePatterns(filepath, matcher) ? !1 : this._isSkippedByNegativePatterns(filepath, negativeRe);
|
|
3296
|
+
}
|
|
3297
|
+
_isSkippedByDeep(basePath, entryPath) {
|
|
3298
|
+
return this._settings.deep === 1 / 0 ? !1 : this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
|
3299
|
+
}
|
|
3300
|
+
_getEntryLevel(basePath, entryPath) {
|
|
3301
|
+
let entryPathDepth = entryPath.split("/").length;
|
|
3302
|
+
if (basePath === "")
|
|
3303
|
+
return entryPathDepth;
|
|
3304
|
+
let basePathDepth = basePath.split("/").length;
|
|
3305
|
+
return entryPathDepth - basePathDepth;
|
|
3306
|
+
}
|
|
3307
|
+
_isSkippedSymbolicLink(entry) {
|
|
3308
|
+
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
|
3309
|
+
}
|
|
3310
|
+
_isSkippedByPositivePatterns(entryPath, matcher) {
|
|
3311
|
+
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
|
3312
|
+
}
|
|
3313
|
+
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
|
3314
|
+
return !utils.pattern.matchAny(entryPath, patternsRe);
|
|
3315
|
+
}
|
|
3316
|
+
};
|
|
3317
|
+
exports.default = DeepFilter;
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
|
|
3321
|
+
// ../../node_modules/fast-glob/out/providers/filters/entry.js
|
|
3322
|
+
var require_entry = __commonJS({
|
|
3323
|
+
"../../node_modules/fast-glob/out/providers/filters/entry.js"(exports) {
|
|
3324
|
+
"use strict";
|
|
3325
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3326
|
+
var utils = require_utils3(), EntryFilter = class {
|
|
3327
|
+
constructor(_settings, _micromatchOptions) {
|
|
3328
|
+
this._settings = _settings, this._micromatchOptions = _micromatchOptions, this.index = /* @__PURE__ */ new Map();
|
|
3329
|
+
}
|
|
3330
|
+
getFilter(positive, negative) {
|
|
3331
|
+
let [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative), patterns = {
|
|
3332
|
+
positive: {
|
|
3333
|
+
all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions)
|
|
3334
|
+
},
|
|
3335
|
+
negative: {
|
|
3336
|
+
absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: !0 })),
|
|
3337
|
+
relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: !0 }))
|
|
3338
|
+
}
|
|
3339
|
+
};
|
|
3340
|
+
return (entry) => this._filter(entry, patterns);
|
|
3341
|
+
}
|
|
3342
|
+
_filter(entry, patterns) {
|
|
3343
|
+
let filepath = utils.path.removeLeadingDotSegment(entry.path);
|
|
3344
|
+
if (this._settings.unique && this._isDuplicateEntry(filepath) || this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry))
|
|
3345
|
+
return !1;
|
|
3346
|
+
let isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
|
|
3347
|
+
return this._settings.unique && isMatched && this._createIndexRecord(filepath), isMatched;
|
|
3348
|
+
}
|
|
3349
|
+
_isDuplicateEntry(filepath) {
|
|
3350
|
+
return this.index.has(filepath);
|
|
3351
|
+
}
|
|
3352
|
+
_createIndexRecord(filepath) {
|
|
3353
|
+
this.index.set(filepath, void 0);
|
|
3354
|
+
}
|
|
3355
|
+
_onlyFileFilter(entry) {
|
|
3356
|
+
return this._settings.onlyFiles && !entry.dirent.isFile();
|
|
3357
|
+
}
|
|
3358
|
+
_onlyDirectoryFilter(entry) {
|
|
3359
|
+
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
|
3360
|
+
}
|
|
3361
|
+
_isMatchToPatternsSet(filepath, patterns, isDirectory2) {
|
|
3362
|
+
return !(!this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory2) || this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory2) || this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory2));
|
|
3363
|
+
}
|
|
3364
|
+
_isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory2) {
|
|
3365
|
+
if (patternsRe.length === 0)
|
|
3366
|
+
return !1;
|
|
3367
|
+
let fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath);
|
|
3368
|
+
return this._isMatchToPatterns(fullpath, patternsRe, isDirectory2);
|
|
3369
|
+
}
|
|
3370
|
+
_isMatchToPatterns(filepath, patternsRe, isDirectory2) {
|
|
3371
|
+
if (patternsRe.length === 0)
|
|
3372
|
+
return !1;
|
|
3373
|
+
let isMatched = utils.pattern.matchAny(filepath, patternsRe);
|
|
3374
|
+
return !isMatched && isDirectory2 ? utils.pattern.matchAny(filepath + "/", patternsRe) : isMatched;
|
|
3375
|
+
}
|
|
3376
|
+
};
|
|
3377
|
+
exports.default = EntryFilter;
|
|
3378
|
+
}
|
|
3379
|
+
});
|
|
3380
|
+
|
|
3381
|
+
// ../../node_modules/fast-glob/out/providers/filters/error.js
|
|
3382
|
+
var require_error = __commonJS({
|
|
3383
|
+
"../../node_modules/fast-glob/out/providers/filters/error.js"(exports) {
|
|
3384
|
+
"use strict";
|
|
3385
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3386
|
+
var utils = require_utils3(), ErrorFilter = class {
|
|
3387
|
+
constructor(_settings) {
|
|
3388
|
+
this._settings = _settings;
|
|
3389
|
+
}
|
|
3390
|
+
getFilter() {
|
|
3391
|
+
return (error) => this._isNonFatalError(error);
|
|
3392
|
+
}
|
|
3393
|
+
_isNonFatalError(error) {
|
|
3394
|
+
return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
|
3395
|
+
}
|
|
3396
|
+
};
|
|
3397
|
+
exports.default = ErrorFilter;
|
|
3398
|
+
}
|
|
3399
|
+
});
|
|
3400
|
+
|
|
3401
|
+
// ../../node_modules/fast-glob/out/providers/transformers/entry.js
|
|
3402
|
+
var require_entry2 = __commonJS({
|
|
3403
|
+
"../../node_modules/fast-glob/out/providers/transformers/entry.js"(exports) {
|
|
3404
|
+
"use strict";
|
|
3405
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3406
|
+
var utils = require_utils3(), EntryTransformer = class {
|
|
3407
|
+
constructor(_settings) {
|
|
3408
|
+
this._settings = _settings;
|
|
3409
|
+
}
|
|
3410
|
+
getTransformer() {
|
|
3411
|
+
return (entry) => this._transform(entry);
|
|
3412
|
+
}
|
|
3413
|
+
_transform(entry) {
|
|
3414
|
+
let filepath = entry.path;
|
|
3415
|
+
return this._settings.absolute && (filepath = utils.path.makeAbsolute(this._settings.cwd, filepath), filepath = utils.path.unixify(filepath)), this._settings.markDirectories && entry.dirent.isDirectory() && (filepath += "/"), this._settings.objectMode ? Object.assign(Object.assign({}, entry), { path: filepath }) : filepath;
|
|
3416
|
+
}
|
|
3417
|
+
};
|
|
3418
|
+
exports.default = EntryTransformer;
|
|
3419
|
+
}
|
|
3420
|
+
});
|
|
3421
|
+
|
|
3422
|
+
// ../../node_modules/fast-glob/out/providers/provider.js
|
|
3423
|
+
var require_provider = __commonJS({
|
|
3424
|
+
"../../node_modules/fast-glob/out/providers/provider.js"(exports) {
|
|
3425
|
+
"use strict";
|
|
3426
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3427
|
+
var path2 = __require("path"), deep_1 = require_deep(), entry_1 = require_entry(), error_1 = require_error(), entry_2 = require_entry2(), Provider = class {
|
|
3428
|
+
constructor(_settings) {
|
|
3429
|
+
this._settings = _settings, this.errorFilter = new error_1.default(this._settings), this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()), this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()), this.entryTransformer = new entry_2.default(this._settings);
|
|
3430
|
+
}
|
|
3431
|
+
_getRootDirectory(task) {
|
|
3432
|
+
return path2.resolve(this._settings.cwd, task.base);
|
|
3433
|
+
}
|
|
3434
|
+
_getReaderOptions(task) {
|
|
3435
|
+
let basePath = task.base === "." ? "" : task.base;
|
|
3436
|
+
return {
|
|
3437
|
+
basePath,
|
|
3438
|
+
pathSegmentSeparator: "/",
|
|
3439
|
+
concurrency: this._settings.concurrency,
|
|
3440
|
+
deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
|
3441
|
+
entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
|
3442
|
+
errorFilter: this.errorFilter.getFilter(),
|
|
3443
|
+
followSymbolicLinks: this._settings.followSymbolicLinks,
|
|
3444
|
+
fs: this._settings.fs,
|
|
3445
|
+
stats: this._settings.stats,
|
|
3446
|
+
throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
|
3447
|
+
transform: this.entryTransformer.getTransformer()
|
|
3448
|
+
};
|
|
3449
|
+
}
|
|
3450
|
+
_getMicromatchOptions() {
|
|
3451
|
+
return {
|
|
3452
|
+
dot: this._settings.dot,
|
|
3453
|
+
matchBase: this._settings.baseNameMatch,
|
|
3454
|
+
nobrace: !this._settings.braceExpansion,
|
|
3455
|
+
nocase: !this._settings.caseSensitiveMatch,
|
|
3456
|
+
noext: !this._settings.extglob,
|
|
3457
|
+
noglobstar: !this._settings.globstar,
|
|
3458
|
+
posix: !0,
|
|
3459
|
+
strictSlashes: !1
|
|
3460
|
+
};
|
|
3461
|
+
}
|
|
3462
|
+
};
|
|
3463
|
+
exports.default = Provider;
|
|
3464
|
+
}
|
|
3465
|
+
});
|
|
3466
|
+
|
|
3467
|
+
// ../../node_modules/fast-glob/out/providers/async.js
|
|
3468
|
+
var require_async6 = __commonJS({
|
|
3469
|
+
"../../node_modules/fast-glob/out/providers/async.js"(exports) {
|
|
3470
|
+
"use strict";
|
|
3471
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3472
|
+
var async_1 = require_async5(), provider_1 = require_provider(), ProviderAsync = class extends provider_1.default {
|
|
3473
|
+
constructor() {
|
|
3474
|
+
super(...arguments), this._reader = new async_1.default(this._settings);
|
|
3475
|
+
}
|
|
3476
|
+
async read(task) {
|
|
3477
|
+
let root = this._getRootDirectory(task), options = this._getReaderOptions(task);
|
|
3478
|
+
return (await this.api(root, task, options)).map((entry) => options.transform(entry));
|
|
3479
|
+
}
|
|
3480
|
+
api(root, task, options) {
|
|
3481
|
+
return task.dynamic ? this._reader.dynamic(root, options) : this._reader.static(task.patterns, options);
|
|
3482
|
+
}
|
|
3483
|
+
};
|
|
3484
|
+
exports.default = ProviderAsync;
|
|
3485
|
+
}
|
|
3486
|
+
});
|
|
3487
|
+
|
|
3488
|
+
// ../../node_modules/fast-glob/out/providers/stream.js
|
|
3489
|
+
var require_stream4 = __commonJS({
|
|
3490
|
+
"../../node_modules/fast-glob/out/providers/stream.js"(exports) {
|
|
3491
|
+
"use strict";
|
|
3492
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3493
|
+
var stream_1 = __require("stream"), stream_2 = require_stream3(), provider_1 = require_provider(), ProviderStream = class extends provider_1.default {
|
|
3494
|
+
constructor() {
|
|
3495
|
+
super(...arguments), this._reader = new stream_2.default(this._settings);
|
|
3496
|
+
}
|
|
3497
|
+
read(task) {
|
|
3498
|
+
let root = this._getRootDirectory(task), options = this._getReaderOptions(task), source = this.api(root, task, options), destination = new stream_1.Readable({ objectMode: !0, read: () => {
|
|
3499
|
+
} });
|
|
3500
|
+
return source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end")), destination.once("close", () => source.destroy()), destination;
|
|
3501
|
+
}
|
|
3502
|
+
api(root, task, options) {
|
|
3503
|
+
return task.dynamic ? this._reader.dynamic(root, options) : this._reader.static(task.patterns, options);
|
|
3504
|
+
}
|
|
3505
|
+
};
|
|
3506
|
+
exports.default = ProviderStream;
|
|
3507
|
+
}
|
|
3508
|
+
});
|
|
3509
|
+
|
|
3510
|
+
// ../../node_modules/fast-glob/out/readers/sync.js
|
|
3511
|
+
var require_sync5 = __commonJS({
|
|
3512
|
+
"../../node_modules/fast-glob/out/readers/sync.js"(exports) {
|
|
3513
|
+
"use strict";
|
|
3514
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3515
|
+
var fsStat = require_out(), fsWalk = require_out3(), reader_1 = require_reader2(), ReaderSync = class extends reader_1.default {
|
|
3516
|
+
constructor() {
|
|
3517
|
+
super(...arguments), this._walkSync = fsWalk.walkSync, this._statSync = fsStat.statSync;
|
|
3518
|
+
}
|
|
3519
|
+
dynamic(root, options) {
|
|
3520
|
+
return this._walkSync(root, options);
|
|
3521
|
+
}
|
|
3522
|
+
static(patterns, options) {
|
|
3523
|
+
let entries = [];
|
|
3524
|
+
for (let pattern of patterns) {
|
|
3525
|
+
let filepath = this._getFullEntryPath(pattern), entry = this._getEntry(filepath, pattern, options);
|
|
3526
|
+
entry === null || !options.entryFilter(entry) || entries.push(entry);
|
|
3527
|
+
}
|
|
3528
|
+
return entries;
|
|
3529
|
+
}
|
|
3530
|
+
_getEntry(filepath, pattern, options) {
|
|
3531
|
+
try {
|
|
3532
|
+
let stats = this._getStat(filepath);
|
|
3533
|
+
return this._makeEntry(stats, pattern);
|
|
3534
|
+
} catch (error) {
|
|
3535
|
+
if (options.errorFilter(error))
|
|
3536
|
+
return null;
|
|
3537
|
+
throw error;
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3540
|
+
_getStat(filepath) {
|
|
3541
|
+
return this._statSync(filepath, this._fsStatSettings);
|
|
3542
|
+
}
|
|
3543
|
+
};
|
|
3544
|
+
exports.default = ReaderSync;
|
|
3545
|
+
}
|
|
3546
|
+
});
|
|
3547
|
+
|
|
3548
|
+
// ../../node_modules/fast-glob/out/providers/sync.js
|
|
3549
|
+
var require_sync6 = __commonJS({
|
|
3550
|
+
"../../node_modules/fast-glob/out/providers/sync.js"(exports) {
|
|
3551
|
+
"use strict";
|
|
3552
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3553
|
+
var sync_1 = require_sync5(), provider_1 = require_provider(), ProviderSync = class extends provider_1.default {
|
|
3554
|
+
constructor() {
|
|
3555
|
+
super(...arguments), this._reader = new sync_1.default(this._settings);
|
|
3556
|
+
}
|
|
3557
|
+
read(task) {
|
|
3558
|
+
let root = this._getRootDirectory(task), options = this._getReaderOptions(task);
|
|
3559
|
+
return this.api(root, task, options).map(options.transform);
|
|
3560
|
+
}
|
|
3561
|
+
api(root, task, options) {
|
|
3562
|
+
return task.dynamic ? this._reader.dynamic(root, options) : this._reader.static(task.patterns, options);
|
|
3563
|
+
}
|
|
3564
|
+
};
|
|
3565
|
+
exports.default = ProviderSync;
|
|
3566
|
+
}
|
|
3567
|
+
});
|
|
3568
|
+
|
|
3569
|
+
// ../../node_modules/fast-glob/out/settings.js
|
|
3570
|
+
var require_settings4 = __commonJS({
|
|
3571
|
+
"../../node_modules/fast-glob/out/settings.js"(exports) {
|
|
3572
|
+
"use strict";
|
|
3573
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3574
|
+
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
3575
|
+
var fs4 = __require("fs"), os = __require("os"), CPU_COUNT = Math.max(os.cpus().length, 1);
|
|
3576
|
+
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
3577
|
+
lstat: fs4.lstat,
|
|
3578
|
+
lstatSync: fs4.lstatSync,
|
|
3579
|
+
stat: fs4.stat,
|
|
3580
|
+
statSync: fs4.statSync,
|
|
3581
|
+
readdir: fs4.readdir,
|
|
3582
|
+
readdirSync: fs4.readdirSync
|
|
3583
|
+
};
|
|
3584
|
+
var Settings = class {
|
|
3585
|
+
constructor(_options = {}) {
|
|
3586
|
+
this._options = _options, this.absolute = this._getValue(this._options.absolute, !1), this.baseNameMatch = this._getValue(this._options.baseNameMatch, !1), this.braceExpansion = this._getValue(this._options.braceExpansion, !0), this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, !0), this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT), this.cwd = this._getValue(this._options.cwd, process.cwd()), this.deep = this._getValue(this._options.deep, 1 / 0), this.dot = this._getValue(this._options.dot, !1), this.extglob = this._getValue(this._options.extglob, !0), this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, !0), this.fs = this._getFileSystemMethods(this._options.fs), this.globstar = this._getValue(this._options.globstar, !0), this.ignore = this._getValue(this._options.ignore, []), this.markDirectories = this._getValue(this._options.markDirectories, !1), this.objectMode = this._getValue(this._options.objectMode, !1), this.onlyDirectories = this._getValue(this._options.onlyDirectories, !1), this.onlyFiles = this._getValue(this._options.onlyFiles, !0), this.stats = this._getValue(this._options.stats, !1), this.suppressErrors = this._getValue(this._options.suppressErrors, !1), this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, !1), this.unique = this._getValue(this._options.unique, !0), this.onlyDirectories && (this.onlyFiles = !1), this.stats && (this.objectMode = !0), this.ignore = [].concat(this.ignore);
|
|
3587
|
+
}
|
|
3588
|
+
_getValue(option, value) {
|
|
3589
|
+
return option === void 0 ? value : option;
|
|
3590
|
+
}
|
|
3591
|
+
_getFileSystemMethods(methods = {}) {
|
|
3592
|
+
return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
|
3593
|
+
}
|
|
3594
|
+
};
|
|
3595
|
+
exports.default = Settings;
|
|
3596
|
+
}
|
|
3597
|
+
});
|
|
3598
|
+
|
|
3599
|
+
// ../../node_modules/fast-glob/out/index.js
|
|
3600
|
+
var require_out4 = __commonJS({
|
|
3601
|
+
"../../node_modules/fast-glob/out/index.js"(exports, module) {
|
|
3602
|
+
"use strict";
|
|
3603
|
+
var taskManager = require_tasks(), async_1 = require_async6(), stream_1 = require_stream4(), sync_1 = require_sync6(), settings_1 = require_settings4(), utils = require_utils3();
|
|
3604
|
+
async function FastGlob(source, options) {
|
|
3605
|
+
assertPatternsInput2(source);
|
|
3606
|
+
let works = getWorks(source, async_1.default, options), result = await Promise.all(works);
|
|
3607
|
+
return utils.array.flatten(result);
|
|
3608
|
+
}
|
|
3609
|
+
(function(FastGlob2) {
|
|
3610
|
+
FastGlob2.glob = FastGlob2, FastGlob2.globSync = sync, FastGlob2.globStream = stream, FastGlob2.async = FastGlob2;
|
|
3611
|
+
function sync(source, options) {
|
|
3612
|
+
assertPatternsInput2(source);
|
|
3613
|
+
let works = getWorks(source, sync_1.default, options);
|
|
3614
|
+
return utils.array.flatten(works);
|
|
3615
|
+
}
|
|
3616
|
+
FastGlob2.sync = sync;
|
|
3617
|
+
function stream(source, options) {
|
|
3618
|
+
assertPatternsInput2(source);
|
|
3619
|
+
let works = getWorks(source, stream_1.default, options);
|
|
3620
|
+
return utils.stream.merge(works);
|
|
3621
|
+
}
|
|
3622
|
+
FastGlob2.stream = stream;
|
|
3623
|
+
function generateTasks2(source, options) {
|
|
3624
|
+
assertPatternsInput2(source);
|
|
3625
|
+
let patterns = [].concat(source), settings = new settings_1.default(options);
|
|
3626
|
+
return taskManager.generate(patterns, settings);
|
|
3627
|
+
}
|
|
3628
|
+
FastGlob2.generateTasks = generateTasks2;
|
|
3629
|
+
function isDynamicPattern2(source, options) {
|
|
3630
|
+
assertPatternsInput2(source);
|
|
3631
|
+
let settings = new settings_1.default(options);
|
|
3632
|
+
return utils.pattern.isDynamicPattern(source, settings);
|
|
3633
|
+
}
|
|
3634
|
+
FastGlob2.isDynamicPattern = isDynamicPattern2;
|
|
3635
|
+
function escapePath(source) {
|
|
3636
|
+
return assertPatternsInput2(source), utils.path.escape(source);
|
|
3637
|
+
}
|
|
3638
|
+
FastGlob2.escapePath = escapePath;
|
|
3639
|
+
function convertPathToPattern2(source) {
|
|
3640
|
+
return assertPatternsInput2(source), utils.path.convertPathToPattern(source);
|
|
3641
|
+
}
|
|
3642
|
+
FastGlob2.convertPathToPattern = convertPathToPattern2;
|
|
3643
|
+
let posix;
|
|
3644
|
+
(function(posix2) {
|
|
3645
|
+
function escapePath2(source) {
|
|
3646
|
+
return assertPatternsInput2(source), utils.path.escapePosixPath(source);
|
|
3647
|
+
}
|
|
3648
|
+
posix2.escapePath = escapePath2;
|
|
3649
|
+
function convertPathToPattern3(source) {
|
|
3650
|
+
return assertPatternsInput2(source), utils.path.convertPosixPathToPattern(source);
|
|
3651
|
+
}
|
|
3652
|
+
posix2.convertPathToPattern = convertPathToPattern3;
|
|
3653
|
+
})(posix = FastGlob2.posix || (FastGlob2.posix = {}));
|
|
3654
|
+
let win32;
|
|
3655
|
+
(function(win322) {
|
|
3656
|
+
function escapePath2(source) {
|
|
3657
|
+
return assertPatternsInput2(source), utils.path.escapeWindowsPath(source);
|
|
3658
|
+
}
|
|
3659
|
+
win322.escapePath = escapePath2;
|
|
3660
|
+
function convertPathToPattern3(source) {
|
|
3661
|
+
return assertPatternsInput2(source), utils.path.convertWindowsPathToPattern(source);
|
|
3662
|
+
}
|
|
3663
|
+
win322.convertPathToPattern = convertPathToPattern3;
|
|
3664
|
+
})(win32 = FastGlob2.win32 || (FastGlob2.win32 = {}));
|
|
3665
|
+
})(FastGlob || (FastGlob = {}));
|
|
3666
|
+
function getWorks(source, _Provider, options) {
|
|
3667
|
+
let patterns = [].concat(source), settings = new settings_1.default(options), tasks = taskManager.generate(patterns, settings), provider = new _Provider(settings);
|
|
3668
|
+
return tasks.map(provider.read, provider);
|
|
3669
|
+
}
|
|
3670
|
+
function assertPatternsInput2(input) {
|
|
3671
|
+
if (![].concat(input).every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)))
|
|
3672
|
+
throw new TypeError("Patterns must be a string (non empty) or an array of strings");
|
|
3673
|
+
}
|
|
3674
|
+
module.exports = FastGlob;
|
|
3675
|
+
}
|
|
3676
|
+
});
|
|
3677
|
+
|
|
3678
|
+
// ../../node_modules/globby/node_modules/ignore/index.js
|
|
3679
|
+
var require_ignore = __commonJS({
|
|
3680
|
+
"../../node_modules/globby/node_modules/ignore/index.js"(exports, module) {
|
|
3681
|
+
function makeArray(subject) {
|
|
3682
|
+
return Array.isArray(subject) ? subject : [subject];
|
|
3683
|
+
}
|
|
3684
|
+
var UNDEFINED = void 0, EMPTY = "", SPACE = " ", ESCAPE = "\\", REGEX_TEST_BLANK_LINE = /^\s+$/, REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/, REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/, REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/, REGEX_SPLITALL_CRLF = /\r?\n/g, REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/, REGEX_TEST_TRAILING_SLASH = /\/$/, SLASH = "/", TMP_KEY_IGNORE = "node-ignore";
|
|
3685
|
+
typeof Symbol < "u" && (TMP_KEY_IGNORE = Symbol.for("node-ignore"));
|
|
3686
|
+
var KEY_IGNORE = TMP_KEY_IGNORE, define = (object, key, value) => (Object.defineProperty(object, key, { value }), value), REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g, RETURN_FALSE = () => !1, sanitizeRange = (range) => range.replace(
|
|
3687
|
+
REGEX_REGEXP_RANGE,
|
|
3688
|
+
(match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
|
|
3689
|
+
), cleanRangeBackSlash = (slashes) => {
|
|
3690
|
+
let { length } = slashes;
|
|
3691
|
+
return slashes.slice(0, length - length % 2);
|
|
3692
|
+
}, REPLACERS = [
|
|
3693
|
+
[
|
|
3694
|
+
// Remove BOM
|
|
3695
|
+
// TODO:
|
|
3696
|
+
// Other similar zero-width characters?
|
|
3697
|
+
/^\uFEFF/,
|
|
3698
|
+
() => EMPTY
|
|
3699
|
+
],
|
|
3700
|
+
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
|
|
3701
|
+
[
|
|
3702
|
+
// (a\ ) -> (a )
|
|
3703
|
+
// (a ) -> (a)
|
|
3704
|
+
// (a ) -> (a)
|
|
3705
|
+
// (a \ ) -> (a )
|
|
3706
|
+
/((?:\\\\)*?)(\\?\s+)$/,
|
|
3707
|
+
(_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
|
|
3708
|
+
],
|
|
3709
|
+
// Replace (\ ) with ' '
|
|
3710
|
+
// (\ ) -> ' '
|
|
3711
|
+
// (\\ ) -> '\\ '
|
|
3712
|
+
// (\\\ ) -> '\\ '
|
|
3713
|
+
[
|
|
3714
|
+
/(\\+?)\s/g,
|
|
3715
|
+
(_, m1) => {
|
|
3716
|
+
let { length } = m1;
|
|
3717
|
+
return m1.slice(0, length - length % 2) + SPACE;
|
|
3718
|
+
}
|
|
3719
|
+
],
|
|
3720
|
+
// Escape metacharacters
|
|
3721
|
+
// which is written down by users but means special for regular expressions.
|
|
3722
|
+
// > There are 12 characters with special meanings:
|
|
3723
|
+
// > - the backslash \,
|
|
3724
|
+
// > - the caret ^,
|
|
3725
|
+
// > - the dollar sign $,
|
|
3726
|
+
// > - the period or dot .,
|
|
3727
|
+
// > - the vertical bar or pipe symbol |,
|
|
3728
|
+
// > - the question mark ?,
|
|
3729
|
+
// > - the asterisk or star *,
|
|
3730
|
+
// > - the plus sign +,
|
|
3731
|
+
// > - the opening parenthesis (,
|
|
3732
|
+
// > - the closing parenthesis ),
|
|
3733
|
+
// > - and the opening square bracket [,
|
|
3734
|
+
// > - the opening curly brace {,
|
|
3735
|
+
// > These special characters are often called "metacharacters".
|
|
3736
|
+
[
|
|
3737
|
+
/[\\$.|*+(){^]/g,
|
|
3738
|
+
(match) => `\\${match}`
|
|
3739
|
+
],
|
|
3740
|
+
[
|
|
3741
|
+
// > a question mark (?) matches a single character
|
|
3742
|
+
/(?!\\)\?/g,
|
|
3743
|
+
() => "[^/]"
|
|
3744
|
+
],
|
|
3745
|
+
// leading slash
|
|
3746
|
+
[
|
|
3747
|
+
// > A leading slash matches the beginning of the pathname.
|
|
3748
|
+
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
|
|
3749
|
+
// A leading slash matches the beginning of the pathname
|
|
3750
|
+
/^\//,
|
|
3751
|
+
() => "^"
|
|
3752
|
+
],
|
|
3753
|
+
// replace special metacharacter slash after the leading slash
|
|
3754
|
+
[
|
|
3755
|
+
/\//g,
|
|
3756
|
+
() => "\\/"
|
|
3757
|
+
],
|
|
3758
|
+
[
|
|
3759
|
+
// > A leading "**" followed by a slash means match in all directories.
|
|
3760
|
+
// > For example, "**/foo" matches file or directory "foo" anywhere,
|
|
3761
|
+
// > the same as pattern "foo".
|
|
3762
|
+
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
|
|
3763
|
+
// > under directory "foo".
|
|
3764
|
+
// Notice that the '*'s have been replaced as '\\*'
|
|
3765
|
+
/^\^*\\\*\\\*\\\//,
|
|
3766
|
+
// '**/foo' <-> 'foo'
|
|
3767
|
+
() => "^(?:.*\\/)?"
|
|
3768
|
+
],
|
|
3769
|
+
// starting
|
|
3770
|
+
[
|
|
3771
|
+
// there will be no leading '/'
|
|
3772
|
+
// (which has been replaced by section "leading slash")
|
|
3773
|
+
// If starts with '**', adding a '^' to the regular expression also works
|
|
3774
|
+
/^(?=[^^])/,
|
|
3775
|
+
function() {
|
|
3776
|
+
return /\/(?!$)/.test(this) ? "^" : "(?:^|\\/)";
|
|
3777
|
+
}
|
|
3778
|
+
],
|
|
3779
|
+
// two globstars
|
|
3780
|
+
[
|
|
3781
|
+
// Use lookahead assertions so that we could match more than one `'/**'`
|
|
3782
|
+
/\\\/\\\*\\\*(?=\\\/|$)/g,
|
|
3783
|
+
// Zero, one or several directories
|
|
3784
|
+
// should not use '*', or it will be replaced by the next replacer
|
|
3785
|
+
// Check if it is not the last `'/**'`
|
|
3786
|
+
(_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
|
|
3787
|
+
],
|
|
3788
|
+
// normal intermediate wildcards
|
|
3789
|
+
[
|
|
3790
|
+
// Never replace escaped '*'
|
|
3791
|
+
// ignore rule '\*' will match the path '*'
|
|
3792
|
+
// 'abc.*/' -> go
|
|
3793
|
+
// 'abc.*' -> skip this rule,
|
|
3794
|
+
// coz trailing single wildcard will be handed by [trailing wildcard]
|
|
3795
|
+
/(^|[^\\]+)(\\\*)+(?=.+)/g,
|
|
3796
|
+
// '*.js' matches '.js'
|
|
3797
|
+
// '*.js' doesn't match 'abc'
|
|
3798
|
+
(_, p1, p2) => {
|
|
3799
|
+
let unescaped = p2.replace(/\\\*/g, "[^\\/]*");
|
|
3800
|
+
return p1 + unescaped;
|
|
3801
|
+
}
|
|
3802
|
+
],
|
|
3803
|
+
[
|
|
3804
|
+
// unescape, revert step 3 except for back slash
|
|
3805
|
+
// For example, if a user escape a '\\*',
|
|
3806
|
+
// after step 3, the result will be '\\\\\\*'
|
|
3807
|
+
/\\\\\\(?=[$.|*+(){^])/g,
|
|
3808
|
+
() => ESCAPE
|
|
3809
|
+
],
|
|
3810
|
+
[
|
|
3811
|
+
// '\\\\' -> '\\'
|
|
3812
|
+
/\\\\/g,
|
|
3813
|
+
() => ESCAPE
|
|
3814
|
+
],
|
|
3815
|
+
[
|
|
3816
|
+
// > The range notation, e.g. [a-zA-Z],
|
|
3817
|
+
// > can be used to match one of the characters in a range.
|
|
3818
|
+
// `\` is escaped by step 3
|
|
3819
|
+
/(\\)?\[([^\]/]*?)(\\*)($|\])/g,
|
|
3820
|
+
(match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" && endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]"
|
|
3821
|
+
],
|
|
3822
|
+
// ending
|
|
3823
|
+
[
|
|
3824
|
+
// 'js' will not match 'js.'
|
|
3825
|
+
// 'ab' will not match 'abc'
|
|
3826
|
+
/(?:[^*])$/,
|
|
3827
|
+
// WTF!
|
|
3828
|
+
// https://git-scm.com/docs/gitignore
|
|
3829
|
+
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
|
|
3830
|
+
// which re-fixes #24, #38
|
|
3831
|
+
// > If there is a separator at the end of the pattern then the pattern
|
|
3832
|
+
// > will only match directories, otherwise the pattern can match both
|
|
3833
|
+
// > files and directories.
|
|
3834
|
+
// 'js*' will not match 'a.js'
|
|
3835
|
+
// 'js/' will not match 'a.js'
|
|
3836
|
+
// 'js' will match 'a.js' and 'a.js/'
|
|
3837
|
+
(match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
|
|
3838
|
+
]
|
|
3839
|
+
], REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/, MODE_IGNORE = "regex", MODE_CHECK_IGNORE = "checkRegex", UNDERSCORE = "_", TRAILING_WILD_CARD_REPLACERS = {
|
|
3840
|
+
[MODE_IGNORE](_, p1) {
|
|
3841
|
+
return `${p1 ? `${p1}[^/]+` : "[^/]*"}(?=$|\\/$)`;
|
|
3842
|
+
},
|
|
3843
|
+
[MODE_CHECK_IGNORE](_, p1) {
|
|
3844
|
+
return `${p1 ? `${p1}[^/]*` : "[^/]*"}(?=$|\\/$)`;
|
|
3845
|
+
}
|
|
3846
|
+
}, makeRegexPrefix = (pattern) => REPLACERS.reduce(
|
|
3847
|
+
(prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
|
|
3848
|
+
pattern
|
|
3849
|
+
), isString = (subject) => typeof subject == "string", checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0, splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean), IgnoreRule = class {
|
|
3850
|
+
constructor(pattern, mark, body, ignoreCase, negative, prefix) {
|
|
3851
|
+
this.pattern = pattern, this.mark = mark, this.negative = negative, define(this, "body", body), define(this, "ignoreCase", ignoreCase), define(this, "regexPrefix", prefix);
|
|
3852
|
+
}
|
|
3853
|
+
get regex() {
|
|
3854
|
+
let key = UNDERSCORE + MODE_IGNORE;
|
|
3855
|
+
return this[key] ? this[key] : this._make(MODE_IGNORE, key);
|
|
3856
|
+
}
|
|
3857
|
+
get checkRegex() {
|
|
3858
|
+
let key = UNDERSCORE + MODE_CHECK_IGNORE;
|
|
3859
|
+
return this[key] ? this[key] : this._make(MODE_CHECK_IGNORE, key);
|
|
3860
|
+
}
|
|
3861
|
+
_make(mode, key) {
|
|
3862
|
+
let str = this.regexPrefix.replace(
|
|
3863
|
+
REGEX_REPLACE_TRAILING_WILDCARD,
|
|
3864
|
+
// It does not need to bind pattern
|
|
3865
|
+
TRAILING_WILD_CARD_REPLACERS[mode]
|
|
3866
|
+
), regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
|
|
3867
|
+
return define(this, key, regex);
|
|
3868
|
+
}
|
|
3869
|
+
}, createRule = ({
|
|
3870
|
+
pattern,
|
|
3871
|
+
mark
|
|
3872
|
+
}, ignoreCase) => {
|
|
3873
|
+
let negative = !1, body = pattern;
|
|
3874
|
+
body.indexOf("!") === 0 && (negative = !0, body = body.substr(1)), body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
|
|
3875
|
+
let regexPrefix = makeRegexPrefix(body);
|
|
3876
|
+
return new IgnoreRule(
|
|
3877
|
+
pattern,
|
|
3878
|
+
mark,
|
|
3879
|
+
body,
|
|
3880
|
+
ignoreCase,
|
|
3881
|
+
negative,
|
|
3882
|
+
regexPrefix
|
|
3883
|
+
);
|
|
3884
|
+
}, RuleManager = class {
|
|
3885
|
+
constructor(ignoreCase) {
|
|
3886
|
+
this._ignoreCase = ignoreCase, this._rules = [];
|
|
3887
|
+
}
|
|
3888
|
+
_add(pattern) {
|
|
3889
|
+
if (pattern && pattern[KEY_IGNORE]) {
|
|
3890
|
+
this._rules = this._rules.concat(pattern._rules._rules), this._added = !0;
|
|
3891
|
+
return;
|
|
3892
|
+
}
|
|
3893
|
+
if (isString(pattern) && (pattern = {
|
|
3894
|
+
pattern
|
|
3895
|
+
}), checkPattern(pattern.pattern)) {
|
|
3896
|
+
let rule = createRule(pattern, this._ignoreCase);
|
|
3897
|
+
this._added = !0, this._rules.push(rule);
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
// @param {Array<string> | string | Ignore} pattern
|
|
3901
|
+
add(pattern) {
|
|
3902
|
+
return this._added = !1, makeArray(
|
|
3903
|
+
isString(pattern) ? splitPattern(pattern) : pattern
|
|
3904
|
+
).forEach(this._add, this), this._added;
|
|
3905
|
+
}
|
|
3906
|
+
// Test one single path without recursively checking parent directories
|
|
3907
|
+
//
|
|
3908
|
+
// - checkUnignored `boolean` whether should check if the path is unignored,
|
|
3909
|
+
// setting `checkUnignored` to `false` could reduce additional
|
|
3910
|
+
// path matching.
|
|
3911
|
+
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
3912
|
+
// @returns {TestResult} true if a file is ignored
|
|
3913
|
+
test(path2, checkUnignored, mode) {
|
|
3914
|
+
let ignored = !1, unignored = !1, matchedRule;
|
|
3915
|
+
this._rules.forEach((rule) => {
|
|
3916
|
+
let { negative } = rule;
|
|
3917
|
+
unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored || !rule[mode].test(path2) || (ignored = !negative, unignored = negative, matchedRule = negative ? UNDEFINED : rule);
|
|
3918
|
+
});
|
|
3919
|
+
let ret = {
|
|
3920
|
+
ignored,
|
|
3921
|
+
unignored
|
|
3922
|
+
};
|
|
3923
|
+
return matchedRule && (ret.rule = matchedRule), ret;
|
|
3924
|
+
}
|
|
3925
|
+
}, throwError = (message, Ctor) => {
|
|
3926
|
+
throw new Ctor(message);
|
|
3927
|
+
}, checkPath = (path2, originalPath, doThrow) => isString(path2) ? path2 ? checkPath.isNotRelative(path2) ? doThrow(
|
|
3928
|
+
`path should be a \`path.relative()\`d string, but got "${originalPath}"`,
|
|
3929
|
+
RangeError
|
|
3930
|
+
) : !0 : doThrow("path must not be empty", TypeError) : doThrow(
|
|
3931
|
+
`path must be a string, but got \`${originalPath}\``,
|
|
3932
|
+
TypeError
|
|
3933
|
+
), isNotRelative = (path2) => REGEX_TEST_INVALID_PATH.test(path2);
|
|
3934
|
+
checkPath.isNotRelative = isNotRelative;
|
|
3935
|
+
checkPath.convert = (p) => p;
|
|
3936
|
+
var Ignore = class {
|
|
3937
|
+
constructor({
|
|
3938
|
+
ignorecase = !0,
|
|
3939
|
+
ignoreCase = ignorecase,
|
|
3940
|
+
allowRelativePaths = !1
|
|
3941
|
+
} = {}) {
|
|
3942
|
+
define(this, KEY_IGNORE, !0), this._rules = new RuleManager(ignoreCase), this._strictPathCheck = !allowRelativePaths, this._initCache();
|
|
3943
|
+
}
|
|
3944
|
+
_initCache() {
|
|
3945
|
+
this._ignoreCache = /* @__PURE__ */ Object.create(null), this._testCache = /* @__PURE__ */ Object.create(null);
|
|
3946
|
+
}
|
|
3947
|
+
add(pattern) {
|
|
3948
|
+
return this._rules.add(pattern) && this._initCache(), this;
|
|
3949
|
+
}
|
|
3950
|
+
// legacy
|
|
3951
|
+
addPattern(pattern) {
|
|
3952
|
+
return this.add(pattern);
|
|
3953
|
+
}
|
|
3954
|
+
// @returns {TestResult}
|
|
3955
|
+
_test(originalPath, cache, checkUnignored, slices) {
|
|
3956
|
+
let path2 = originalPath && checkPath.convert(originalPath);
|
|
3957
|
+
return checkPath(
|
|
3958
|
+
path2,
|
|
3959
|
+
originalPath,
|
|
3960
|
+
this._strictPathCheck ? throwError : RETURN_FALSE
|
|
3961
|
+
), this._t(path2, cache, checkUnignored, slices);
|
|
3962
|
+
}
|
|
3963
|
+
checkIgnore(path2) {
|
|
3964
|
+
if (!REGEX_TEST_TRAILING_SLASH.test(path2))
|
|
3965
|
+
return this.test(path2);
|
|
3966
|
+
let slices = path2.split(SLASH).filter(Boolean);
|
|
3967
|
+
if (slices.pop(), slices.length) {
|
|
3968
|
+
let parent = this._t(
|
|
3969
|
+
slices.join(SLASH) + SLASH,
|
|
3970
|
+
this._testCache,
|
|
3971
|
+
!0,
|
|
3972
|
+
slices
|
|
3973
|
+
);
|
|
3974
|
+
if (parent.ignored)
|
|
3975
|
+
return parent;
|
|
3976
|
+
}
|
|
3977
|
+
return this._rules.test(path2, !1, MODE_CHECK_IGNORE);
|
|
3978
|
+
}
|
|
3979
|
+
_t(path2, cache, checkUnignored, slices) {
|
|
3980
|
+
if (path2 in cache)
|
|
3981
|
+
return cache[path2];
|
|
3982
|
+
if (slices || (slices = path2.split(SLASH).filter(Boolean)), slices.pop(), !slices.length)
|
|
3983
|
+
return cache[path2] = this._rules.test(path2, checkUnignored, MODE_IGNORE);
|
|
3984
|
+
let parent = this._t(
|
|
3985
|
+
slices.join(SLASH) + SLASH,
|
|
3986
|
+
cache,
|
|
3987
|
+
checkUnignored,
|
|
3988
|
+
slices
|
|
3989
|
+
);
|
|
3990
|
+
return cache[path2] = parent.ignored ? parent : this._rules.test(path2, checkUnignored, MODE_IGNORE);
|
|
3991
|
+
}
|
|
3992
|
+
ignores(path2) {
|
|
3993
|
+
return this._test(path2, this._ignoreCache, !1).ignored;
|
|
3994
|
+
}
|
|
3995
|
+
createFilter() {
|
|
3996
|
+
return (path2) => !this.ignores(path2);
|
|
3997
|
+
}
|
|
3998
|
+
filter(paths) {
|
|
3999
|
+
return makeArray(paths).filter(this.createFilter());
|
|
4000
|
+
}
|
|
4001
|
+
// @returns {TestResult}
|
|
4002
|
+
test(path2) {
|
|
4003
|
+
return this._test(path2, this._testCache, !0);
|
|
4004
|
+
}
|
|
4005
|
+
}, factory = (options) => new Ignore(options), isPathValid = (path2) => checkPath(path2 && checkPath.convert(path2), path2, RETURN_FALSE), setupWindows = () => {
|
|
4006
|
+
let makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
4007
|
+
checkPath.convert = makePosix;
|
|
4008
|
+
let REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
4009
|
+
checkPath.isNotRelative = (path2) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path2) || isNotRelative(path2);
|
|
4010
|
+
};
|
|
4011
|
+
// Detect `process` so that it can run in browsers.
|
|
4012
|
+
typeof process < "u" && process.platform === "win32" && setupWindows();
|
|
4013
|
+
module.exports = factory;
|
|
4014
|
+
factory.default = factory;
|
|
4015
|
+
module.exports.isPathValid = isPathValid;
|
|
4016
|
+
define(module.exports, Symbol.for("setupWindows"), setupWindows);
|
|
4017
|
+
}
|
|
4018
|
+
});
|
|
4019
|
+
|
|
4020
|
+
// ../../node_modules/globby/index.js
|
|
4021
|
+
import process3 from "node:process";
|
|
4022
|
+
import fs3 from "node:fs";
|
|
4023
|
+
import nodePath from "node:path";
|
|
4024
|
+
|
|
4025
|
+
// ../../node_modules/globby/node_modules/@sindresorhus/merge-streams/index.js
|
|
4026
|
+
import { on, once } from "node:events";
|
|
4027
|
+
import { PassThrough as PassThroughStream } from "node:stream";
|
|
4028
|
+
import { finished } from "node:stream/promises";
|
|
4029
|
+
function mergeStreams(streams) {
|
|
4030
|
+
if (!Array.isArray(streams))
|
|
4031
|
+
throw new TypeError(`Expected an array, got \`${typeof streams}\`.`);
|
|
4032
|
+
for (let stream of streams)
|
|
4033
|
+
validateStream(stream);
|
|
4034
|
+
let objectMode = streams.some(({ readableObjectMode }) => readableObjectMode), highWaterMark = getHighWaterMark(streams, objectMode), passThroughStream = new MergedStream({
|
|
4035
|
+
objectMode,
|
|
4036
|
+
writableHighWaterMark: highWaterMark,
|
|
4037
|
+
readableHighWaterMark: highWaterMark
|
|
4038
|
+
});
|
|
4039
|
+
for (let stream of streams)
|
|
4040
|
+
passThroughStream.add(stream);
|
|
4041
|
+
return streams.length === 0 && endStream(passThroughStream), passThroughStream;
|
|
4042
|
+
}
|
|
4043
|
+
var getHighWaterMark = (streams, objectMode) => {
|
|
4044
|
+
if (streams.length === 0)
|
|
4045
|
+
return 16384;
|
|
4046
|
+
let highWaterMarks = streams.filter(({ readableObjectMode }) => readableObjectMode === objectMode).map(({ readableHighWaterMark }) => readableHighWaterMark);
|
|
4047
|
+
return Math.max(...highWaterMarks);
|
|
4048
|
+
}, MergedStream = class extends PassThroughStream {
|
|
4049
|
+
#streams = /* @__PURE__ */ new Set([]);
|
|
4050
|
+
#ended = /* @__PURE__ */ new Set([]);
|
|
4051
|
+
#aborted = /* @__PURE__ */ new Set([]);
|
|
4052
|
+
#onFinished;
|
|
4053
|
+
add(stream) {
|
|
4054
|
+
validateStream(stream), !this.#streams.has(stream) && (this.#streams.add(stream), this.#onFinished ??= onMergedStreamFinished(this, this.#streams), endWhenStreamsDone({
|
|
4055
|
+
passThroughStream: this,
|
|
4056
|
+
stream,
|
|
4057
|
+
streams: this.#streams,
|
|
4058
|
+
ended: this.#ended,
|
|
4059
|
+
aborted: this.#aborted,
|
|
4060
|
+
onFinished: this.#onFinished
|
|
4061
|
+
}), stream.pipe(this, { end: !1 }));
|
|
4062
|
+
}
|
|
4063
|
+
remove(stream) {
|
|
4064
|
+
return validateStream(stream), this.#streams.has(stream) ? (stream.unpipe(this), !0) : !1;
|
|
4065
|
+
}
|
|
4066
|
+
}, onMergedStreamFinished = async (passThroughStream, streams) => {
|
|
4067
|
+
updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT);
|
|
4068
|
+
let controller = new AbortController();
|
|
4069
|
+
try {
|
|
4070
|
+
await Promise.race([
|
|
4071
|
+
onMergedStreamEnd(passThroughStream, controller),
|
|
4072
|
+
onInputStreamsUnpipe(passThroughStream, streams, controller)
|
|
4073
|
+
]);
|
|
4074
|
+
} finally {
|
|
4075
|
+
controller.abort(), updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT);
|
|
4076
|
+
}
|
|
4077
|
+
}, onMergedStreamEnd = async (passThroughStream, { signal }) => {
|
|
4078
|
+
await finished(passThroughStream, { signal, cleanup: !0 });
|
|
4079
|
+
}, onInputStreamsUnpipe = async (passThroughStream, streams, { signal }) => {
|
|
4080
|
+
for await (let [unpipedStream] of on(passThroughStream, "unpipe", { signal }))
|
|
4081
|
+
streams.has(unpipedStream) && unpipedStream.emit(unpipeEvent);
|
|
4082
|
+
}, validateStream = (stream) => {
|
|
4083
|
+
if (typeof stream?.pipe != "function")
|
|
4084
|
+
throw new TypeError(`Expected a readable stream, got: \`${typeof stream}\`.`);
|
|
4085
|
+
}, endWhenStreamsDone = async ({ passThroughStream, stream, streams, ended, aborted, onFinished }) => {
|
|
4086
|
+
updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM);
|
|
4087
|
+
let controller = new AbortController();
|
|
4088
|
+
try {
|
|
4089
|
+
await Promise.race([
|
|
4090
|
+
afterMergedStreamFinished(onFinished, stream),
|
|
4091
|
+
onInputStreamEnd({ passThroughStream, stream, streams, ended, aborted, controller }),
|
|
4092
|
+
onInputStreamUnpipe({ stream, streams, ended, aborted, controller })
|
|
4093
|
+
]);
|
|
4094
|
+
} finally {
|
|
4095
|
+
controller.abort(), updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM);
|
|
4096
|
+
}
|
|
4097
|
+
streams.size === ended.size + aborted.size && (ended.size === 0 && aborted.size > 0 ? abortStream(passThroughStream) : endStream(passThroughStream));
|
|
4098
|
+
}, isAbortError = (error) => error?.code === "ERR_STREAM_PREMATURE_CLOSE", afterMergedStreamFinished = async (onFinished, stream) => {
|
|
4099
|
+
try {
|
|
4100
|
+
await onFinished, abortStream(stream);
|
|
4101
|
+
} catch (error) {
|
|
4102
|
+
isAbortError(error) ? abortStream(stream) : errorStream(stream, error);
|
|
4103
|
+
}
|
|
4104
|
+
}, onInputStreamEnd = async ({ passThroughStream, stream, streams, ended, aborted, controller: { signal } }) => {
|
|
4105
|
+
try {
|
|
4106
|
+
await finished(stream, { signal, cleanup: !0, readable: !0, writable: !1 }), streams.has(stream) && ended.add(stream);
|
|
4107
|
+
} catch (error) {
|
|
4108
|
+
if (signal.aborted || !streams.has(stream))
|
|
4109
|
+
return;
|
|
4110
|
+
isAbortError(error) ? aborted.add(stream) : errorStream(passThroughStream, error);
|
|
4111
|
+
}
|
|
4112
|
+
}, onInputStreamUnpipe = async ({ stream, streams, ended, aborted, controller: { signal } }) => {
|
|
4113
|
+
await once(stream, unpipeEvent, { signal }), streams.delete(stream), ended.delete(stream), aborted.delete(stream);
|
|
4114
|
+
}, unpipeEvent = Symbol("unpipe"), endStream = (stream) => {
|
|
4115
|
+
stream.writable && stream.end();
|
|
4116
|
+
}, abortStream = (stream) => {
|
|
4117
|
+
(stream.readable || stream.writable) && stream.destroy();
|
|
4118
|
+
}, errorStream = (stream, error) => {
|
|
4119
|
+
stream.destroyed || (stream.once("error", noop), stream.destroy(error));
|
|
4120
|
+
}, noop = () => {
|
|
4121
|
+
}, updateMaxListeners = (passThroughStream, increment) => {
|
|
4122
|
+
let maxListeners = passThroughStream.getMaxListeners();
|
|
4123
|
+
maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY && passThroughStream.setMaxListeners(maxListeners + increment);
|
|
4124
|
+
}, PASSTHROUGH_LISTENERS_COUNT = 2, PASSTHROUGH_LISTENERS_PER_STREAM = 1;
|
|
4125
|
+
|
|
4126
|
+
// ../../node_modules/globby/index.js
|
|
4127
|
+
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
4128
|
+
|
|
4129
|
+
// ../../node_modules/globby/node_modules/path-type/index.js
|
|
4130
|
+
import fs from "node:fs";
|
|
4131
|
+
import fsPromises from "node:fs/promises";
|
|
4132
|
+
async function isType(fsStatType, statsMethodName, filePath) {
|
|
4133
|
+
if (typeof filePath != "string")
|
|
4134
|
+
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
4135
|
+
try {
|
|
4136
|
+
return (await fsPromises[fsStatType](filePath))[statsMethodName]();
|
|
4137
|
+
} catch (error) {
|
|
4138
|
+
if (error.code === "ENOENT")
|
|
4139
|
+
return !1;
|
|
4140
|
+
throw error;
|
|
4141
|
+
}
|
|
4142
|
+
}
|
|
4143
|
+
function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
4144
|
+
if (typeof filePath != "string")
|
|
4145
|
+
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
4146
|
+
try {
|
|
4147
|
+
return fs[fsStatType](filePath)[statsMethodName]();
|
|
4148
|
+
} catch (error) {
|
|
4149
|
+
if (error.code === "ENOENT")
|
|
4150
|
+
return !1;
|
|
4151
|
+
throw error;
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
4154
|
+
var isFile = isType.bind(void 0, "stat", "isFile"), isDirectory = isType.bind(void 0, "stat", "isDirectory"), isSymlink = isType.bind(void 0, "lstat", "isSymbolicLink"), isFileSync = isTypeSync.bind(void 0, "statSync", "isFile"), isDirectorySync = isTypeSync.bind(void 0, "statSync", "isDirectory"), isSymlinkSync = isTypeSync.bind(void 0, "lstatSync", "isSymbolicLink");
|
|
4155
|
+
|
|
4156
|
+
// ../../node_modules/unicorn-magic/node.js
|
|
4157
|
+
import { promisify } from "node:util";
|
|
4158
|
+
import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "node:child_process";
|
|
4159
|
+
import { fileURLToPath } from "node:url";
|
|
4160
|
+
var execFileOriginal = promisify(execFileCallback);
|
|
4161
|
+
function toPath(urlOrPath) {
|
|
4162
|
+
return urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
4163
|
+
}
|
|
4164
|
+
var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
4165
|
+
|
|
4166
|
+
// ../../node_modules/globby/ignore.js
|
|
4167
|
+
var import_fast_glob = __toESM(require_out4(), 1), import_ignore = __toESM(require_ignore(), 1);
|
|
4168
|
+
import process2 from "node:process";
|
|
4169
|
+
import fs2 from "node:fs";
|
|
4170
|
+
import fsPromises2 from "node:fs/promises";
|
|
4171
|
+
import path from "node:path";
|
|
4172
|
+
|
|
4173
|
+
// ../../node_modules/slash/index.js
|
|
4174
|
+
function slash(path2) {
|
|
4175
|
+
return path2.startsWith("\\\\?\\") ? path2 : path2.replace(/\\/g, "/");
|
|
4176
|
+
}
|
|
4177
|
+
|
|
4178
|
+
// ../../node_modules/globby/utilities.js
|
|
4179
|
+
var isNegativePattern = (pattern) => pattern[0] === "!";
|
|
4180
|
+
|
|
4181
|
+
// ../../node_modules/globby/ignore.js
|
|
4182
|
+
var defaultIgnoredDirectories = [
|
|
4183
|
+
"**/node_modules",
|
|
4184
|
+
"**/flow-typed",
|
|
4185
|
+
"**/coverage",
|
|
4186
|
+
"**/.git"
|
|
4187
|
+
], ignoreFilesGlobOptions = {
|
|
4188
|
+
absolute: !0,
|
|
4189
|
+
dot: !0
|
|
4190
|
+
}, GITIGNORE_FILES_PATTERN = "**/.gitignore", applyBaseToPattern = (pattern, base) => isNegativePattern(pattern) ? "!" + path.posix.join(base, pattern.slice(1)) : path.posix.join(base, pattern), parseIgnoreFile = (file, cwd) => {
|
|
4191
|
+
let base = slash(path.relative(cwd, path.dirname(file.filePath)));
|
|
4192
|
+
return file.content.split(/\r?\n/).filter((line) => line && !line.startsWith("#")).map((pattern) => applyBaseToPattern(pattern, base));
|
|
4193
|
+
}, toRelativePath = (fileOrDirectory, cwd) => {
|
|
4194
|
+
if (cwd = slash(cwd), path.isAbsolute(fileOrDirectory)) {
|
|
4195
|
+
if (slash(fileOrDirectory).startsWith(cwd))
|
|
4196
|
+
return path.relative(cwd, fileOrDirectory);
|
|
4197
|
+
throw new Error(`Path ${fileOrDirectory} is not in cwd ${cwd}`);
|
|
4198
|
+
}
|
|
4199
|
+
return fileOrDirectory;
|
|
4200
|
+
}, getIsIgnoredPredicate = (files, cwd) => {
|
|
4201
|
+
let patterns = files.flatMap((file) => parseIgnoreFile(file, cwd)), ignores = (0, import_ignore.default)().add(patterns);
|
|
4202
|
+
return (fileOrDirectory) => (fileOrDirectory = toPath(fileOrDirectory), fileOrDirectory = toRelativePath(fileOrDirectory, cwd), fileOrDirectory ? ignores.ignores(slash(fileOrDirectory)) : !1);
|
|
4203
|
+
}, normalizeOptions = (options = {}) => ({
|
|
4204
|
+
cwd: toPath(options.cwd) ?? process2.cwd(),
|
|
4205
|
+
suppressErrors: !!options.suppressErrors,
|
|
4206
|
+
deep: typeof options.deep == "number" ? options.deep : Number.POSITIVE_INFINITY,
|
|
4207
|
+
ignore: [...options.ignore ?? [], ...defaultIgnoredDirectories]
|
|
4208
|
+
}), isIgnoredByIgnoreFiles = async (patterns, options) => {
|
|
4209
|
+
let { cwd, suppressErrors, deep, ignore } = normalizeOptions(options), paths = await (0, import_fast_glob.default)(patterns, {
|
|
4210
|
+
cwd,
|
|
4211
|
+
suppressErrors,
|
|
4212
|
+
deep,
|
|
4213
|
+
ignore,
|
|
4214
|
+
...ignoreFilesGlobOptions
|
|
4215
|
+
}), files = await Promise.all(
|
|
4216
|
+
paths.map(async (filePath) => ({
|
|
4217
|
+
filePath,
|
|
4218
|
+
content: await fsPromises2.readFile(filePath, "utf8")
|
|
4219
|
+
}))
|
|
4220
|
+
);
|
|
4221
|
+
return getIsIgnoredPredicate(files, cwd);
|
|
4222
|
+
}, isIgnoredByIgnoreFilesSync = (patterns, options) => {
|
|
4223
|
+
let { cwd, suppressErrors, deep, ignore } = normalizeOptions(options), files = import_fast_glob.default.sync(patterns, {
|
|
4224
|
+
cwd,
|
|
4225
|
+
suppressErrors,
|
|
4226
|
+
deep,
|
|
4227
|
+
ignore,
|
|
4228
|
+
...ignoreFilesGlobOptions
|
|
4229
|
+
}).map((filePath) => ({
|
|
4230
|
+
filePath,
|
|
4231
|
+
content: fs2.readFileSync(filePath, "utf8")
|
|
4232
|
+
}));
|
|
4233
|
+
return getIsIgnoredPredicate(files, cwd);
|
|
4234
|
+
}, isGitIgnored = (options) => isIgnoredByIgnoreFiles(GITIGNORE_FILES_PATTERN, options), isGitIgnoredSync = (options) => isIgnoredByIgnoreFilesSync(GITIGNORE_FILES_PATTERN, options);
|
|
4235
|
+
|
|
4236
|
+
// ../../node_modules/globby/index.js
|
|
4237
|
+
var assertPatternsInput = (patterns) => {
|
|
4238
|
+
if (patterns.some((pattern) => typeof pattern != "string"))
|
|
4239
|
+
throw new TypeError("Patterns must be a string or an array of strings");
|
|
4240
|
+
}, normalizePathForDirectoryGlob = (filePath, cwd) => {
|
|
4241
|
+
let path2 = isNegativePattern(filePath) ? filePath.slice(1) : filePath;
|
|
4242
|
+
return nodePath.isAbsolute(path2) ? path2 : nodePath.join(cwd, path2);
|
|
4243
|
+
}, getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
4244
|
+
let extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
|
|
4245
|
+
return files ? files.map((file) => nodePath.posix.join(directoryPath, `**/${nodePath.extname(file) ? file : `${file}${extensionGlob}`}`)) : [nodePath.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
|
|
4246
|
+
}, directoryToGlob = async (directoryPaths, {
|
|
4247
|
+
cwd = process3.cwd(),
|
|
4248
|
+
files,
|
|
4249
|
+
extensions
|
|
4250
|
+
} = {}) => (await Promise.all(
|
|
4251
|
+
directoryPaths.map(async (directoryPath) => await isDirectory(normalizePathForDirectoryGlob(directoryPath, cwd)) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath)
|
|
4252
|
+
)).flat(), directoryToGlobSync = (directoryPaths, {
|
|
4253
|
+
cwd = process3.cwd(),
|
|
4254
|
+
files,
|
|
4255
|
+
extensions
|
|
4256
|
+
} = {}) => directoryPaths.flatMap((directoryPath) => isDirectorySync(normalizePathForDirectoryGlob(directoryPath, cwd)) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath), toPatternsArray = (patterns) => (patterns = [...new Set([patterns].flat())], assertPatternsInput(patterns), patterns), checkCwdOption = (cwd) => {
|
|
4257
|
+
if (!cwd)
|
|
4258
|
+
return;
|
|
4259
|
+
let stat;
|
|
4260
|
+
try {
|
|
4261
|
+
stat = fs3.statSync(cwd);
|
|
4262
|
+
} catch {
|
|
4263
|
+
return;
|
|
4264
|
+
}
|
|
4265
|
+
if (!stat.isDirectory())
|
|
4266
|
+
throw new Error("The `cwd` option must be a path to a directory");
|
|
4267
|
+
}, normalizeOptions2 = (options = {}) => (options = {
|
|
4268
|
+
...options,
|
|
4269
|
+
ignore: options.ignore ?? [],
|
|
4270
|
+
expandDirectories: options.expandDirectories ?? !0,
|
|
4271
|
+
cwd: toPath(options.cwd)
|
|
4272
|
+
}, checkCwdOption(options.cwd), options), normalizeArguments = (function_) => async (patterns, options) => function_(toPatternsArray(patterns), normalizeOptions2(options)), normalizeArgumentsSync = (function_) => (patterns, options) => function_(toPatternsArray(patterns), normalizeOptions2(options)), getIgnoreFilesPatterns = (options) => {
|
|
4273
|
+
let { ignoreFiles, gitignore } = options, patterns = ignoreFiles ? toPatternsArray(ignoreFiles) : [];
|
|
4274
|
+
return gitignore && patterns.push(GITIGNORE_FILES_PATTERN), patterns;
|
|
4275
|
+
}, getFilter = async (options) => {
|
|
4276
|
+
let ignoreFilesPatterns = getIgnoreFilesPatterns(options);
|
|
4277
|
+
return createFilterFunction(
|
|
4278
|
+
ignoreFilesPatterns.length > 0 && await isIgnoredByIgnoreFiles(ignoreFilesPatterns, options)
|
|
4279
|
+
);
|
|
4280
|
+
}, getFilterSync = (options) => {
|
|
4281
|
+
let ignoreFilesPatterns = getIgnoreFilesPatterns(options);
|
|
4282
|
+
return createFilterFunction(
|
|
4283
|
+
ignoreFilesPatterns.length > 0 && isIgnoredByIgnoreFilesSync(ignoreFilesPatterns, options)
|
|
4284
|
+
);
|
|
4285
|
+
}, createFilterFunction = (isIgnored) => {
|
|
4286
|
+
let seen = /* @__PURE__ */ new Set();
|
|
4287
|
+
return (fastGlobResult) => {
|
|
4288
|
+
let pathKey = nodePath.normalize(fastGlobResult.path ?? fastGlobResult);
|
|
4289
|
+
return seen.has(pathKey) || isIgnored && isIgnored(pathKey) ? !1 : (seen.add(pathKey), !0);
|
|
4290
|
+
};
|
|
4291
|
+
}, unionFastGlobResults = (results, filter) => results.flat().filter((fastGlobResult) => filter(fastGlobResult)), convertNegativePatterns = (patterns, options) => {
|
|
4292
|
+
let tasks = [];
|
|
4293
|
+
for (; patterns.length > 0; ) {
|
|
4294
|
+
let index = patterns.findIndex((pattern) => isNegativePattern(pattern));
|
|
4295
|
+
if (index === -1) {
|
|
4296
|
+
tasks.push({ patterns, options });
|
|
4297
|
+
break;
|
|
4298
|
+
}
|
|
4299
|
+
let ignorePattern = patterns[index].slice(1);
|
|
4300
|
+
for (let task of tasks)
|
|
4301
|
+
task.options.ignore.push(ignorePattern);
|
|
4302
|
+
index !== 0 && tasks.push({
|
|
4303
|
+
patterns: patterns.slice(0, index),
|
|
4304
|
+
options: {
|
|
4305
|
+
...options,
|
|
4306
|
+
ignore: [
|
|
4307
|
+
...options.ignore,
|
|
4308
|
+
ignorePattern
|
|
4309
|
+
]
|
|
4310
|
+
}
|
|
4311
|
+
}), patterns = patterns.slice(index + 1);
|
|
4312
|
+
}
|
|
4313
|
+
return tasks;
|
|
4314
|
+
}, normalizeExpandDirectoriesOption = (options, cwd) => ({
|
|
4315
|
+
...cwd ? { cwd } : {},
|
|
4316
|
+
...Array.isArray(options) ? { files: options } : options
|
|
4317
|
+
}), generateTasks = async (patterns, options) => {
|
|
4318
|
+
let globTasks = convertNegativePatterns(patterns, options), { cwd, expandDirectories } = options;
|
|
4319
|
+
if (!expandDirectories)
|
|
4320
|
+
return globTasks;
|
|
4321
|
+
let directoryToGlobOptions = normalizeExpandDirectoriesOption(expandDirectories, cwd);
|
|
4322
|
+
return Promise.all(
|
|
4323
|
+
globTasks.map(async (task) => {
|
|
4324
|
+
let { patterns: patterns2, options: options2 } = task;
|
|
4325
|
+
return [
|
|
4326
|
+
patterns2,
|
|
4327
|
+
options2.ignore
|
|
4328
|
+
] = await Promise.all([
|
|
4329
|
+
directoryToGlob(patterns2, directoryToGlobOptions),
|
|
4330
|
+
directoryToGlob(options2.ignore, { cwd })
|
|
4331
|
+
]), { patterns: patterns2, options: options2 };
|
|
4332
|
+
})
|
|
4333
|
+
);
|
|
4334
|
+
}, generateTasksSync = (patterns, options) => {
|
|
4335
|
+
let globTasks = convertNegativePatterns(patterns, options), { cwd, expandDirectories } = options;
|
|
4336
|
+
if (!expandDirectories)
|
|
4337
|
+
return globTasks;
|
|
4338
|
+
let directoryToGlobSyncOptions = normalizeExpandDirectoriesOption(expandDirectories, cwd);
|
|
4339
|
+
return globTasks.map((task) => {
|
|
4340
|
+
let { patterns: patterns2, options: options2 } = task;
|
|
4341
|
+
return patterns2 = directoryToGlobSync(patterns2, directoryToGlobSyncOptions), options2.ignore = directoryToGlobSync(options2.ignore, { cwd }), { patterns: patterns2, options: options2 };
|
|
4342
|
+
});
|
|
4343
|
+
}, globby = normalizeArguments(async (patterns, options) => {
|
|
4344
|
+
let [
|
|
4345
|
+
tasks,
|
|
4346
|
+
filter
|
|
4347
|
+
] = await Promise.all([
|
|
4348
|
+
generateTasks(patterns, options),
|
|
4349
|
+
getFilter(options)
|
|
4350
|
+
]), results = await Promise.all(tasks.map((task) => (0, import_fast_glob2.default)(task.patterns, task.options)));
|
|
4351
|
+
return unionFastGlobResults(results, filter);
|
|
4352
|
+
}), globbySync = normalizeArgumentsSync((patterns, options) => {
|
|
4353
|
+
let tasks = generateTasksSync(patterns, options), filter = getFilterSync(options), results = tasks.map((task) => import_fast_glob2.default.sync(task.patterns, task.options));
|
|
4354
|
+
return unionFastGlobResults(results, filter);
|
|
4355
|
+
}), globbyStream = normalizeArgumentsSync((patterns, options) => {
|
|
4356
|
+
let tasks = generateTasksSync(patterns, options), filter = getFilterSync(options), streams = tasks.map((task) => import_fast_glob2.default.stream(task.patterns, task.options));
|
|
4357
|
+
return mergeStreams(streams).filter((fastGlobResult) => filter(fastGlobResult));
|
|
4358
|
+
}), isDynamicPattern = normalizeArgumentsSync(
|
|
4359
|
+
(patterns, options) => patterns.some((pattern) => import_fast_glob2.default.isDynamicPattern(pattern, options))
|
|
4360
|
+
), generateGlobTasks = normalizeArguments(generateTasks), generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync), { convertPathToPattern } = import_fast_glob2.default;
|
|
4361
|
+
|
|
4362
|
+
export {
|
|
4363
|
+
slash,
|
|
4364
|
+
isIgnoredByIgnoreFiles,
|
|
4365
|
+
isIgnoredByIgnoreFilesSync,
|
|
4366
|
+
isGitIgnored,
|
|
4367
|
+
isGitIgnoredSync,
|
|
4368
|
+
globby,
|
|
4369
|
+
globbySync,
|
|
4370
|
+
globbyStream,
|
|
4371
|
+
isDynamicPattern,
|
|
4372
|
+
generateGlobTasks,
|
|
4373
|
+
generateGlobTasksSync,
|
|
4374
|
+
convertPathToPattern
|
|
4375
|
+
};
|