@powerlines/deepkit 0.6.167 → 0.7.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/bin/deepkit-install.cjs +55 -90
- package/dist/capnp-BLx1WTBU.cjs +5175 -0
- package/dist/capnp-BiGNkOmV.mjs +4905 -0
- package/dist/capnp.cjs +47 -186
- package/dist/capnp.d.cts +78 -77
- package/dist/{capnp.d.ts → capnp.d.mts} +78 -77
- package/dist/capnp.mjs +3 -0
- package/dist/chunk-C0xms8kb.cjs +34 -0
- package/dist/esbuild-plugin.cjs +47 -11
- package/dist/esbuild-plugin.d.cts +20 -18
- package/dist/esbuild-plugin.d.mts +35 -0
- package/dist/esbuild-plugin.mjs +48 -0
- package/dist/index.cjs +69 -250
- package/dist/index.d.cts +10 -19
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +11 -0
- package/dist/reflect-type.cjs +24 -12
- package/dist/reflect-type.d.cts +7 -5
- package/dist/{reflect-type.d.ts → reflect-type.d.mts} +7 -5
- package/dist/reflect-type.mjs +24 -0
- package/dist/{reflection-9KUpjPqV.d.cts → reflection-BwdnCwaK.d.cts} +11 -17
- package/dist/{reflection-9KUpjPqV.d.ts → reflection-D9R8cdSo.d.mts} +26 -32
- package/dist/resolve-reflections.cjs +15 -9
- package/dist/resolve-reflections.d.cts +4 -2
- package/dist/{resolve-reflections.d.ts → resolve-reflections.d.mts} +4 -2
- package/dist/resolve-reflections.mjs +16 -0
- package/dist/rolldown-plugin.cjs +44 -11
- package/dist/rolldown-plugin.d.cts +5 -3
- package/dist/{rolldown-plugin.d.ts → rolldown-plugin.d.mts} +5 -3
- package/dist/rolldown-plugin.mjs +45 -0
- package/dist/transformer.cjs +52 -13
- package/dist/transformer.d.cts +6 -4
- package/dist/{transformer.d.ts → transformer.d.mts} +6 -4
- package/dist/transformer.mjs +51 -0
- package/dist/transpile.cjs +29 -10
- package/dist/transpile.d.cts +6 -4
- package/dist/{transpile.d.ts → transpile.d.mts} +6 -4
- package/dist/transpile.mjs +29 -0
- package/dist/types.cjs +0 -4
- package/dist/types.d.cts +9 -9
- package/dist/{types.d.ts → types.d.mts} +9 -9
- package/dist/types.mjs +1 -0
- package/dist/utilities.cjs +116 -33
- package/dist/utilities.d.cts +4 -2
- package/dist/{utilities.d.ts → utilities.d.mts} +4 -2
- package/dist/utilities.mjs +111 -0
- package/dist/vendor/core.cjs +1240 -513
- package/dist/vendor/core.mjs +1116 -0
- package/dist/vendor/string-BoXo0wS7.cjs +2983 -0
- package/dist/vendor/string-BuMgdahD.mjs +2467 -0
- package/dist/vendor/type-BMLjRtLY.cjs +202 -0
- package/dist/vendor/type-Dgeqs-rL.mjs +190 -0
- package/dist/vendor/type-compiler/compiler-BUrWMhGi.cjs +6792 -0
- package/dist/vendor/type-compiler/compiler-Bg8jX6qU.mjs +6739 -0
- package/dist/vendor/type-compiler/compiler-D1z5h1MK.d.cts +578 -0
- package/dist/vendor/type-compiler/compiler-Nkxc4PLJ.d.mts +578 -0
- package/dist/vendor/type-compiler/compiler.cjs +11 -43
- package/dist/vendor/type-compiler/compiler.d.cts +2 -3
- package/dist/vendor/type-compiler/compiler.d.mts +2 -0
- package/dist/vendor/type-compiler/compiler.mjs +3 -0
- package/dist/vendor/type-compiler/config-BEX924PC.cjs +3709 -0
- package/dist/vendor/type-compiler/config-B_cKkYZm.d.cts +116 -0
- package/dist/vendor/type-compiler/config-D9DM7Du_.d.mts +116 -0
- package/dist/vendor/type-compiler/config-y0HNkbCH.mjs +3640 -0
- package/dist/vendor/type-compiler/config.cjs +9 -34
- package/dist/vendor/type-compiler/config.d.cts +2 -1
- package/dist/vendor/type-compiler/config.d.mts +2 -0
- package/dist/vendor/type-compiler/config.mjs +3 -0
- package/dist/vendor/type-compiler/index.cjs +56 -129
- package/dist/vendor/type-compiler/index.d.cts +22 -3
- package/dist/vendor/type-compiler/index.d.mts +22 -0
- package/dist/vendor/type-compiler/index.mjs +50 -0
- package/dist/vendor/type-spec.cjs +11 -12
- package/dist/vendor/type-spec.mjs +3 -0
- package/dist/vendor/type.cjs +8407 -17892
- package/dist/vendor/type.d.cts +10 -196
- package/dist/vendor/{type.d.ts → type.d.mts} +10 -196
- package/dist/vendor/type.mjs +9109 -0
- package/package.json +43 -31
- package/schemas/reflection.cjs +4018 -4129
- package/schemas/reflection.d.cts +30 -38
- package/schemas/{reflection.d.ts → reflection.d.mts} +30 -38
- package/schemas/reflection.mjs +4036 -0
- package/dist/capnp.js +0 -2
- package/dist/chunk-23YNDVRG.js +0 -34
- package/dist/chunk-27RKMKSF.cjs +0 -50
- package/dist/chunk-2XDQUCXZ.js +0 -2392
- package/dist/chunk-34OFD7LS.cjs +0 -68
- package/dist/chunk-7FXYDYVQ.cjs +0 -5246
- package/dist/chunk-7QZGCBH7.cjs +0 -11
- package/dist/chunk-ALM6UMVU.js +0 -9
- package/dist/chunk-BLLXF42T.cjs +0 -41
- package/dist/chunk-H3Q3XL3D.js +0 -19
- package/dist/chunk-HPVJ6OV3.cjs +0 -31
- package/dist/chunk-JQUKKAFM.js +0 -48
- package/dist/chunk-KK7TQA7L.cjs +0 -25
- package/dist/chunk-NPV2346T.js +0 -25
- package/dist/chunk-ORA4UQMU.cjs +0 -2
- package/dist/chunk-OUGDFUKJ.cjs +0 -2400
- package/dist/chunk-OULCUN6I.js +0 -1
- package/dist/chunk-SHUYVCID.js +0 -4
- package/dist/chunk-TDYIUJGY.js +0 -5180
- package/dist/chunk-USNT2KNT.cjs +0 -6
- package/dist/chunk-WYEFKIRL.js +0 -66
- package/dist/esbuild-plugin.d.ts +0 -33
- package/dist/esbuild-plugin.js +0 -4
- package/dist/index.d.ts +0 -19
- package/dist/index.js +0 -10
- package/dist/reflect-type.js +0 -5
- package/dist/resolve-reflections.js +0 -2
- package/dist/rolldown-plugin.js +0 -4
- package/dist/transformer.js +0 -2
- package/dist/transpile.js +0 -3
- package/dist/types.js +0 -1
- package/dist/utilities.js +0 -2
- package/dist/vendor/chunk-5BKT4CS5.js +0 -28
- package/dist/vendor/chunk-BLN7QVCP.js +0 -3704
- package/dist/vendor/chunk-BR2FK5K7.js +0 -109
- package/dist/vendor/chunk-EPQZMVJO.cjs +0 -3859
- package/dist/vendor/chunk-IFK6AU6M.cjs +0 -42
- package/dist/vendor/chunk-SHDAXCXF.cjs +0 -115
- package/dist/vendor/core.js +0 -2
- package/dist/vendor/type-compiler/chunk-3LL3TSRJ.js +0 -3762
- package/dist/vendor/type-compiler/chunk-CUTGHVNY.js +0 -7100
- package/dist/vendor/type-compiler/chunk-IAWCLVUK.cjs +0 -3780
- package/dist/vendor/type-compiler/chunk-UIWPG352.cjs +0 -7114
- package/dist/vendor/type-compiler/compiler.d.ts +0 -3
- package/dist/vendor/type-compiler/compiler.js +0 -5
- package/dist/vendor/type-compiler/config.d.ts +0 -1
- package/dist/vendor/type-compiler/config.js +0 -5
- package/dist/vendor/type-compiler/index.d.ts +0 -3
- package/dist/vendor/type-compiler/index.js +0 -66
- package/dist/vendor/type-spec.js +0 -2
- package/dist/vendor/type.js +0 -18359
- package/schemas/reflection.js +0 -4153
- /package/dist/vendor/{core.d.ts → core.d.mts} +0 -0
- /package/dist/vendor/{type-spec.d.ts → type-spec.d.mts} +0 -0
|
@@ -0,0 +1,3709 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
let typescript = require("typescript");
|
|
30
|
+
typescript = __toESM(typescript);
|
|
31
|
+
let node_path = require("node:path");
|
|
32
|
+
let node_fs = require("node:fs");
|
|
33
|
+
|
|
34
|
+
//#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/debug.js
|
|
35
|
+
function isDebug(level = 1) {
|
|
36
|
+
const expected = "deepkit" + (level > 1 ? "+".repeat(level - 1) : "");
|
|
37
|
+
return "undefined" !== typeof process && "string" === typeof process.env.DEBUG && process.env.DEBUG.includes(expected);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* First level debugging with DEBUG=deepkit
|
|
41
|
+
*/
|
|
42
|
+
function debug(...message) {
|
|
43
|
+
if (isDebug(1)) console.debug(...message);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Second level debugging with DEBUG=deepkit+
|
|
47
|
+
*/
|
|
48
|
+
function debug2(...message) {
|
|
49
|
+
if (isDebug(2)) console.debug(...message);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
|
|
54
|
+
var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
55
|
+
exports.isInteger = (num) => {
|
|
56
|
+
if (typeof num === "number") return Number.isInteger(num);
|
|
57
|
+
if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
|
|
58
|
+
return false;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Find a node of the given type
|
|
62
|
+
*/
|
|
63
|
+
exports.find = (node, type) => node.nodes.find((node) => node.type === type);
|
|
64
|
+
/**
|
|
65
|
+
* Find a node of the given type
|
|
66
|
+
*/
|
|
67
|
+
exports.exceedsLimit = (min, max, step = 1, limit) => {
|
|
68
|
+
if (limit === false) return false;
|
|
69
|
+
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
70
|
+
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Escape the given node with '\\' before node.value
|
|
74
|
+
*/
|
|
75
|
+
exports.escapeNode = (block, n = 0, type) => {
|
|
76
|
+
const node = block.nodes[n];
|
|
77
|
+
if (!node) return;
|
|
78
|
+
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
79
|
+
if (node.escaped !== true) {
|
|
80
|
+
node.value = "\\" + node.value;
|
|
81
|
+
node.escaped = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Returns true if the given brace node should be enclosed in literal braces
|
|
87
|
+
*/
|
|
88
|
+
exports.encloseBrace = (node) => {
|
|
89
|
+
if (node.type !== "brace") return false;
|
|
90
|
+
if (node.commas >> 0 + node.ranges >> 0 === 0) {
|
|
91
|
+
node.invalid = true;
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Returns true if a brace node is invalid.
|
|
98
|
+
*/
|
|
99
|
+
exports.isInvalidBrace = (block) => {
|
|
100
|
+
if (block.type !== "brace") return false;
|
|
101
|
+
if (block.invalid === true || block.dollar) return true;
|
|
102
|
+
if (block.commas >> 0 + block.ranges >> 0 === 0) {
|
|
103
|
+
block.invalid = true;
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
if (block.open !== true || block.close !== true) {
|
|
107
|
+
block.invalid = true;
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Returns true if a node is an open or close node
|
|
114
|
+
*/
|
|
115
|
+
exports.isOpenOrClose = (node) => {
|
|
116
|
+
if (node.type === "open" || node.type === "close") return true;
|
|
117
|
+
return node.open === true || node.close === true;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Reduce an array of text nodes.
|
|
121
|
+
*/
|
|
122
|
+
exports.reduce = (nodes) => nodes.reduce((acc, node) => {
|
|
123
|
+
if (node.type === "text") acc.push(node.value);
|
|
124
|
+
if (node.type === "range") node.type = "text";
|
|
125
|
+
return acc;
|
|
126
|
+
}, []);
|
|
127
|
+
/**
|
|
128
|
+
* Flatten an array
|
|
129
|
+
*/
|
|
130
|
+
exports.flatten = (...args) => {
|
|
131
|
+
const result = [];
|
|
132
|
+
const flat = (arr) => {
|
|
133
|
+
for (let i = 0; i < arr.length; i++) {
|
|
134
|
+
const ele = arr[i];
|
|
135
|
+
if (Array.isArray(ele)) {
|
|
136
|
+
flat(ele);
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (ele !== void 0) result.push(ele);
|
|
140
|
+
}
|
|
141
|
+
return result;
|
|
142
|
+
};
|
|
143
|
+
flat(args);
|
|
144
|
+
return result;
|
|
145
|
+
};
|
|
146
|
+
}));
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
|
|
150
|
+
var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
151
|
+
const utils = require_utils$1();
|
|
152
|
+
module.exports = (ast, options = {}) => {
|
|
153
|
+
const stringify = (node, parent = {}) => {
|
|
154
|
+
const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
|
155
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
156
|
+
let output = "";
|
|
157
|
+
if (node.value) {
|
|
158
|
+
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) return "\\" + node.value;
|
|
159
|
+
return node.value;
|
|
160
|
+
}
|
|
161
|
+
if (node.value) return node.value;
|
|
162
|
+
if (node.nodes) for (const child of node.nodes) output += stringify(child);
|
|
163
|
+
return output;
|
|
164
|
+
};
|
|
165
|
+
return stringify(ast);
|
|
166
|
+
};
|
|
167
|
+
}));
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
|
|
171
|
+
/*!
|
|
172
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
173
|
+
*
|
|
174
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
175
|
+
* Released under the MIT License.
|
|
176
|
+
*/
|
|
177
|
+
var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
178
|
+
module.exports = function(num) {
|
|
179
|
+
if (typeof num === "number") return num - num === 0;
|
|
180
|
+
if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
|
181
|
+
return false;
|
|
182
|
+
};
|
|
183
|
+
}));
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
|
|
187
|
+
/*!
|
|
188
|
+
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
189
|
+
*
|
|
190
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
191
|
+
* Released under the MIT License.
|
|
192
|
+
*/
|
|
193
|
+
var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
194
|
+
const isNumber = require_is_number();
|
|
195
|
+
const toRegexRange = (min, max, options) => {
|
|
196
|
+
if (isNumber(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
197
|
+
if (max === void 0 || min === max) return String(min);
|
|
198
|
+
if (isNumber(max) === false) throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
199
|
+
let opts = {
|
|
200
|
+
relaxZeros: true,
|
|
201
|
+
...options
|
|
202
|
+
};
|
|
203
|
+
if (typeof opts.strictZeros === "boolean") opts.relaxZeros = opts.strictZeros === false;
|
|
204
|
+
let relax = String(opts.relaxZeros);
|
|
205
|
+
let shorthand = String(opts.shorthand);
|
|
206
|
+
let capture = String(opts.capture);
|
|
207
|
+
let wrap = String(opts.wrap);
|
|
208
|
+
let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
|
|
209
|
+
if (toRegexRange.cache.hasOwnProperty(cacheKey)) return toRegexRange.cache[cacheKey].result;
|
|
210
|
+
let a = Math.min(min, max);
|
|
211
|
+
let b = Math.max(min, max);
|
|
212
|
+
if (Math.abs(a - b) === 1) {
|
|
213
|
+
let result = min + "|" + max;
|
|
214
|
+
if (opts.capture) return `(${result})`;
|
|
215
|
+
if (opts.wrap === false) return result;
|
|
216
|
+
return `(?:${result})`;
|
|
217
|
+
}
|
|
218
|
+
let isPadded = hasPadding(min) || hasPadding(max);
|
|
219
|
+
let state = {
|
|
220
|
+
min,
|
|
221
|
+
max,
|
|
222
|
+
a,
|
|
223
|
+
b
|
|
224
|
+
};
|
|
225
|
+
let positives = [];
|
|
226
|
+
let negatives = [];
|
|
227
|
+
if (isPadded) {
|
|
228
|
+
state.isPadded = isPadded;
|
|
229
|
+
state.maxLen = String(state.max).length;
|
|
230
|
+
}
|
|
231
|
+
if (a < 0) {
|
|
232
|
+
negatives = splitToPatterns(b < 0 ? Math.abs(b) : 1, Math.abs(a), state, opts);
|
|
233
|
+
a = state.a = 0;
|
|
234
|
+
}
|
|
235
|
+
if (b >= 0) positives = splitToPatterns(a, b, state, opts);
|
|
236
|
+
state.negatives = negatives;
|
|
237
|
+
state.positives = positives;
|
|
238
|
+
state.result = collatePatterns(negatives, positives, opts);
|
|
239
|
+
if (opts.capture === true) state.result = `(${state.result})`;
|
|
240
|
+
else if (opts.wrap !== false && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
|
|
241
|
+
toRegexRange.cache[cacheKey] = state;
|
|
242
|
+
return state.result;
|
|
243
|
+
};
|
|
244
|
+
function collatePatterns(neg, pos, options) {
|
|
245
|
+
let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
|
|
246
|
+
let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
|
|
247
|
+
let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
|
|
248
|
+
return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
|
|
249
|
+
}
|
|
250
|
+
function splitToRanges(min, max) {
|
|
251
|
+
let nines = 1;
|
|
252
|
+
let zeros = 1;
|
|
253
|
+
let stop = countNines(min, nines);
|
|
254
|
+
let stops = new Set([max]);
|
|
255
|
+
while (min <= stop && stop <= max) {
|
|
256
|
+
stops.add(stop);
|
|
257
|
+
nines += 1;
|
|
258
|
+
stop = countNines(min, nines);
|
|
259
|
+
}
|
|
260
|
+
stop = countZeros(max + 1, zeros) - 1;
|
|
261
|
+
while (min < stop && stop <= max) {
|
|
262
|
+
stops.add(stop);
|
|
263
|
+
zeros += 1;
|
|
264
|
+
stop = countZeros(max + 1, zeros) - 1;
|
|
265
|
+
}
|
|
266
|
+
stops = [...stops];
|
|
267
|
+
stops.sort(compare);
|
|
268
|
+
return stops;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Convert a range to a regex pattern
|
|
272
|
+
* @param {Number} `start`
|
|
273
|
+
* @param {Number} `stop`
|
|
274
|
+
* @return {String}
|
|
275
|
+
*/
|
|
276
|
+
function rangeToPattern(start, stop, options) {
|
|
277
|
+
if (start === stop) return {
|
|
278
|
+
pattern: start,
|
|
279
|
+
count: [],
|
|
280
|
+
digits: 0
|
|
281
|
+
};
|
|
282
|
+
let zipped = zip(start, stop);
|
|
283
|
+
let digits = zipped.length;
|
|
284
|
+
let pattern = "";
|
|
285
|
+
let count = 0;
|
|
286
|
+
for (let i = 0; i < digits; i++) {
|
|
287
|
+
let [startDigit, stopDigit] = zipped[i];
|
|
288
|
+
if (startDigit === stopDigit) pattern += startDigit;
|
|
289
|
+
else if (startDigit !== "0" || stopDigit !== "9") pattern += toCharacterClass(startDigit, stopDigit, options);
|
|
290
|
+
else count++;
|
|
291
|
+
}
|
|
292
|
+
if (count) pattern += options.shorthand === true ? "\\d" : "[0-9]";
|
|
293
|
+
return {
|
|
294
|
+
pattern,
|
|
295
|
+
count: [count],
|
|
296
|
+
digits
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function splitToPatterns(min, max, tok, options) {
|
|
300
|
+
let ranges = splitToRanges(min, max);
|
|
301
|
+
let tokens = [];
|
|
302
|
+
let start = min;
|
|
303
|
+
let prev;
|
|
304
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
305
|
+
let max = ranges[i];
|
|
306
|
+
let obj = rangeToPattern(String(start), String(max), options);
|
|
307
|
+
let zeros = "";
|
|
308
|
+
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
309
|
+
if (prev.count.length > 1) prev.count.pop();
|
|
310
|
+
prev.count.push(obj.count[0]);
|
|
311
|
+
prev.string = prev.pattern + toQuantifier(prev.count);
|
|
312
|
+
start = max + 1;
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
if (tok.isPadded) zeros = padZeros(max, tok, options);
|
|
316
|
+
obj.string = zeros + obj.pattern + toQuantifier(obj.count);
|
|
317
|
+
tokens.push(obj);
|
|
318
|
+
start = max + 1;
|
|
319
|
+
prev = obj;
|
|
320
|
+
}
|
|
321
|
+
return tokens;
|
|
322
|
+
}
|
|
323
|
+
function filterPatterns(arr, comparison, prefix, intersection, options) {
|
|
324
|
+
let result = [];
|
|
325
|
+
for (let ele of arr) {
|
|
326
|
+
let { string } = ele;
|
|
327
|
+
if (!intersection && !contains(comparison, "string", string)) result.push(prefix + string);
|
|
328
|
+
if (intersection && contains(comparison, "string", string)) result.push(prefix + string);
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Zip strings
|
|
334
|
+
*/
|
|
335
|
+
function zip(a, b) {
|
|
336
|
+
let arr = [];
|
|
337
|
+
for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
|
|
338
|
+
return arr;
|
|
339
|
+
}
|
|
340
|
+
function compare(a, b) {
|
|
341
|
+
return a > b ? 1 : b > a ? -1 : 0;
|
|
342
|
+
}
|
|
343
|
+
function contains(arr, key, val) {
|
|
344
|
+
return arr.some((ele) => ele[key] === val);
|
|
345
|
+
}
|
|
346
|
+
function countNines(min, len) {
|
|
347
|
+
return Number(String(min).slice(0, -len) + "9".repeat(len));
|
|
348
|
+
}
|
|
349
|
+
function countZeros(integer, zeros) {
|
|
350
|
+
return integer - integer % Math.pow(10, zeros);
|
|
351
|
+
}
|
|
352
|
+
function toQuantifier(digits) {
|
|
353
|
+
let [start = 0, stop = ""] = digits;
|
|
354
|
+
if (stop || start > 1) return `{${start + (stop ? "," + stop : "")}}`;
|
|
355
|
+
return "";
|
|
356
|
+
}
|
|
357
|
+
function toCharacterClass(a, b, options) {
|
|
358
|
+
return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
|
|
359
|
+
}
|
|
360
|
+
function hasPadding(str) {
|
|
361
|
+
return /^-?(0+)\d/.test(str);
|
|
362
|
+
}
|
|
363
|
+
function padZeros(value, tok, options) {
|
|
364
|
+
if (!tok.isPadded) return value;
|
|
365
|
+
let diff = Math.abs(tok.maxLen - String(value).length);
|
|
366
|
+
let relax = options.relaxZeros !== false;
|
|
367
|
+
switch (diff) {
|
|
368
|
+
case 0: return "";
|
|
369
|
+
case 1: return relax ? "0?" : "0";
|
|
370
|
+
case 2: return relax ? "0{0,2}" : "00";
|
|
371
|
+
default: return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Cache
|
|
376
|
+
*/
|
|
377
|
+
toRegexRange.cache = {};
|
|
378
|
+
toRegexRange.clearCache = () => toRegexRange.cache = {};
|
|
379
|
+
/**
|
|
380
|
+
* Expose `toRegexRange`
|
|
381
|
+
*/
|
|
382
|
+
module.exports = toRegexRange;
|
|
383
|
+
}));
|
|
384
|
+
|
|
385
|
+
//#endregion
|
|
386
|
+
//#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
|
|
387
|
+
/*!
|
|
388
|
+
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
389
|
+
*
|
|
390
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
391
|
+
* Licensed under the MIT License.
|
|
392
|
+
*/
|
|
393
|
+
var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
394
|
+
const util$1 = require("node:util");
|
|
395
|
+
const toRegexRange = require_to_regex_range();
|
|
396
|
+
const isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
397
|
+
const transform = (toNumber) => {
|
|
398
|
+
return (value) => toNumber === true ? Number(value) : String(value);
|
|
399
|
+
};
|
|
400
|
+
const isValidValue = (value) => {
|
|
401
|
+
return typeof value === "number" || typeof value === "string" && value !== "";
|
|
402
|
+
};
|
|
403
|
+
const isNumber = (num) => Number.isInteger(+num);
|
|
404
|
+
const zeros = (input) => {
|
|
405
|
+
let value = `${input}`;
|
|
406
|
+
let index = -1;
|
|
407
|
+
if (value[0] === "-") value = value.slice(1);
|
|
408
|
+
if (value === "0") return false;
|
|
409
|
+
while (value[++index] === "0");
|
|
410
|
+
return index > 0;
|
|
411
|
+
};
|
|
412
|
+
const stringify = (start, end, options) => {
|
|
413
|
+
if (typeof start === "string" || typeof end === "string") return true;
|
|
414
|
+
return options.stringify === true;
|
|
415
|
+
};
|
|
416
|
+
const pad = (input, maxLength, toNumber) => {
|
|
417
|
+
if (maxLength > 0) {
|
|
418
|
+
let dash = input[0] === "-" ? "-" : "";
|
|
419
|
+
if (dash) input = input.slice(1);
|
|
420
|
+
input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
|
|
421
|
+
}
|
|
422
|
+
if (toNumber === false) return String(input);
|
|
423
|
+
return input;
|
|
424
|
+
};
|
|
425
|
+
const toMaxLen = (input, maxLength) => {
|
|
426
|
+
let negative = input[0] === "-" ? "-" : "";
|
|
427
|
+
if (negative) {
|
|
428
|
+
input = input.slice(1);
|
|
429
|
+
maxLength--;
|
|
430
|
+
}
|
|
431
|
+
while (input.length < maxLength) input = "0" + input;
|
|
432
|
+
return negative ? "-" + input : input;
|
|
433
|
+
};
|
|
434
|
+
const toSequence = (parts, options, maxLen) => {
|
|
435
|
+
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
436
|
+
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
437
|
+
let prefix = options.capture ? "" : "?:";
|
|
438
|
+
let positives = "";
|
|
439
|
+
let negatives = "";
|
|
440
|
+
let result;
|
|
441
|
+
if (parts.positives.length) positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
|
|
442
|
+
if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
|
|
443
|
+
if (positives && negatives) result = `${positives}|${negatives}`;
|
|
444
|
+
else result = positives || negatives;
|
|
445
|
+
if (options.wrap) return `(${prefix}${result})`;
|
|
446
|
+
return result;
|
|
447
|
+
};
|
|
448
|
+
const toRange = (a, b, isNumbers, options) => {
|
|
449
|
+
if (isNumbers) return toRegexRange(a, b, {
|
|
450
|
+
wrap: false,
|
|
451
|
+
...options
|
|
452
|
+
});
|
|
453
|
+
let start = String.fromCharCode(a);
|
|
454
|
+
if (a === b) return start;
|
|
455
|
+
return `[${start}-${String.fromCharCode(b)}]`;
|
|
456
|
+
};
|
|
457
|
+
const toRegex = (start, end, options) => {
|
|
458
|
+
if (Array.isArray(start)) {
|
|
459
|
+
let wrap = options.wrap === true;
|
|
460
|
+
let prefix = options.capture ? "" : "?:";
|
|
461
|
+
return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
|
|
462
|
+
}
|
|
463
|
+
return toRegexRange(start, end, options);
|
|
464
|
+
};
|
|
465
|
+
const rangeError = (...args) => {
|
|
466
|
+
return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util$1.inspect(...args));
|
|
467
|
+
};
|
|
468
|
+
const invalidRange = (start, end, options) => {
|
|
469
|
+
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
470
|
+
return [];
|
|
471
|
+
};
|
|
472
|
+
const invalidStep = (step, options) => {
|
|
473
|
+
if (options.strictRanges === true) throw new TypeError(`Expected step "${step}" to be a number`);
|
|
474
|
+
return [];
|
|
475
|
+
};
|
|
476
|
+
const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
477
|
+
let a = Number(start);
|
|
478
|
+
let b = Number(end);
|
|
479
|
+
if (!Number.isInteger(a) || !Number.isInteger(b)) {
|
|
480
|
+
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
481
|
+
return [];
|
|
482
|
+
}
|
|
483
|
+
if (a === 0) a = 0;
|
|
484
|
+
if (b === 0) b = 0;
|
|
485
|
+
let descending = a > b;
|
|
486
|
+
let startString = String(start);
|
|
487
|
+
let endString = String(end);
|
|
488
|
+
let stepString = String(step);
|
|
489
|
+
step = Math.max(Math.abs(step), 1);
|
|
490
|
+
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
491
|
+
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
492
|
+
let toNumber = padded === false && stringify(start, end, options) === false;
|
|
493
|
+
let format = options.transform || transform(toNumber);
|
|
494
|
+
if (options.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
495
|
+
let parts = {
|
|
496
|
+
negatives: [],
|
|
497
|
+
positives: []
|
|
498
|
+
};
|
|
499
|
+
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
500
|
+
let range = [];
|
|
501
|
+
let index = 0;
|
|
502
|
+
while (descending ? a >= b : a <= b) {
|
|
503
|
+
if (options.toRegex === true && step > 1) push(a);
|
|
504
|
+
else range.push(pad(format(a, index), maxLen, toNumber));
|
|
505
|
+
a = descending ? a - step : a + step;
|
|
506
|
+
index++;
|
|
507
|
+
}
|
|
508
|
+
if (options.toRegex === true) return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, {
|
|
509
|
+
wrap: false,
|
|
510
|
+
...options
|
|
511
|
+
});
|
|
512
|
+
return range;
|
|
513
|
+
};
|
|
514
|
+
const fillLetters = (start, end, step = 1, options = {}) => {
|
|
515
|
+
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options);
|
|
516
|
+
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
517
|
+
let a = `${start}`.charCodeAt(0);
|
|
518
|
+
let b = `${end}`.charCodeAt(0);
|
|
519
|
+
let descending = a > b;
|
|
520
|
+
let min = Math.min(a, b);
|
|
521
|
+
let max = Math.max(a, b);
|
|
522
|
+
if (options.toRegex && step === 1) return toRange(min, max, false, options);
|
|
523
|
+
let range = [];
|
|
524
|
+
let index = 0;
|
|
525
|
+
while (descending ? a >= b : a <= b) {
|
|
526
|
+
range.push(format(a, index));
|
|
527
|
+
a = descending ? a - step : a + step;
|
|
528
|
+
index++;
|
|
529
|
+
}
|
|
530
|
+
if (options.toRegex === true) return toRegex(range, null, {
|
|
531
|
+
wrap: false,
|
|
532
|
+
options
|
|
533
|
+
});
|
|
534
|
+
return range;
|
|
535
|
+
};
|
|
536
|
+
const fill = (start, end, step, options = {}) => {
|
|
537
|
+
if (end == null && isValidValue(start)) return [start];
|
|
538
|
+
if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options);
|
|
539
|
+
if (typeof step === "function") return fill(start, end, 1, { transform: step });
|
|
540
|
+
if (isObject(step)) return fill(start, end, 0, step);
|
|
541
|
+
let opts = { ...options };
|
|
542
|
+
if (opts.capture === true) opts.wrap = true;
|
|
543
|
+
step = step || opts.step || 1;
|
|
544
|
+
if (!isNumber(step)) {
|
|
545
|
+
if (step != null && !isObject(step)) return invalidStep(step, opts);
|
|
546
|
+
return fill(start, end, 1, step);
|
|
547
|
+
}
|
|
548
|
+
if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
|
|
549
|
+
return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
|
550
|
+
};
|
|
551
|
+
module.exports = fill;
|
|
552
|
+
}));
|
|
553
|
+
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
|
|
556
|
+
var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
557
|
+
const fill = require_fill_range();
|
|
558
|
+
const utils = require_utils$1();
|
|
559
|
+
const compile = (ast, options = {}) => {
|
|
560
|
+
const walk = (node, parent = {}) => {
|
|
561
|
+
const invalidBlock = utils.isInvalidBrace(parent);
|
|
562
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
563
|
+
const invalid = invalidBlock === true || invalidNode === true;
|
|
564
|
+
const prefix = options.escapeInvalid === true ? "\\" : "";
|
|
565
|
+
let output = "";
|
|
566
|
+
if (node.isOpen === true) return prefix + node.value;
|
|
567
|
+
if (node.isClose === true) {
|
|
568
|
+
console.log("node.isClose", prefix, node.value);
|
|
569
|
+
return prefix + node.value;
|
|
570
|
+
}
|
|
571
|
+
if (node.type === "open") return invalid ? prefix + node.value : "(";
|
|
572
|
+
if (node.type === "close") return invalid ? prefix + node.value : ")";
|
|
573
|
+
if (node.type === "comma") return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
|
|
574
|
+
if (node.value) return node.value;
|
|
575
|
+
if (node.nodes && node.ranges > 0) {
|
|
576
|
+
const args = utils.reduce(node.nodes);
|
|
577
|
+
const range = fill(...args, {
|
|
578
|
+
...options,
|
|
579
|
+
wrap: false,
|
|
580
|
+
toRegex: true,
|
|
581
|
+
strictZeros: true
|
|
582
|
+
});
|
|
583
|
+
if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
584
|
+
}
|
|
585
|
+
if (node.nodes) for (const child of node.nodes) output += walk(child, node);
|
|
586
|
+
return output;
|
|
587
|
+
};
|
|
588
|
+
return walk(ast);
|
|
589
|
+
};
|
|
590
|
+
module.exports = compile;
|
|
591
|
+
}));
|
|
592
|
+
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
|
|
595
|
+
var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
596
|
+
const fill = require_fill_range();
|
|
597
|
+
const stringify = require_stringify();
|
|
598
|
+
const utils = require_utils$1();
|
|
599
|
+
const append = (queue = "", stash = "", enclose = false) => {
|
|
600
|
+
const result = [];
|
|
601
|
+
queue = [].concat(queue);
|
|
602
|
+
stash = [].concat(stash);
|
|
603
|
+
if (!stash.length) return queue;
|
|
604
|
+
if (!queue.length) return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
|
605
|
+
for (const item of queue) if (Array.isArray(item)) for (const value of item) result.push(append(value, stash, enclose));
|
|
606
|
+
else for (let ele of stash) {
|
|
607
|
+
if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
|
|
608
|
+
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
609
|
+
}
|
|
610
|
+
return utils.flatten(result);
|
|
611
|
+
};
|
|
612
|
+
const expand = (ast, options = {}) => {
|
|
613
|
+
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
614
|
+
const walk = (node, parent = {}) => {
|
|
615
|
+
node.queue = [];
|
|
616
|
+
let p = parent;
|
|
617
|
+
let q = parent.queue;
|
|
618
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
619
|
+
p = p.parent;
|
|
620
|
+
q = p.queue;
|
|
621
|
+
}
|
|
622
|
+
if (node.invalid || node.dollar) {
|
|
623
|
+
q.push(append(q.pop(), stringify(node, options)));
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
627
|
+
q.push(append(q.pop(), ["{}"]));
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
if (node.nodes && node.ranges > 0) {
|
|
631
|
+
const args = utils.reduce(node.nodes);
|
|
632
|
+
if (utils.exceedsLimit(...args, options.step, rangeLimit)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
633
|
+
let range = fill(...args, options);
|
|
634
|
+
if (range.length === 0) range = stringify(node, options);
|
|
635
|
+
q.push(append(q.pop(), range));
|
|
636
|
+
node.nodes = [];
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
const enclose = utils.encloseBrace(node);
|
|
640
|
+
let queue = node.queue;
|
|
641
|
+
let block = node;
|
|
642
|
+
while (block.type !== "brace" && block.type !== "root" && block.parent) {
|
|
643
|
+
block = block.parent;
|
|
644
|
+
queue = block.queue;
|
|
645
|
+
}
|
|
646
|
+
for (let i = 0; i < node.nodes.length; i++) {
|
|
647
|
+
const child = node.nodes[i];
|
|
648
|
+
if (child.type === "comma" && node.type === "brace") {
|
|
649
|
+
if (i === 1) queue.push("");
|
|
650
|
+
queue.push("");
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
if (child.type === "close") {
|
|
654
|
+
q.push(append(q.pop(), queue, enclose));
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
if (child.value && child.type !== "open") {
|
|
658
|
+
queue.push(append(queue.pop(), child.value));
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
if (child.nodes) walk(child, node);
|
|
662
|
+
}
|
|
663
|
+
return queue;
|
|
664
|
+
};
|
|
665
|
+
return utils.flatten(walk(ast));
|
|
666
|
+
};
|
|
667
|
+
module.exports = expand;
|
|
668
|
+
}));
|
|
669
|
+
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
|
|
672
|
+
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
673
|
+
module.exports = {
|
|
674
|
+
MAX_LENGTH: 1e4,
|
|
675
|
+
CHAR_0: "0",
|
|
676
|
+
CHAR_9: "9",
|
|
677
|
+
CHAR_UPPERCASE_A: "A",
|
|
678
|
+
CHAR_LOWERCASE_A: "a",
|
|
679
|
+
CHAR_UPPERCASE_Z: "Z",
|
|
680
|
+
CHAR_LOWERCASE_Z: "z",
|
|
681
|
+
CHAR_LEFT_PARENTHESES: "(",
|
|
682
|
+
CHAR_RIGHT_PARENTHESES: ")",
|
|
683
|
+
CHAR_ASTERISK: "*",
|
|
684
|
+
CHAR_AMPERSAND: "&",
|
|
685
|
+
CHAR_AT: "@",
|
|
686
|
+
CHAR_BACKSLASH: "\\",
|
|
687
|
+
CHAR_BACKTICK: "`",
|
|
688
|
+
CHAR_CARRIAGE_RETURN: "\r",
|
|
689
|
+
CHAR_CIRCUMFLEX_ACCENT: "^",
|
|
690
|
+
CHAR_COLON: ":",
|
|
691
|
+
CHAR_COMMA: ",",
|
|
692
|
+
CHAR_DOLLAR: "$",
|
|
693
|
+
CHAR_DOT: ".",
|
|
694
|
+
CHAR_DOUBLE_QUOTE: "\"",
|
|
695
|
+
CHAR_EQUAL: "=",
|
|
696
|
+
CHAR_EXCLAMATION_MARK: "!",
|
|
697
|
+
CHAR_FORM_FEED: "\f",
|
|
698
|
+
CHAR_FORWARD_SLASH: "/",
|
|
699
|
+
CHAR_HASH: "#",
|
|
700
|
+
CHAR_HYPHEN_MINUS: "-",
|
|
701
|
+
CHAR_LEFT_ANGLE_BRACKET: "<",
|
|
702
|
+
CHAR_LEFT_CURLY_BRACE: "{",
|
|
703
|
+
CHAR_LEFT_SQUARE_BRACKET: "[",
|
|
704
|
+
CHAR_LINE_FEED: "\n",
|
|
705
|
+
CHAR_NO_BREAK_SPACE: "\xA0",
|
|
706
|
+
CHAR_PERCENT: "%",
|
|
707
|
+
CHAR_PLUS: "+",
|
|
708
|
+
CHAR_QUESTION_MARK: "?",
|
|
709
|
+
CHAR_RIGHT_ANGLE_BRACKET: ">",
|
|
710
|
+
CHAR_RIGHT_CURLY_BRACE: "}",
|
|
711
|
+
CHAR_RIGHT_SQUARE_BRACKET: "]",
|
|
712
|
+
CHAR_SEMICOLON: ";",
|
|
713
|
+
CHAR_SINGLE_QUOTE: "'",
|
|
714
|
+
CHAR_SPACE: " ",
|
|
715
|
+
CHAR_TAB: " ",
|
|
716
|
+
CHAR_UNDERSCORE: "_",
|
|
717
|
+
CHAR_VERTICAL_LINE: "|",
|
|
718
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
|
|
719
|
+
};
|
|
720
|
+
}));
|
|
721
|
+
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
|
|
724
|
+
var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
725
|
+
const stringify = require_stringify();
|
|
726
|
+
/**
|
|
727
|
+
* Constants
|
|
728
|
+
*/
|
|
729
|
+
const { MAX_LENGTH, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA, CHAR_DOT, CHAR_LEFT_PARENTHESES, CHAR_RIGHT_PARENTHESES, CHAR_LEFT_CURLY_BRACE, CHAR_RIGHT_CURLY_BRACE, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants$1();
|
|
730
|
+
/**
|
|
731
|
+
* parse
|
|
732
|
+
*/
|
|
733
|
+
const parse = (input, options = {}) => {
|
|
734
|
+
if (typeof input !== "string") throw new TypeError("Expected a string");
|
|
735
|
+
const opts = options || {};
|
|
736
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
737
|
+
if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
738
|
+
const ast = {
|
|
739
|
+
type: "root",
|
|
740
|
+
input,
|
|
741
|
+
nodes: []
|
|
742
|
+
};
|
|
743
|
+
const stack = [ast];
|
|
744
|
+
let block = ast;
|
|
745
|
+
let prev = ast;
|
|
746
|
+
let brackets = 0;
|
|
747
|
+
const length = input.length;
|
|
748
|
+
let index = 0;
|
|
749
|
+
let depth = 0;
|
|
750
|
+
let value;
|
|
751
|
+
/**
|
|
752
|
+
* Helpers
|
|
753
|
+
*/
|
|
754
|
+
const advance = () => input[index++];
|
|
755
|
+
const push = (node) => {
|
|
756
|
+
if (node.type === "text" && prev.type === "dot") prev.type = "text";
|
|
757
|
+
if (prev && prev.type === "text" && node.type === "text") {
|
|
758
|
+
prev.value += node.value;
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
block.nodes.push(node);
|
|
762
|
+
node.parent = block;
|
|
763
|
+
node.prev = prev;
|
|
764
|
+
prev = node;
|
|
765
|
+
return node;
|
|
766
|
+
};
|
|
767
|
+
push({ type: "bos" });
|
|
768
|
+
while (index < length) {
|
|
769
|
+
block = stack[stack.length - 1];
|
|
770
|
+
value = advance();
|
|
771
|
+
/**
|
|
772
|
+
* Invalid chars
|
|
773
|
+
*/
|
|
774
|
+
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
|
|
775
|
+
/**
|
|
776
|
+
* Escaped chars
|
|
777
|
+
*/
|
|
778
|
+
if (value === CHAR_BACKSLASH) {
|
|
779
|
+
push({
|
|
780
|
+
type: "text",
|
|
781
|
+
value: (options.keepEscaping ? value : "") + advance()
|
|
782
|
+
});
|
|
783
|
+
continue;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Right square bracket (literal): ']'
|
|
787
|
+
*/
|
|
788
|
+
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
789
|
+
push({
|
|
790
|
+
type: "text",
|
|
791
|
+
value: "\\" + value
|
|
792
|
+
});
|
|
793
|
+
continue;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Left square bracket: '['
|
|
797
|
+
*/
|
|
798
|
+
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
799
|
+
brackets++;
|
|
800
|
+
let next;
|
|
801
|
+
while (index < length && (next = advance())) {
|
|
802
|
+
value += next;
|
|
803
|
+
if (next === CHAR_LEFT_SQUARE_BRACKET) {
|
|
804
|
+
brackets++;
|
|
805
|
+
continue;
|
|
806
|
+
}
|
|
807
|
+
if (next === CHAR_BACKSLASH) {
|
|
808
|
+
value += advance();
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
812
|
+
brackets--;
|
|
813
|
+
if (brackets === 0) break;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
push({
|
|
817
|
+
type: "text",
|
|
818
|
+
value
|
|
819
|
+
});
|
|
820
|
+
continue;
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Parentheses
|
|
824
|
+
*/
|
|
825
|
+
if (value === CHAR_LEFT_PARENTHESES) {
|
|
826
|
+
block = push({
|
|
827
|
+
type: "paren",
|
|
828
|
+
nodes: []
|
|
829
|
+
});
|
|
830
|
+
stack.push(block);
|
|
831
|
+
push({
|
|
832
|
+
type: "text",
|
|
833
|
+
value
|
|
834
|
+
});
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
838
|
+
if (block.type !== "paren") {
|
|
839
|
+
push({
|
|
840
|
+
type: "text",
|
|
841
|
+
value
|
|
842
|
+
});
|
|
843
|
+
continue;
|
|
844
|
+
}
|
|
845
|
+
block = stack.pop();
|
|
846
|
+
push({
|
|
847
|
+
type: "text",
|
|
848
|
+
value
|
|
849
|
+
});
|
|
850
|
+
block = stack[stack.length - 1];
|
|
851
|
+
continue;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Quotes: '|"|`
|
|
855
|
+
*/
|
|
856
|
+
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
857
|
+
const open = value;
|
|
858
|
+
let next;
|
|
859
|
+
if (options.keepQuotes !== true) value = "";
|
|
860
|
+
while (index < length && (next = advance())) {
|
|
861
|
+
if (next === CHAR_BACKSLASH) {
|
|
862
|
+
value += next + advance();
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
if (next === open) {
|
|
866
|
+
if (options.keepQuotes === true) value += next;
|
|
867
|
+
break;
|
|
868
|
+
}
|
|
869
|
+
value += next;
|
|
870
|
+
}
|
|
871
|
+
push({
|
|
872
|
+
type: "text",
|
|
873
|
+
value
|
|
874
|
+
});
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Left curly brace: '{'
|
|
879
|
+
*/
|
|
880
|
+
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
881
|
+
depth++;
|
|
882
|
+
block = push({
|
|
883
|
+
type: "brace",
|
|
884
|
+
open: true,
|
|
885
|
+
close: false,
|
|
886
|
+
dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === true,
|
|
887
|
+
depth,
|
|
888
|
+
commas: 0,
|
|
889
|
+
ranges: 0,
|
|
890
|
+
nodes: []
|
|
891
|
+
});
|
|
892
|
+
stack.push(block);
|
|
893
|
+
push({
|
|
894
|
+
type: "open",
|
|
895
|
+
value
|
|
896
|
+
});
|
|
897
|
+
continue;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Right curly brace: '}'
|
|
901
|
+
*/
|
|
902
|
+
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
903
|
+
if (block.type !== "brace") {
|
|
904
|
+
push({
|
|
905
|
+
type: "text",
|
|
906
|
+
value
|
|
907
|
+
});
|
|
908
|
+
continue;
|
|
909
|
+
}
|
|
910
|
+
const type = "close";
|
|
911
|
+
block = stack.pop();
|
|
912
|
+
block.close = true;
|
|
913
|
+
push({
|
|
914
|
+
type,
|
|
915
|
+
value
|
|
916
|
+
});
|
|
917
|
+
depth--;
|
|
918
|
+
block = stack[stack.length - 1];
|
|
919
|
+
continue;
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* Comma: ','
|
|
923
|
+
*/
|
|
924
|
+
if (value === CHAR_COMMA && depth > 0) {
|
|
925
|
+
if (block.ranges > 0) {
|
|
926
|
+
block.ranges = 0;
|
|
927
|
+
const open = block.nodes.shift();
|
|
928
|
+
block.nodes = [open, {
|
|
929
|
+
type: "text",
|
|
930
|
+
value: stringify(block)
|
|
931
|
+
}];
|
|
932
|
+
}
|
|
933
|
+
push({
|
|
934
|
+
type: "comma",
|
|
935
|
+
value
|
|
936
|
+
});
|
|
937
|
+
block.commas++;
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Dot: '.'
|
|
942
|
+
*/
|
|
943
|
+
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
944
|
+
const siblings = block.nodes;
|
|
945
|
+
if (depth === 0 || siblings.length === 0) {
|
|
946
|
+
push({
|
|
947
|
+
type: "text",
|
|
948
|
+
value
|
|
949
|
+
});
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
if (prev.type === "dot") {
|
|
953
|
+
block.range = [];
|
|
954
|
+
prev.value += value;
|
|
955
|
+
prev.type = "range";
|
|
956
|
+
if (block.nodes.length !== 3 && block.nodes.length !== 5) {
|
|
957
|
+
block.invalid = true;
|
|
958
|
+
block.ranges = 0;
|
|
959
|
+
prev.type = "text";
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
block.ranges++;
|
|
963
|
+
block.args = [];
|
|
964
|
+
continue;
|
|
965
|
+
}
|
|
966
|
+
if (prev.type === "range") {
|
|
967
|
+
siblings.pop();
|
|
968
|
+
const before = siblings[siblings.length - 1];
|
|
969
|
+
before.value += prev.value + value;
|
|
970
|
+
prev = before;
|
|
971
|
+
block.ranges--;
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
push({
|
|
975
|
+
type: "dot",
|
|
976
|
+
value
|
|
977
|
+
});
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Text
|
|
982
|
+
*/
|
|
983
|
+
push({
|
|
984
|
+
type: "text",
|
|
985
|
+
value
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
do {
|
|
989
|
+
block = stack.pop();
|
|
990
|
+
if (block.type !== "root") {
|
|
991
|
+
block.nodes.forEach((node) => {
|
|
992
|
+
if (!node.nodes) {
|
|
993
|
+
if (node.type === "open") node.isOpen = true;
|
|
994
|
+
if (node.type === "close") node.isClose = true;
|
|
995
|
+
if (!node.nodes) node.type = "text";
|
|
996
|
+
node.invalid = true;
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
const parent = stack[stack.length - 1];
|
|
1000
|
+
const index = parent.nodes.indexOf(block);
|
|
1001
|
+
parent.nodes.splice(index, 1, ...block.nodes);
|
|
1002
|
+
}
|
|
1003
|
+
} while (stack.length > 0);
|
|
1004
|
+
push({ type: "eos" });
|
|
1005
|
+
return ast;
|
|
1006
|
+
};
|
|
1007
|
+
module.exports = parse;
|
|
1008
|
+
}));
|
|
1009
|
+
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
|
|
1012
|
+
var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1013
|
+
const stringify = require_stringify();
|
|
1014
|
+
const compile = require_compile();
|
|
1015
|
+
const expand = require_expand();
|
|
1016
|
+
const parse = require_parse$1();
|
|
1017
|
+
/**
|
|
1018
|
+
* Expand the given pattern or create a regex-compatible string.
|
|
1019
|
+
*
|
|
1020
|
+
* ```js
|
|
1021
|
+
* const braces = require('braces');
|
|
1022
|
+
* console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
|
|
1023
|
+
* console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
|
|
1024
|
+
* ```
|
|
1025
|
+
* @param {String} `str`
|
|
1026
|
+
* @param {Object} `options`
|
|
1027
|
+
* @return {String}
|
|
1028
|
+
* @api public
|
|
1029
|
+
*/
|
|
1030
|
+
const braces = (input, options = {}) => {
|
|
1031
|
+
let output = [];
|
|
1032
|
+
if (Array.isArray(input)) for (const pattern of input) {
|
|
1033
|
+
const result = braces.create(pattern, options);
|
|
1034
|
+
if (Array.isArray(result)) output.push(...result);
|
|
1035
|
+
else output.push(result);
|
|
1036
|
+
}
|
|
1037
|
+
else output = [].concat(braces.create(input, options));
|
|
1038
|
+
if (options && options.expand === true && options.nodupes === true) output = [...new Set(output)];
|
|
1039
|
+
return output;
|
|
1040
|
+
};
|
|
1041
|
+
/**
|
|
1042
|
+
* Parse the given `str` with the given `options`.
|
|
1043
|
+
*
|
|
1044
|
+
* ```js
|
|
1045
|
+
* // braces.parse(pattern, [, options]);
|
|
1046
|
+
* const ast = braces.parse('a/{b,c}/d');
|
|
1047
|
+
* console.log(ast);
|
|
1048
|
+
* ```
|
|
1049
|
+
* @param {String} pattern Brace pattern to parse
|
|
1050
|
+
* @param {Object} options
|
|
1051
|
+
* @return {Object} Returns an AST
|
|
1052
|
+
* @api public
|
|
1053
|
+
*/
|
|
1054
|
+
braces.parse = (input, options = {}) => parse(input, options);
|
|
1055
|
+
/**
|
|
1056
|
+
* Creates a braces string from an AST, or an AST node.
|
|
1057
|
+
*
|
|
1058
|
+
* ```js
|
|
1059
|
+
* const braces = require('braces');
|
|
1060
|
+
* let ast = braces.parse('foo/{a,b}/bar');
|
|
1061
|
+
* console.log(stringify(ast.nodes[2])); //=> '{a,b}'
|
|
1062
|
+
* ```
|
|
1063
|
+
* @param {String} `input` Brace pattern or AST.
|
|
1064
|
+
* @param {Object} `options`
|
|
1065
|
+
* @return {Array} Returns an array of expanded values.
|
|
1066
|
+
* @api public
|
|
1067
|
+
*/
|
|
1068
|
+
braces.stringify = (input, options = {}) => {
|
|
1069
|
+
if (typeof input === "string") return stringify(braces.parse(input, options), options);
|
|
1070
|
+
return stringify(input, options);
|
|
1071
|
+
};
|
|
1072
|
+
/**
|
|
1073
|
+
* Compiles a brace pattern into a regex-compatible, optimized string.
|
|
1074
|
+
* This method is called by the main [braces](#braces) function by default.
|
|
1075
|
+
*
|
|
1076
|
+
* ```js
|
|
1077
|
+
* const braces = require('braces');
|
|
1078
|
+
* console.log(braces.compile('a/{b,c}/d'));
|
|
1079
|
+
* //=> ['a/(b|c)/d']
|
|
1080
|
+
* ```
|
|
1081
|
+
* @param {String} `input` Brace pattern or AST.
|
|
1082
|
+
* @param {Object} `options`
|
|
1083
|
+
* @return {Array} Returns an array of expanded values.
|
|
1084
|
+
* @api public
|
|
1085
|
+
*/
|
|
1086
|
+
braces.compile = (input, options = {}) => {
|
|
1087
|
+
if (typeof input === "string") input = braces.parse(input, options);
|
|
1088
|
+
return compile(input, options);
|
|
1089
|
+
};
|
|
1090
|
+
/**
|
|
1091
|
+
* Expands a brace pattern into an array. This method is called by the
|
|
1092
|
+
* main [braces](#braces) function when `options.expand` is true. Before
|
|
1093
|
+
* using this method it's recommended that you read the [performance notes](#performance))
|
|
1094
|
+
* and advantages of using [.compile](#compile) instead.
|
|
1095
|
+
*
|
|
1096
|
+
* ```js
|
|
1097
|
+
* const braces = require('braces');
|
|
1098
|
+
* console.log(braces.expand('a/{b,c}/d'));
|
|
1099
|
+
* //=> ['a/b/d', 'a/c/d'];
|
|
1100
|
+
* ```
|
|
1101
|
+
* @param {String} `pattern` Brace pattern
|
|
1102
|
+
* @param {Object} `options`
|
|
1103
|
+
* @return {Array} Returns an array of expanded values.
|
|
1104
|
+
* @api public
|
|
1105
|
+
*/
|
|
1106
|
+
braces.expand = (input, options = {}) => {
|
|
1107
|
+
if (typeof input === "string") input = braces.parse(input, options);
|
|
1108
|
+
let result = expand(input, options);
|
|
1109
|
+
if (options.noempty === true) result = result.filter(Boolean);
|
|
1110
|
+
if (options.nodupes === true) result = [...new Set(result)];
|
|
1111
|
+
return result;
|
|
1112
|
+
};
|
|
1113
|
+
/**
|
|
1114
|
+
* Processes a brace pattern and returns either an expanded array
|
|
1115
|
+
* (if `options.expand` is true), a highly optimized regex-compatible string.
|
|
1116
|
+
* This method is called by the main [braces](#braces) function.
|
|
1117
|
+
*
|
|
1118
|
+
* ```js
|
|
1119
|
+
* const braces = require('braces');
|
|
1120
|
+
* console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
|
|
1121
|
+
* //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
|
|
1122
|
+
* ```
|
|
1123
|
+
* @param {String} `pattern` Brace pattern
|
|
1124
|
+
* @param {Object} `options`
|
|
1125
|
+
* @return {Array} Returns an array of expanded values.
|
|
1126
|
+
* @api public
|
|
1127
|
+
*/
|
|
1128
|
+
braces.create = (input, options = {}) => {
|
|
1129
|
+
if (input === "" || input.length < 3) return [input];
|
|
1130
|
+
return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
|
|
1131
|
+
};
|
|
1132
|
+
/**
|
|
1133
|
+
* Expose "braces"
|
|
1134
|
+
*/
|
|
1135
|
+
module.exports = braces;
|
|
1136
|
+
}));
|
|
1137
|
+
|
|
1138
|
+
//#endregion
|
|
1139
|
+
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
|
|
1140
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1141
|
+
const path$2 = require("node:path");
|
|
1142
|
+
const WIN_SLASH = "\\\\/";
|
|
1143
|
+
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1144
|
+
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
1145
|
+
/**
|
|
1146
|
+
* Posix glob regex
|
|
1147
|
+
*/
|
|
1148
|
+
const DOT_LITERAL = "\\.";
|
|
1149
|
+
const PLUS_LITERAL = "\\+";
|
|
1150
|
+
const QMARK_LITERAL = "\\?";
|
|
1151
|
+
const SLASH_LITERAL = "\\/";
|
|
1152
|
+
const ONE_CHAR = "(?=.)";
|
|
1153
|
+
const QMARK = "[^/]";
|
|
1154
|
+
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
1155
|
+
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
1156
|
+
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
1157
|
+
const POSIX_CHARS = {
|
|
1158
|
+
DOT_LITERAL,
|
|
1159
|
+
PLUS_LITERAL,
|
|
1160
|
+
QMARK_LITERAL,
|
|
1161
|
+
SLASH_LITERAL,
|
|
1162
|
+
ONE_CHAR,
|
|
1163
|
+
QMARK,
|
|
1164
|
+
END_ANCHOR,
|
|
1165
|
+
DOTS_SLASH,
|
|
1166
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
1167
|
+
NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
|
|
1168
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
|
|
1169
|
+
NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
|
|
1170
|
+
QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
|
|
1171
|
+
STAR: `${QMARK}*?`,
|
|
1172
|
+
START_ANCHOR
|
|
1173
|
+
};
|
|
1174
|
+
/**
|
|
1175
|
+
* Windows glob regex
|
|
1176
|
+
*/
|
|
1177
|
+
const WINDOWS_CHARS = {
|
|
1178
|
+
...POSIX_CHARS,
|
|
1179
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
1180
|
+
QMARK: WIN_NO_SLASH,
|
|
1181
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
1182
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
1183
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
1184
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
1185
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
1186
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
1187
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
1188
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
1189
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
1190
|
+
};
|
|
1191
|
+
/**
|
|
1192
|
+
* POSIX Bracket Regex
|
|
1193
|
+
*/
|
|
1194
|
+
const POSIX_REGEX_SOURCE = {
|
|
1195
|
+
__proto__: null,
|
|
1196
|
+
alnum: "a-zA-Z0-9",
|
|
1197
|
+
alpha: "a-zA-Z",
|
|
1198
|
+
ascii: "\\x00-\\x7F",
|
|
1199
|
+
blank: " \\t",
|
|
1200
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
1201
|
+
digit: "0-9",
|
|
1202
|
+
graph: "\\x21-\\x7E",
|
|
1203
|
+
lower: "a-z",
|
|
1204
|
+
print: "\\x20-\\x7E ",
|
|
1205
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
1206
|
+
space: " \\t\\r\\n\\v\\f",
|
|
1207
|
+
upper: "A-Z",
|
|
1208
|
+
word: "A-Za-z0-9_",
|
|
1209
|
+
xdigit: "A-Fa-f0-9"
|
|
1210
|
+
};
|
|
1211
|
+
module.exports = {
|
|
1212
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
1213
|
+
MAX_LENGTH: 1024 * 64,
|
|
1214
|
+
POSIX_REGEX_SOURCE,
|
|
1215
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
1216
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
1217
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
1218
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
1219
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
1220
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
1221
|
+
REPLACEMENTS: {
|
|
1222
|
+
__proto__: null,
|
|
1223
|
+
"***": "*",
|
|
1224
|
+
"**/**": "**",
|
|
1225
|
+
"**/**/**": "**"
|
|
1226
|
+
},
|
|
1227
|
+
CHAR_0: 48,
|
|
1228
|
+
CHAR_9: 57,
|
|
1229
|
+
CHAR_UPPERCASE_A: 65,
|
|
1230
|
+
CHAR_LOWERCASE_A: 97,
|
|
1231
|
+
CHAR_UPPERCASE_Z: 90,
|
|
1232
|
+
CHAR_LOWERCASE_Z: 122,
|
|
1233
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
1234
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
1235
|
+
CHAR_ASTERISK: 42,
|
|
1236
|
+
CHAR_AMPERSAND: 38,
|
|
1237
|
+
CHAR_AT: 64,
|
|
1238
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
1239
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
1240
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
1241
|
+
CHAR_COLON: 58,
|
|
1242
|
+
CHAR_COMMA: 44,
|
|
1243
|
+
CHAR_DOT: 46,
|
|
1244
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
1245
|
+
CHAR_EQUAL: 61,
|
|
1246
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
1247
|
+
CHAR_FORM_FEED: 12,
|
|
1248
|
+
CHAR_FORWARD_SLASH: 47,
|
|
1249
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
1250
|
+
CHAR_HASH: 35,
|
|
1251
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
1252
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
1253
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
1254
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
1255
|
+
CHAR_LINE_FEED: 10,
|
|
1256
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
1257
|
+
CHAR_PERCENT: 37,
|
|
1258
|
+
CHAR_PLUS: 43,
|
|
1259
|
+
CHAR_QUESTION_MARK: 63,
|
|
1260
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
1261
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
1262
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
1263
|
+
CHAR_SEMICOLON: 59,
|
|
1264
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
1265
|
+
CHAR_SPACE: 32,
|
|
1266
|
+
CHAR_TAB: 9,
|
|
1267
|
+
CHAR_UNDERSCORE: 95,
|
|
1268
|
+
CHAR_VERTICAL_LINE: 124,
|
|
1269
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
1270
|
+
SEP: path$2.sep,
|
|
1271
|
+
extglobChars(chars) {
|
|
1272
|
+
return {
|
|
1273
|
+
"!": {
|
|
1274
|
+
type: "negate",
|
|
1275
|
+
open: "(?:(?!(?:",
|
|
1276
|
+
close: `))${chars.STAR})`
|
|
1277
|
+
},
|
|
1278
|
+
"?": {
|
|
1279
|
+
type: "qmark",
|
|
1280
|
+
open: "(?:",
|
|
1281
|
+
close: ")?"
|
|
1282
|
+
},
|
|
1283
|
+
"+": {
|
|
1284
|
+
type: "plus",
|
|
1285
|
+
open: "(?:",
|
|
1286
|
+
close: ")+"
|
|
1287
|
+
},
|
|
1288
|
+
"*": {
|
|
1289
|
+
type: "star",
|
|
1290
|
+
open: "(?:",
|
|
1291
|
+
close: ")*"
|
|
1292
|
+
},
|
|
1293
|
+
"@": {
|
|
1294
|
+
type: "at",
|
|
1295
|
+
open: "(?:",
|
|
1296
|
+
close: ")"
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
},
|
|
1300
|
+
globChars(win32) {
|
|
1301
|
+
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
}));
|
|
1305
|
+
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
|
|
1308
|
+
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1309
|
+
const path$1 = require("node:path");
|
|
1310
|
+
const win32 = process.platform === "win32";
|
|
1311
|
+
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
1312
|
+
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
1313
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
1314
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
1315
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
1316
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
1317
|
+
exports.removeBackslashes = (str) => {
|
|
1318
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
|
1319
|
+
return match === "\\" ? "" : match;
|
|
1320
|
+
});
|
|
1321
|
+
};
|
|
1322
|
+
exports.supportsLookbehinds = () => {
|
|
1323
|
+
const segs = process.version.slice(1).split(".").map(Number);
|
|
1324
|
+
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
|
|
1325
|
+
return false;
|
|
1326
|
+
};
|
|
1327
|
+
exports.isWindows = (options) => {
|
|
1328
|
+
if (options && typeof options.windows === "boolean") return options.windows;
|
|
1329
|
+
return win32 === true || path$1.sep === "\\";
|
|
1330
|
+
};
|
|
1331
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
1332
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
1333
|
+
if (idx === -1) return input;
|
|
1334
|
+
if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
|
|
1335
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
1336
|
+
};
|
|
1337
|
+
exports.removePrefix = (input, state = {}) => {
|
|
1338
|
+
let output = input;
|
|
1339
|
+
if (output.startsWith("./")) {
|
|
1340
|
+
output = output.slice(2);
|
|
1341
|
+
state.prefix = "./";
|
|
1342
|
+
}
|
|
1343
|
+
return output;
|
|
1344
|
+
};
|
|
1345
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
1346
|
+
let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
|
|
1347
|
+
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
1348
|
+
return output;
|
|
1349
|
+
};
|
|
1350
|
+
}));
|
|
1351
|
+
|
|
1352
|
+
//#endregion
|
|
1353
|
+
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
|
|
1354
|
+
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1355
|
+
const utils = require_utils();
|
|
1356
|
+
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
1357
|
+
const isPathSeparator = (code) => {
|
|
1358
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
1359
|
+
};
|
|
1360
|
+
const depth = (token) => {
|
|
1361
|
+
if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
|
|
1362
|
+
};
|
|
1363
|
+
/**
|
|
1364
|
+
* Quickly scans a glob pattern and returns an object with a handful of
|
|
1365
|
+
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
1366
|
+
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
|
1367
|
+
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
|
1368
|
+
*
|
|
1369
|
+
* ```js
|
|
1370
|
+
* const pm = require('picomatch');
|
|
1371
|
+
* console.log(pm.scan('foo/bar/*.js'));
|
|
1372
|
+
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
1373
|
+
* ```
|
|
1374
|
+
* @param {String} `str`
|
|
1375
|
+
* @param {Object} `options`
|
|
1376
|
+
* @return {Object} Returns an object with tokens and regex source string.
|
|
1377
|
+
* @api public
|
|
1378
|
+
*/
|
|
1379
|
+
const scan = (input, options) => {
|
|
1380
|
+
const opts = options || {};
|
|
1381
|
+
const length = input.length - 1;
|
|
1382
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
1383
|
+
const slashes = [];
|
|
1384
|
+
const tokens = [];
|
|
1385
|
+
const parts = [];
|
|
1386
|
+
let str = input;
|
|
1387
|
+
let index = -1;
|
|
1388
|
+
let start = 0;
|
|
1389
|
+
let lastIndex = 0;
|
|
1390
|
+
let isBrace = false;
|
|
1391
|
+
let isBracket = false;
|
|
1392
|
+
let isGlob = false;
|
|
1393
|
+
let isExtglob = false;
|
|
1394
|
+
let isGlobstar = false;
|
|
1395
|
+
let braceEscaped = false;
|
|
1396
|
+
let backslashes = false;
|
|
1397
|
+
let negated = false;
|
|
1398
|
+
let negatedExtglob = false;
|
|
1399
|
+
let finished = false;
|
|
1400
|
+
let braces = 0;
|
|
1401
|
+
let prev;
|
|
1402
|
+
let code;
|
|
1403
|
+
let token = {
|
|
1404
|
+
value: "",
|
|
1405
|
+
depth: 0,
|
|
1406
|
+
isGlob: false
|
|
1407
|
+
};
|
|
1408
|
+
const eos = () => index >= length;
|
|
1409
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
1410
|
+
const advance = () => {
|
|
1411
|
+
prev = code;
|
|
1412
|
+
return str.charCodeAt(++index);
|
|
1413
|
+
};
|
|
1414
|
+
while (index < length) {
|
|
1415
|
+
code = advance();
|
|
1416
|
+
let next;
|
|
1417
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1418
|
+
backslashes = token.backslashes = true;
|
|
1419
|
+
code = advance();
|
|
1420
|
+
if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
1424
|
+
braces++;
|
|
1425
|
+
while (eos() !== true && (code = advance())) {
|
|
1426
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1427
|
+
backslashes = token.backslashes = true;
|
|
1428
|
+
advance();
|
|
1429
|
+
continue;
|
|
1430
|
+
}
|
|
1431
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1432
|
+
braces++;
|
|
1433
|
+
continue;
|
|
1434
|
+
}
|
|
1435
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
1436
|
+
isBrace = token.isBrace = true;
|
|
1437
|
+
isGlob = token.isGlob = true;
|
|
1438
|
+
finished = true;
|
|
1439
|
+
if (scanToEnd === true) continue;
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1442
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
1443
|
+
isBrace = token.isBrace = true;
|
|
1444
|
+
isGlob = token.isGlob = true;
|
|
1445
|
+
finished = true;
|
|
1446
|
+
if (scanToEnd === true) continue;
|
|
1447
|
+
break;
|
|
1448
|
+
}
|
|
1449
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
1450
|
+
braces--;
|
|
1451
|
+
if (braces === 0) {
|
|
1452
|
+
braceEscaped = false;
|
|
1453
|
+
isBrace = token.isBrace = true;
|
|
1454
|
+
finished = true;
|
|
1455
|
+
break;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
if (scanToEnd === true) continue;
|
|
1460
|
+
break;
|
|
1461
|
+
}
|
|
1462
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
1463
|
+
slashes.push(index);
|
|
1464
|
+
tokens.push(token);
|
|
1465
|
+
token = {
|
|
1466
|
+
value: "",
|
|
1467
|
+
depth: 0,
|
|
1468
|
+
isGlob: false
|
|
1469
|
+
};
|
|
1470
|
+
if (finished === true) continue;
|
|
1471
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
1472
|
+
start += 2;
|
|
1473
|
+
continue;
|
|
1474
|
+
}
|
|
1475
|
+
lastIndex = index + 1;
|
|
1476
|
+
continue;
|
|
1477
|
+
}
|
|
1478
|
+
if (opts.noext !== true) {
|
|
1479
|
+
if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
1480
|
+
isGlob = token.isGlob = true;
|
|
1481
|
+
isExtglob = token.isExtglob = true;
|
|
1482
|
+
finished = true;
|
|
1483
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
1484
|
+
if (scanToEnd === true) {
|
|
1485
|
+
while (eos() !== true && (code = advance())) {
|
|
1486
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1487
|
+
backslashes = token.backslashes = true;
|
|
1488
|
+
code = advance();
|
|
1489
|
+
continue;
|
|
1490
|
+
}
|
|
1491
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1492
|
+
isGlob = token.isGlob = true;
|
|
1493
|
+
finished = true;
|
|
1494
|
+
break;
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
continue;
|
|
1498
|
+
}
|
|
1499
|
+
break;
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
if (code === CHAR_ASTERISK) {
|
|
1503
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
1504
|
+
isGlob = token.isGlob = true;
|
|
1505
|
+
finished = true;
|
|
1506
|
+
if (scanToEnd === true) continue;
|
|
1507
|
+
break;
|
|
1508
|
+
}
|
|
1509
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
1510
|
+
isGlob = token.isGlob = true;
|
|
1511
|
+
finished = true;
|
|
1512
|
+
if (scanToEnd === true) continue;
|
|
1513
|
+
break;
|
|
1514
|
+
}
|
|
1515
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1516
|
+
while (eos() !== true && (next = advance())) {
|
|
1517
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
1518
|
+
backslashes = token.backslashes = true;
|
|
1519
|
+
advance();
|
|
1520
|
+
continue;
|
|
1521
|
+
}
|
|
1522
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1523
|
+
isBracket = token.isBracket = true;
|
|
1524
|
+
isGlob = token.isGlob = true;
|
|
1525
|
+
finished = true;
|
|
1526
|
+
break;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
if (scanToEnd === true) continue;
|
|
1530
|
+
break;
|
|
1531
|
+
}
|
|
1532
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1533
|
+
negated = token.negated = true;
|
|
1534
|
+
start++;
|
|
1535
|
+
continue;
|
|
1536
|
+
}
|
|
1537
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
1538
|
+
isGlob = token.isGlob = true;
|
|
1539
|
+
if (scanToEnd === true) {
|
|
1540
|
+
while (eos() !== true && (code = advance())) {
|
|
1541
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
1542
|
+
backslashes = token.backslashes = true;
|
|
1543
|
+
code = advance();
|
|
1544
|
+
continue;
|
|
1545
|
+
}
|
|
1546
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1547
|
+
finished = true;
|
|
1548
|
+
break;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
continue;
|
|
1552
|
+
}
|
|
1553
|
+
break;
|
|
1554
|
+
}
|
|
1555
|
+
if (isGlob === true) {
|
|
1556
|
+
finished = true;
|
|
1557
|
+
if (scanToEnd === true) continue;
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
if (opts.noext === true) {
|
|
1562
|
+
isExtglob = false;
|
|
1563
|
+
isGlob = false;
|
|
1564
|
+
}
|
|
1565
|
+
let base = str;
|
|
1566
|
+
let prefix = "";
|
|
1567
|
+
let glob = "";
|
|
1568
|
+
if (start > 0) {
|
|
1569
|
+
prefix = str.slice(0, start);
|
|
1570
|
+
str = str.slice(start);
|
|
1571
|
+
lastIndex -= start;
|
|
1572
|
+
}
|
|
1573
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
1574
|
+
base = str.slice(0, lastIndex);
|
|
1575
|
+
glob = str.slice(lastIndex);
|
|
1576
|
+
} else if (isGlob === true) {
|
|
1577
|
+
base = "";
|
|
1578
|
+
glob = str;
|
|
1579
|
+
} else base = str;
|
|
1580
|
+
if (base && base !== "" && base !== "/" && base !== str) {
|
|
1581
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
1582
|
+
}
|
|
1583
|
+
if (opts.unescape === true) {
|
|
1584
|
+
if (glob) glob = utils.removeBackslashes(glob);
|
|
1585
|
+
if (base && backslashes === true) base = utils.removeBackslashes(base);
|
|
1586
|
+
}
|
|
1587
|
+
const state = {
|
|
1588
|
+
prefix,
|
|
1589
|
+
input,
|
|
1590
|
+
start,
|
|
1591
|
+
base,
|
|
1592
|
+
glob,
|
|
1593
|
+
isBrace,
|
|
1594
|
+
isBracket,
|
|
1595
|
+
isGlob,
|
|
1596
|
+
isExtglob,
|
|
1597
|
+
isGlobstar,
|
|
1598
|
+
negated,
|
|
1599
|
+
negatedExtglob
|
|
1600
|
+
};
|
|
1601
|
+
if (opts.tokens === true) {
|
|
1602
|
+
state.maxDepth = 0;
|
|
1603
|
+
if (!isPathSeparator(code)) tokens.push(token);
|
|
1604
|
+
state.tokens = tokens;
|
|
1605
|
+
}
|
|
1606
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
1607
|
+
let prevIndex;
|
|
1608
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
1609
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
1610
|
+
const i = slashes[idx];
|
|
1611
|
+
const value = input.slice(n, i);
|
|
1612
|
+
if (opts.tokens) {
|
|
1613
|
+
if (idx === 0 && start !== 0) {
|
|
1614
|
+
tokens[idx].isPrefix = true;
|
|
1615
|
+
tokens[idx].value = prefix;
|
|
1616
|
+
} else tokens[idx].value = value;
|
|
1617
|
+
depth(tokens[idx]);
|
|
1618
|
+
state.maxDepth += tokens[idx].depth;
|
|
1619
|
+
}
|
|
1620
|
+
if (idx !== 0 || value !== "") parts.push(value);
|
|
1621
|
+
prevIndex = i;
|
|
1622
|
+
}
|
|
1623
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
1624
|
+
const value = input.slice(prevIndex + 1);
|
|
1625
|
+
parts.push(value);
|
|
1626
|
+
if (opts.tokens) {
|
|
1627
|
+
tokens[tokens.length - 1].value = value;
|
|
1628
|
+
depth(tokens[tokens.length - 1]);
|
|
1629
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
state.slashes = slashes;
|
|
1633
|
+
state.parts = parts;
|
|
1634
|
+
}
|
|
1635
|
+
return state;
|
|
1636
|
+
};
|
|
1637
|
+
module.exports = scan;
|
|
1638
|
+
}));
|
|
1639
|
+
|
|
1640
|
+
//#endregion
|
|
1641
|
+
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
|
|
1642
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1643
|
+
const constants = require_constants();
|
|
1644
|
+
const utils = require_utils();
|
|
1645
|
+
/**
|
|
1646
|
+
* Constants
|
|
1647
|
+
*/
|
|
1648
|
+
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
|
|
1649
|
+
/**
|
|
1650
|
+
* Helpers
|
|
1651
|
+
*/
|
|
1652
|
+
const expandRange = (args, options) => {
|
|
1653
|
+
if (typeof options.expandRange === "function") return options.expandRange(...args, options);
|
|
1654
|
+
args.sort();
|
|
1655
|
+
const value = `[${args.join("-")}]`;
|
|
1656
|
+
try {
|
|
1657
|
+
new RegExp(value);
|
|
1658
|
+
} catch (ex) {
|
|
1659
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
1660
|
+
}
|
|
1661
|
+
return value;
|
|
1662
|
+
};
|
|
1663
|
+
/**
|
|
1664
|
+
* Create the message for a syntax error
|
|
1665
|
+
*/
|
|
1666
|
+
const syntaxError = (type, char) => {
|
|
1667
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
1668
|
+
};
|
|
1669
|
+
const splitTopLevel = (input) => {
|
|
1670
|
+
const parts = [];
|
|
1671
|
+
let bracket = 0;
|
|
1672
|
+
let paren = 0;
|
|
1673
|
+
let quote = 0;
|
|
1674
|
+
let value = "";
|
|
1675
|
+
let escaped = false;
|
|
1676
|
+
for (const ch of input) {
|
|
1677
|
+
if (escaped === true) {
|
|
1678
|
+
value += ch;
|
|
1679
|
+
escaped = false;
|
|
1680
|
+
continue;
|
|
1681
|
+
}
|
|
1682
|
+
if (ch === "\\") {
|
|
1683
|
+
value += ch;
|
|
1684
|
+
escaped = true;
|
|
1685
|
+
continue;
|
|
1686
|
+
}
|
|
1687
|
+
if (ch === "\"") {
|
|
1688
|
+
quote = quote === 1 ? 0 : 1;
|
|
1689
|
+
value += ch;
|
|
1690
|
+
continue;
|
|
1691
|
+
}
|
|
1692
|
+
if (quote === 0) {
|
|
1693
|
+
if (ch === "[") bracket++;
|
|
1694
|
+
else if (ch === "]" && bracket > 0) bracket--;
|
|
1695
|
+
else if (bracket === 0) {
|
|
1696
|
+
if (ch === "(") paren++;
|
|
1697
|
+
else if (ch === ")" && paren > 0) paren--;
|
|
1698
|
+
else if (ch === "|" && paren === 0) {
|
|
1699
|
+
parts.push(value);
|
|
1700
|
+
value = "";
|
|
1701
|
+
continue;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
value += ch;
|
|
1706
|
+
}
|
|
1707
|
+
parts.push(value);
|
|
1708
|
+
return parts;
|
|
1709
|
+
};
|
|
1710
|
+
const isPlainBranch = (branch) => {
|
|
1711
|
+
let escaped = false;
|
|
1712
|
+
for (const ch of branch) {
|
|
1713
|
+
if (escaped === true) {
|
|
1714
|
+
escaped = false;
|
|
1715
|
+
continue;
|
|
1716
|
+
}
|
|
1717
|
+
if (ch === "\\") {
|
|
1718
|
+
escaped = true;
|
|
1719
|
+
continue;
|
|
1720
|
+
}
|
|
1721
|
+
if (/[?*+@!()[\]{}]/.test(ch)) return false;
|
|
1722
|
+
}
|
|
1723
|
+
return true;
|
|
1724
|
+
};
|
|
1725
|
+
const normalizeSimpleBranch = (branch) => {
|
|
1726
|
+
let value = branch.trim();
|
|
1727
|
+
let changed = true;
|
|
1728
|
+
while (changed === true) {
|
|
1729
|
+
changed = false;
|
|
1730
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
1731
|
+
value = value.slice(2, -1);
|
|
1732
|
+
changed = true;
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
if (!isPlainBranch(value)) return;
|
|
1736
|
+
return value.replace(/\\(.)/g, "$1");
|
|
1737
|
+
};
|
|
1738
|
+
const hasRepeatedCharPrefixOverlap = (branches) => {
|
|
1739
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
1740
|
+
for (let i = 0; i < values.length; i++) for (let j = i + 1; j < values.length; j++) {
|
|
1741
|
+
const a = values[i];
|
|
1742
|
+
const b = values[j];
|
|
1743
|
+
const char = a[0];
|
|
1744
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
|
|
1745
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
|
|
1746
|
+
}
|
|
1747
|
+
return false;
|
|
1748
|
+
};
|
|
1749
|
+
const parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
1750
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
|
|
1751
|
+
let bracket = 0;
|
|
1752
|
+
let paren = 0;
|
|
1753
|
+
let quote = 0;
|
|
1754
|
+
let escaped = false;
|
|
1755
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
1756
|
+
const ch = pattern[i];
|
|
1757
|
+
if (escaped === true) {
|
|
1758
|
+
escaped = false;
|
|
1759
|
+
continue;
|
|
1760
|
+
}
|
|
1761
|
+
if (ch === "\\") {
|
|
1762
|
+
escaped = true;
|
|
1763
|
+
continue;
|
|
1764
|
+
}
|
|
1765
|
+
if (ch === "\"") {
|
|
1766
|
+
quote = quote === 1 ? 0 : 1;
|
|
1767
|
+
continue;
|
|
1768
|
+
}
|
|
1769
|
+
if (quote === 1) continue;
|
|
1770
|
+
if (ch === "[") {
|
|
1771
|
+
bracket++;
|
|
1772
|
+
continue;
|
|
1773
|
+
}
|
|
1774
|
+
if (ch === "]" && bracket > 0) {
|
|
1775
|
+
bracket--;
|
|
1776
|
+
continue;
|
|
1777
|
+
}
|
|
1778
|
+
if (bracket > 0) continue;
|
|
1779
|
+
if (ch === "(") {
|
|
1780
|
+
paren++;
|
|
1781
|
+
continue;
|
|
1782
|
+
}
|
|
1783
|
+
if (ch === ")") {
|
|
1784
|
+
paren--;
|
|
1785
|
+
if (paren === 0) {
|
|
1786
|
+
if (requireEnd === true && i !== pattern.length - 1) return;
|
|
1787
|
+
return {
|
|
1788
|
+
type: pattern[0],
|
|
1789
|
+
body: pattern.slice(2, i),
|
|
1790
|
+
end: i
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
const getStarExtglobSequenceOutput = (pattern) => {
|
|
1797
|
+
let index = 0;
|
|
1798
|
+
const chars = [];
|
|
1799
|
+
while (index < pattern.length) {
|
|
1800
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
1801
|
+
if (!match || match.type !== "*") return;
|
|
1802
|
+
const branches = splitTopLevel(match.body).map((branch) => branch.trim());
|
|
1803
|
+
if (branches.length !== 1) return;
|
|
1804
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
1805
|
+
if (!branch || branch.length !== 1) return;
|
|
1806
|
+
chars.push(branch);
|
|
1807
|
+
index += match.end + 1;
|
|
1808
|
+
}
|
|
1809
|
+
if (chars.length < 1) return;
|
|
1810
|
+
return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
|
|
1811
|
+
};
|
|
1812
|
+
const repeatedExtglobRecursion = (pattern) => {
|
|
1813
|
+
let depth = 0;
|
|
1814
|
+
let value = pattern.trim();
|
|
1815
|
+
let match = parseRepeatedExtglob(value);
|
|
1816
|
+
while (match) {
|
|
1817
|
+
depth++;
|
|
1818
|
+
value = match.body.trim();
|
|
1819
|
+
match = parseRepeatedExtglob(value);
|
|
1820
|
+
}
|
|
1821
|
+
return depth;
|
|
1822
|
+
};
|
|
1823
|
+
const analyzeRepeatedExtglob = (body, options) => {
|
|
1824
|
+
if (options.maxExtglobRecursion === false) return { risky: false };
|
|
1825
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
1826
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
1827
|
+
if (branches.length > 1) {
|
|
1828
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
|
|
1829
|
+
}
|
|
1830
|
+
for (const branch of branches) {
|
|
1831
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
1832
|
+
if (safeOutput) return {
|
|
1833
|
+
risky: true,
|
|
1834
|
+
safeOutput
|
|
1835
|
+
};
|
|
1836
|
+
if (repeatedExtglobRecursion(branch) > max) return { risky: true };
|
|
1837
|
+
}
|
|
1838
|
+
return { risky: false };
|
|
1839
|
+
};
|
|
1840
|
+
/**
|
|
1841
|
+
* Parse the given input string.
|
|
1842
|
+
* @param {String} input
|
|
1843
|
+
* @param {Object} options
|
|
1844
|
+
* @return {Object}
|
|
1845
|
+
*/
|
|
1846
|
+
const parse = (input, options) => {
|
|
1847
|
+
if (typeof input !== "string") throw new TypeError("Expected a string");
|
|
1848
|
+
input = REPLACEMENTS[input] || input;
|
|
1849
|
+
const opts = { ...options };
|
|
1850
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1851
|
+
let len = input.length;
|
|
1852
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1853
|
+
const bos = {
|
|
1854
|
+
type: "bos",
|
|
1855
|
+
value: "",
|
|
1856
|
+
output: opts.prepend || ""
|
|
1857
|
+
};
|
|
1858
|
+
const tokens = [bos];
|
|
1859
|
+
const capture = opts.capture ? "" : "?:";
|
|
1860
|
+
const win32 = utils.isWindows(options);
|
|
1861
|
+
const PLATFORM_CHARS = constants.globChars(win32);
|
|
1862
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
1863
|
+
const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
|
|
1864
|
+
const globstar = (opts) => {
|
|
1865
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1866
|
+
};
|
|
1867
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
1868
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
1869
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
1870
|
+
if (opts.capture) star = `(${star})`;
|
|
1871
|
+
if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
|
|
1872
|
+
const state = {
|
|
1873
|
+
input,
|
|
1874
|
+
index: -1,
|
|
1875
|
+
start: 0,
|
|
1876
|
+
dot: opts.dot === true,
|
|
1877
|
+
consumed: "",
|
|
1878
|
+
output: "",
|
|
1879
|
+
prefix: "",
|
|
1880
|
+
backtrack: false,
|
|
1881
|
+
negated: false,
|
|
1882
|
+
brackets: 0,
|
|
1883
|
+
braces: 0,
|
|
1884
|
+
parens: 0,
|
|
1885
|
+
quotes: 0,
|
|
1886
|
+
globstar: false,
|
|
1887
|
+
tokens
|
|
1888
|
+
};
|
|
1889
|
+
input = utils.removePrefix(input, state);
|
|
1890
|
+
len = input.length;
|
|
1891
|
+
const extglobs = [];
|
|
1892
|
+
const braces = [];
|
|
1893
|
+
const stack = [];
|
|
1894
|
+
let prev = bos;
|
|
1895
|
+
let value;
|
|
1896
|
+
/**
|
|
1897
|
+
* Tokenizing helpers
|
|
1898
|
+
*/
|
|
1899
|
+
const eos = () => state.index === len - 1;
|
|
1900
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
1901
|
+
const advance = state.advance = () => input[++state.index] || "";
|
|
1902
|
+
const remaining = () => input.slice(state.index + 1);
|
|
1903
|
+
const consume = (value = "", num = 0) => {
|
|
1904
|
+
state.consumed += value;
|
|
1905
|
+
state.index += num;
|
|
1906
|
+
};
|
|
1907
|
+
const append = (token) => {
|
|
1908
|
+
state.output += token.output != null ? token.output : token.value;
|
|
1909
|
+
consume(token.value);
|
|
1910
|
+
};
|
|
1911
|
+
const negate = () => {
|
|
1912
|
+
let count = 1;
|
|
1913
|
+
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
1914
|
+
advance();
|
|
1915
|
+
state.start++;
|
|
1916
|
+
count++;
|
|
1917
|
+
}
|
|
1918
|
+
if (count % 2 === 0) return false;
|
|
1919
|
+
state.negated = true;
|
|
1920
|
+
state.start++;
|
|
1921
|
+
return true;
|
|
1922
|
+
};
|
|
1923
|
+
const increment = (type) => {
|
|
1924
|
+
state[type]++;
|
|
1925
|
+
stack.push(type);
|
|
1926
|
+
};
|
|
1927
|
+
const decrement = (type) => {
|
|
1928
|
+
state[type]--;
|
|
1929
|
+
stack.pop();
|
|
1930
|
+
};
|
|
1931
|
+
/**
|
|
1932
|
+
* Push tokens onto the tokens array. This helper speeds up
|
|
1933
|
+
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
1934
|
+
* and 2) helping us avoid creating extra tokens when consecutive
|
|
1935
|
+
* characters are plain text. This improves performance and simplifies
|
|
1936
|
+
* lookbehinds.
|
|
1937
|
+
*/
|
|
1938
|
+
const push = (tok) => {
|
|
1939
|
+
if (prev.type === "globstar") {
|
|
1940
|
+
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
1941
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
1942
|
+
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
1943
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
1944
|
+
prev.type = "star";
|
|
1945
|
+
prev.value = "*";
|
|
1946
|
+
prev.output = star;
|
|
1947
|
+
state.output += prev.output;
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
|
|
1951
|
+
if (tok.value || tok.output) append(tok);
|
|
1952
|
+
if (prev && prev.type === "text" && tok.type === "text") {
|
|
1953
|
+
prev.value += tok.value;
|
|
1954
|
+
prev.output = (prev.output || "") + tok.value;
|
|
1955
|
+
return;
|
|
1956
|
+
}
|
|
1957
|
+
tok.prev = prev;
|
|
1958
|
+
tokens.push(tok);
|
|
1959
|
+
prev = tok;
|
|
1960
|
+
};
|
|
1961
|
+
const extglobOpen = (type, value) => {
|
|
1962
|
+
const token = {
|
|
1963
|
+
...EXTGLOB_CHARS[value],
|
|
1964
|
+
conditions: 1,
|
|
1965
|
+
inner: ""
|
|
1966
|
+
};
|
|
1967
|
+
token.prev = prev;
|
|
1968
|
+
token.parens = state.parens;
|
|
1969
|
+
token.output = state.output;
|
|
1970
|
+
token.startIndex = state.index;
|
|
1971
|
+
token.tokensIndex = tokens.length;
|
|
1972
|
+
const output = (opts.capture ? "(" : "") + token.open;
|
|
1973
|
+
increment("parens");
|
|
1974
|
+
push({
|
|
1975
|
+
type,
|
|
1976
|
+
value,
|
|
1977
|
+
output: state.output ? "" : ONE_CHAR
|
|
1978
|
+
});
|
|
1979
|
+
push({
|
|
1980
|
+
type: "paren",
|
|
1981
|
+
extglob: true,
|
|
1982
|
+
value: advance(),
|
|
1983
|
+
output
|
|
1984
|
+
});
|
|
1985
|
+
extglobs.push(token);
|
|
1986
|
+
};
|
|
1987
|
+
const extglobClose = (token) => {
|
|
1988
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
1989
|
+
const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
|
|
1990
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
1991
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
1992
|
+
const open = tokens[token.tokensIndex];
|
|
1993
|
+
open.type = "text";
|
|
1994
|
+
open.value = literal;
|
|
1995
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
1996
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
1997
|
+
tokens[i].value = "";
|
|
1998
|
+
tokens[i].output = "";
|
|
1999
|
+
delete tokens[i].suffix;
|
|
2000
|
+
}
|
|
2001
|
+
state.output = token.output + open.output;
|
|
2002
|
+
state.backtrack = true;
|
|
2003
|
+
push({
|
|
2004
|
+
type: "paren",
|
|
2005
|
+
extglob: true,
|
|
2006
|
+
value,
|
|
2007
|
+
output: ""
|
|
2008
|
+
});
|
|
2009
|
+
decrement("parens");
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
let output = token.close + (opts.capture ? ")" : "");
|
|
2013
|
+
let rest;
|
|
2014
|
+
if (token.type === "negate") {
|
|
2015
|
+
let extglobStar = star;
|
|
2016
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
|
|
2017
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
|
|
2018
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
|
|
2019
|
+
...options,
|
|
2020
|
+
fastpaths: false
|
|
2021
|
+
}).output})${extglobStar})`;
|
|
2022
|
+
if (token.prev.type === "bos") state.negatedExtglob = true;
|
|
2023
|
+
}
|
|
2024
|
+
push({
|
|
2025
|
+
type: "paren",
|
|
2026
|
+
extglob: true,
|
|
2027
|
+
value,
|
|
2028
|
+
output
|
|
2029
|
+
});
|
|
2030
|
+
decrement("parens");
|
|
2031
|
+
};
|
|
2032
|
+
/**
|
|
2033
|
+
* Fast paths
|
|
2034
|
+
*/
|
|
2035
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
2036
|
+
let backslashes = false;
|
|
2037
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
2038
|
+
if (first === "\\") {
|
|
2039
|
+
backslashes = true;
|
|
2040
|
+
return m;
|
|
2041
|
+
}
|
|
2042
|
+
if (first === "?") {
|
|
2043
|
+
if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
2044
|
+
if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
2045
|
+
return QMARK.repeat(chars.length);
|
|
2046
|
+
}
|
|
2047
|
+
if (first === ".") return DOT_LITERAL.repeat(chars.length);
|
|
2048
|
+
if (first === "*") {
|
|
2049
|
+
if (esc) return esc + first + (rest ? star : "");
|
|
2050
|
+
return star;
|
|
2051
|
+
}
|
|
2052
|
+
return esc ? m : `\\${m}`;
|
|
2053
|
+
});
|
|
2054
|
+
if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
|
|
2055
|
+
else output = output.replace(/\\+/g, (m) => {
|
|
2056
|
+
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
2057
|
+
});
|
|
2058
|
+
if (output === input && opts.contains === true) {
|
|
2059
|
+
state.output = input;
|
|
2060
|
+
return state;
|
|
2061
|
+
}
|
|
2062
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
2063
|
+
return state;
|
|
2064
|
+
}
|
|
2065
|
+
/**
|
|
2066
|
+
* Tokenize input until we reach end-of-string
|
|
2067
|
+
*/
|
|
2068
|
+
while (!eos()) {
|
|
2069
|
+
value = advance();
|
|
2070
|
+
if (value === "\0") continue;
|
|
2071
|
+
/**
|
|
2072
|
+
* Escaped characters
|
|
2073
|
+
*/
|
|
2074
|
+
if (value === "\\") {
|
|
2075
|
+
const next = peek();
|
|
2076
|
+
if (next === "/" && opts.bash !== true) continue;
|
|
2077
|
+
if (next === "." || next === ";") continue;
|
|
2078
|
+
if (!next) {
|
|
2079
|
+
value += "\\";
|
|
2080
|
+
push({
|
|
2081
|
+
type: "text",
|
|
2082
|
+
value
|
|
2083
|
+
});
|
|
2084
|
+
continue;
|
|
2085
|
+
}
|
|
2086
|
+
const match = /^\\+/.exec(remaining());
|
|
2087
|
+
let slashes = 0;
|
|
2088
|
+
if (match && match[0].length > 2) {
|
|
2089
|
+
slashes = match[0].length;
|
|
2090
|
+
state.index += slashes;
|
|
2091
|
+
if (slashes % 2 !== 0) value += "\\";
|
|
2092
|
+
}
|
|
2093
|
+
if (opts.unescape === true) value = advance();
|
|
2094
|
+
else value += advance();
|
|
2095
|
+
if (state.brackets === 0) {
|
|
2096
|
+
push({
|
|
2097
|
+
type: "text",
|
|
2098
|
+
value
|
|
2099
|
+
});
|
|
2100
|
+
continue;
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
/**
|
|
2104
|
+
* If we're inside a regex character class, continue
|
|
2105
|
+
* until we reach the closing bracket.
|
|
2106
|
+
*/
|
|
2107
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
2108
|
+
if (opts.posix !== false && value === ":") {
|
|
2109
|
+
const inner = prev.value.slice(1);
|
|
2110
|
+
if (inner.includes("[")) {
|
|
2111
|
+
prev.posix = true;
|
|
2112
|
+
if (inner.includes(":")) {
|
|
2113
|
+
const idx = prev.value.lastIndexOf("[");
|
|
2114
|
+
const pre = prev.value.slice(0, idx);
|
|
2115
|
+
const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
2116
|
+
if (posix) {
|
|
2117
|
+
prev.value = pre + posix;
|
|
2118
|
+
state.backtrack = true;
|
|
2119
|
+
advance();
|
|
2120
|
+
if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
|
|
2121
|
+
continue;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
|
|
2127
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
|
|
2128
|
+
if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
|
|
2129
|
+
prev.value += value;
|
|
2130
|
+
append({ value });
|
|
2131
|
+
continue;
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* If we're inside a quoted string, continue
|
|
2135
|
+
* until we reach the closing double quote.
|
|
2136
|
+
*/
|
|
2137
|
+
if (state.quotes === 1 && value !== "\"") {
|
|
2138
|
+
value = utils.escapeRegex(value);
|
|
2139
|
+
prev.value += value;
|
|
2140
|
+
append({ value });
|
|
2141
|
+
continue;
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* Double quotes
|
|
2145
|
+
*/
|
|
2146
|
+
if (value === "\"") {
|
|
2147
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
2148
|
+
if (opts.keepQuotes === true) push({
|
|
2149
|
+
type: "text",
|
|
2150
|
+
value
|
|
2151
|
+
});
|
|
2152
|
+
continue;
|
|
2153
|
+
}
|
|
2154
|
+
/**
|
|
2155
|
+
* Parentheses
|
|
2156
|
+
*/
|
|
2157
|
+
if (value === "(") {
|
|
2158
|
+
increment("parens");
|
|
2159
|
+
push({
|
|
2160
|
+
type: "paren",
|
|
2161
|
+
value
|
|
2162
|
+
});
|
|
2163
|
+
continue;
|
|
2164
|
+
}
|
|
2165
|
+
if (value === ")") {
|
|
2166
|
+
if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
|
|
2167
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
2168
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
2169
|
+
extglobClose(extglobs.pop());
|
|
2170
|
+
continue;
|
|
2171
|
+
}
|
|
2172
|
+
push({
|
|
2173
|
+
type: "paren",
|
|
2174
|
+
value,
|
|
2175
|
+
output: state.parens ? ")" : "\\)"
|
|
2176
|
+
});
|
|
2177
|
+
decrement("parens");
|
|
2178
|
+
continue;
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* Square brackets
|
|
2182
|
+
*/
|
|
2183
|
+
if (value === "[") {
|
|
2184
|
+
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
2185
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
2186
|
+
value = `\\${value}`;
|
|
2187
|
+
} else increment("brackets");
|
|
2188
|
+
push({
|
|
2189
|
+
type: "bracket",
|
|
2190
|
+
value
|
|
2191
|
+
});
|
|
2192
|
+
continue;
|
|
2193
|
+
}
|
|
2194
|
+
if (value === "]") {
|
|
2195
|
+
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
2196
|
+
push({
|
|
2197
|
+
type: "text",
|
|
2198
|
+
value,
|
|
2199
|
+
output: `\\${value}`
|
|
2200
|
+
});
|
|
2201
|
+
continue;
|
|
2202
|
+
}
|
|
2203
|
+
if (state.brackets === 0) {
|
|
2204
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
|
|
2205
|
+
push({
|
|
2206
|
+
type: "text",
|
|
2207
|
+
value,
|
|
2208
|
+
output: `\\${value}`
|
|
2209
|
+
});
|
|
2210
|
+
continue;
|
|
2211
|
+
}
|
|
2212
|
+
decrement("brackets");
|
|
2213
|
+
const prevValue = prev.value.slice(1);
|
|
2214
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
|
|
2215
|
+
prev.value += value;
|
|
2216
|
+
append({ value });
|
|
2217
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
|
|
2218
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
2219
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
2220
|
+
if (opts.literalBrackets === true) {
|
|
2221
|
+
state.output += escaped;
|
|
2222
|
+
prev.value = escaped;
|
|
2223
|
+
continue;
|
|
2224
|
+
}
|
|
2225
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
2226
|
+
state.output += prev.value;
|
|
2227
|
+
continue;
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* Braces
|
|
2231
|
+
*/
|
|
2232
|
+
if (value === "{" && opts.nobrace !== true) {
|
|
2233
|
+
increment("braces");
|
|
2234
|
+
const open = {
|
|
2235
|
+
type: "brace",
|
|
2236
|
+
value,
|
|
2237
|
+
output: "(",
|
|
2238
|
+
outputIndex: state.output.length,
|
|
2239
|
+
tokensIndex: state.tokens.length
|
|
2240
|
+
};
|
|
2241
|
+
braces.push(open);
|
|
2242
|
+
push(open);
|
|
2243
|
+
continue;
|
|
2244
|
+
}
|
|
2245
|
+
if (value === "}") {
|
|
2246
|
+
const brace = braces[braces.length - 1];
|
|
2247
|
+
if (opts.nobrace === true || !brace) {
|
|
2248
|
+
push({
|
|
2249
|
+
type: "text",
|
|
2250
|
+
value,
|
|
2251
|
+
output: value
|
|
2252
|
+
});
|
|
2253
|
+
continue;
|
|
2254
|
+
}
|
|
2255
|
+
let output = ")";
|
|
2256
|
+
if (brace.dots === true) {
|
|
2257
|
+
const arr = tokens.slice();
|
|
2258
|
+
const range = [];
|
|
2259
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
2260
|
+
tokens.pop();
|
|
2261
|
+
if (arr[i].type === "brace") break;
|
|
2262
|
+
if (arr[i].type !== "dots") range.unshift(arr[i].value);
|
|
2263
|
+
}
|
|
2264
|
+
output = expandRange(range, opts);
|
|
2265
|
+
state.backtrack = true;
|
|
2266
|
+
}
|
|
2267
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
2268
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
2269
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
2270
|
+
brace.value = brace.output = "\\{";
|
|
2271
|
+
value = output = "\\}";
|
|
2272
|
+
state.output = out;
|
|
2273
|
+
for (const t of toks) state.output += t.output || t.value;
|
|
2274
|
+
}
|
|
2275
|
+
push({
|
|
2276
|
+
type: "brace",
|
|
2277
|
+
value,
|
|
2278
|
+
output
|
|
2279
|
+
});
|
|
2280
|
+
decrement("braces");
|
|
2281
|
+
braces.pop();
|
|
2282
|
+
continue;
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* Pipes
|
|
2286
|
+
*/
|
|
2287
|
+
if (value === "|") {
|
|
2288
|
+
if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
|
|
2289
|
+
push({
|
|
2290
|
+
type: "text",
|
|
2291
|
+
value
|
|
2292
|
+
});
|
|
2293
|
+
continue;
|
|
2294
|
+
}
|
|
2295
|
+
/**
|
|
2296
|
+
* Commas
|
|
2297
|
+
*/
|
|
2298
|
+
if (value === ",") {
|
|
2299
|
+
let output = value;
|
|
2300
|
+
const brace = braces[braces.length - 1];
|
|
2301
|
+
if (brace && stack[stack.length - 1] === "braces") {
|
|
2302
|
+
brace.comma = true;
|
|
2303
|
+
output = "|";
|
|
2304
|
+
}
|
|
2305
|
+
push({
|
|
2306
|
+
type: "comma",
|
|
2307
|
+
value,
|
|
2308
|
+
output
|
|
2309
|
+
});
|
|
2310
|
+
continue;
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Slashes
|
|
2314
|
+
*/
|
|
2315
|
+
if (value === "/") {
|
|
2316
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
2317
|
+
state.start = state.index + 1;
|
|
2318
|
+
state.consumed = "";
|
|
2319
|
+
state.output = "";
|
|
2320
|
+
tokens.pop();
|
|
2321
|
+
prev = bos;
|
|
2322
|
+
continue;
|
|
2323
|
+
}
|
|
2324
|
+
push({
|
|
2325
|
+
type: "slash",
|
|
2326
|
+
value,
|
|
2327
|
+
output: SLASH_LITERAL
|
|
2328
|
+
});
|
|
2329
|
+
continue;
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* Dots
|
|
2333
|
+
*/
|
|
2334
|
+
if (value === ".") {
|
|
2335
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
2336
|
+
if (prev.value === ".") prev.output = DOT_LITERAL;
|
|
2337
|
+
const brace = braces[braces.length - 1];
|
|
2338
|
+
prev.type = "dots";
|
|
2339
|
+
prev.output += value;
|
|
2340
|
+
prev.value += value;
|
|
2341
|
+
brace.dots = true;
|
|
2342
|
+
continue;
|
|
2343
|
+
}
|
|
2344
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
2345
|
+
push({
|
|
2346
|
+
type: "text",
|
|
2347
|
+
value,
|
|
2348
|
+
output: DOT_LITERAL
|
|
2349
|
+
});
|
|
2350
|
+
continue;
|
|
2351
|
+
}
|
|
2352
|
+
push({
|
|
2353
|
+
type: "dot",
|
|
2354
|
+
value,
|
|
2355
|
+
output: DOT_LITERAL
|
|
2356
|
+
});
|
|
2357
|
+
continue;
|
|
2358
|
+
}
|
|
2359
|
+
/**
|
|
2360
|
+
* Question marks
|
|
2361
|
+
*/
|
|
2362
|
+
if (value === "?") {
|
|
2363
|
+
if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
2364
|
+
extglobOpen("qmark", value);
|
|
2365
|
+
continue;
|
|
2366
|
+
}
|
|
2367
|
+
if (prev && prev.type === "paren") {
|
|
2368
|
+
const next = peek();
|
|
2369
|
+
let output = value;
|
|
2370
|
+
if (next === "<" && !utils.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
2371
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
|
|
2372
|
+
push({
|
|
2373
|
+
type: "text",
|
|
2374
|
+
value,
|
|
2375
|
+
output
|
|
2376
|
+
});
|
|
2377
|
+
continue;
|
|
2378
|
+
}
|
|
2379
|
+
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
2380
|
+
push({
|
|
2381
|
+
type: "qmark",
|
|
2382
|
+
value,
|
|
2383
|
+
output: QMARK_NO_DOT
|
|
2384
|
+
});
|
|
2385
|
+
continue;
|
|
2386
|
+
}
|
|
2387
|
+
push({
|
|
2388
|
+
type: "qmark",
|
|
2389
|
+
value,
|
|
2390
|
+
output: QMARK
|
|
2391
|
+
});
|
|
2392
|
+
continue;
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Exclamation
|
|
2396
|
+
*/
|
|
2397
|
+
if (value === "!") {
|
|
2398
|
+
if (opts.noextglob !== true && peek() === "(") {
|
|
2399
|
+
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
2400
|
+
extglobOpen("negate", value);
|
|
2401
|
+
continue;
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
2405
|
+
negate();
|
|
2406
|
+
continue;
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
/**
|
|
2410
|
+
* Plus
|
|
2411
|
+
*/
|
|
2412
|
+
if (value === "+") {
|
|
2413
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
2414
|
+
extglobOpen("plus", value);
|
|
2415
|
+
continue;
|
|
2416
|
+
}
|
|
2417
|
+
if (prev && prev.value === "(" || opts.regex === false) {
|
|
2418
|
+
push({
|
|
2419
|
+
type: "plus",
|
|
2420
|
+
value,
|
|
2421
|
+
output: PLUS_LITERAL
|
|
2422
|
+
});
|
|
2423
|
+
continue;
|
|
2424
|
+
}
|
|
2425
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
2426
|
+
push({
|
|
2427
|
+
type: "plus",
|
|
2428
|
+
value
|
|
2429
|
+
});
|
|
2430
|
+
continue;
|
|
2431
|
+
}
|
|
2432
|
+
push({
|
|
2433
|
+
type: "plus",
|
|
2434
|
+
value: PLUS_LITERAL
|
|
2435
|
+
});
|
|
2436
|
+
continue;
|
|
2437
|
+
}
|
|
2438
|
+
/**
|
|
2439
|
+
* Plain text
|
|
2440
|
+
*/
|
|
2441
|
+
if (value === "@") {
|
|
2442
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
2443
|
+
push({
|
|
2444
|
+
type: "at",
|
|
2445
|
+
extglob: true,
|
|
2446
|
+
value,
|
|
2447
|
+
output: ""
|
|
2448
|
+
});
|
|
2449
|
+
continue;
|
|
2450
|
+
}
|
|
2451
|
+
push({
|
|
2452
|
+
type: "text",
|
|
2453
|
+
value
|
|
2454
|
+
});
|
|
2455
|
+
continue;
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* Plain text
|
|
2459
|
+
*/
|
|
2460
|
+
if (value !== "*") {
|
|
2461
|
+
if (value === "$" || value === "^") value = `\\${value}`;
|
|
2462
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
2463
|
+
if (match) {
|
|
2464
|
+
value += match[0];
|
|
2465
|
+
state.index += match[0].length;
|
|
2466
|
+
}
|
|
2467
|
+
push({
|
|
2468
|
+
type: "text",
|
|
2469
|
+
value
|
|
2470
|
+
});
|
|
2471
|
+
continue;
|
|
2472
|
+
}
|
|
2473
|
+
/**
|
|
2474
|
+
* Stars
|
|
2475
|
+
*/
|
|
2476
|
+
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
2477
|
+
prev.type = "star";
|
|
2478
|
+
prev.star = true;
|
|
2479
|
+
prev.value += value;
|
|
2480
|
+
prev.output = star;
|
|
2481
|
+
state.backtrack = true;
|
|
2482
|
+
state.globstar = true;
|
|
2483
|
+
consume(value);
|
|
2484
|
+
continue;
|
|
2485
|
+
}
|
|
2486
|
+
let rest = remaining();
|
|
2487
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
2488
|
+
extglobOpen("star", value);
|
|
2489
|
+
continue;
|
|
2490
|
+
}
|
|
2491
|
+
if (prev.type === "star") {
|
|
2492
|
+
if (opts.noglobstar === true) {
|
|
2493
|
+
consume(value);
|
|
2494
|
+
continue;
|
|
2495
|
+
}
|
|
2496
|
+
const prior = prev.prev;
|
|
2497
|
+
const before = prior.prev;
|
|
2498
|
+
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
2499
|
+
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
2500
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
2501
|
+
push({
|
|
2502
|
+
type: "star",
|
|
2503
|
+
value,
|
|
2504
|
+
output: ""
|
|
2505
|
+
});
|
|
2506
|
+
continue;
|
|
2507
|
+
}
|
|
2508
|
+
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
2509
|
+
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
2510
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
2511
|
+
push({
|
|
2512
|
+
type: "star",
|
|
2513
|
+
value,
|
|
2514
|
+
output: ""
|
|
2515
|
+
});
|
|
2516
|
+
continue;
|
|
2517
|
+
}
|
|
2518
|
+
while (rest.slice(0, 3) === "/**") {
|
|
2519
|
+
const after = input[state.index + 4];
|
|
2520
|
+
if (after && after !== "/") break;
|
|
2521
|
+
rest = rest.slice(3);
|
|
2522
|
+
consume("/**", 3);
|
|
2523
|
+
}
|
|
2524
|
+
if (prior.type === "bos" && eos()) {
|
|
2525
|
+
prev.type = "globstar";
|
|
2526
|
+
prev.value += value;
|
|
2527
|
+
prev.output = globstar(opts);
|
|
2528
|
+
state.output = prev.output;
|
|
2529
|
+
state.globstar = true;
|
|
2530
|
+
consume(value);
|
|
2531
|
+
continue;
|
|
2532
|
+
}
|
|
2533
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
2534
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
2535
|
+
prior.output = `(?:${prior.output}`;
|
|
2536
|
+
prev.type = "globstar";
|
|
2537
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
2538
|
+
prev.value += value;
|
|
2539
|
+
state.globstar = true;
|
|
2540
|
+
state.output += prior.output + prev.output;
|
|
2541
|
+
consume(value);
|
|
2542
|
+
continue;
|
|
2543
|
+
}
|
|
2544
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
2545
|
+
const end = rest[1] !== void 0 ? "|$" : "";
|
|
2546
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
2547
|
+
prior.output = `(?:${prior.output}`;
|
|
2548
|
+
prev.type = "globstar";
|
|
2549
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
2550
|
+
prev.value += value;
|
|
2551
|
+
state.output += prior.output + prev.output;
|
|
2552
|
+
state.globstar = true;
|
|
2553
|
+
consume(value + advance());
|
|
2554
|
+
push({
|
|
2555
|
+
type: "slash",
|
|
2556
|
+
value: "/",
|
|
2557
|
+
output: ""
|
|
2558
|
+
});
|
|
2559
|
+
continue;
|
|
2560
|
+
}
|
|
2561
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
2562
|
+
prev.type = "globstar";
|
|
2563
|
+
prev.value += value;
|
|
2564
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
2565
|
+
state.output = prev.output;
|
|
2566
|
+
state.globstar = true;
|
|
2567
|
+
consume(value + advance());
|
|
2568
|
+
push({
|
|
2569
|
+
type: "slash",
|
|
2570
|
+
value: "/",
|
|
2571
|
+
output: ""
|
|
2572
|
+
});
|
|
2573
|
+
continue;
|
|
2574
|
+
}
|
|
2575
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
2576
|
+
prev.type = "globstar";
|
|
2577
|
+
prev.output = globstar(opts);
|
|
2578
|
+
prev.value += value;
|
|
2579
|
+
state.output += prev.output;
|
|
2580
|
+
state.globstar = true;
|
|
2581
|
+
consume(value);
|
|
2582
|
+
continue;
|
|
2583
|
+
}
|
|
2584
|
+
const token = {
|
|
2585
|
+
type: "star",
|
|
2586
|
+
value,
|
|
2587
|
+
output: star
|
|
2588
|
+
};
|
|
2589
|
+
if (opts.bash === true) {
|
|
2590
|
+
token.output = ".*?";
|
|
2591
|
+
if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
|
|
2592
|
+
push(token);
|
|
2593
|
+
continue;
|
|
2594
|
+
}
|
|
2595
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
2596
|
+
token.output = value;
|
|
2597
|
+
push(token);
|
|
2598
|
+
continue;
|
|
2599
|
+
}
|
|
2600
|
+
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
2601
|
+
if (prev.type === "dot") {
|
|
2602
|
+
state.output += NO_DOT_SLASH;
|
|
2603
|
+
prev.output += NO_DOT_SLASH;
|
|
2604
|
+
} else if (opts.dot === true) {
|
|
2605
|
+
state.output += NO_DOTS_SLASH;
|
|
2606
|
+
prev.output += NO_DOTS_SLASH;
|
|
2607
|
+
} else {
|
|
2608
|
+
state.output += nodot;
|
|
2609
|
+
prev.output += nodot;
|
|
2610
|
+
}
|
|
2611
|
+
if (peek() !== "*") {
|
|
2612
|
+
state.output += ONE_CHAR;
|
|
2613
|
+
prev.output += ONE_CHAR;
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
push(token);
|
|
2617
|
+
}
|
|
2618
|
+
while (state.brackets > 0) {
|
|
2619
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
2620
|
+
state.output = utils.escapeLast(state.output, "[");
|
|
2621
|
+
decrement("brackets");
|
|
2622
|
+
}
|
|
2623
|
+
while (state.parens > 0) {
|
|
2624
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
|
|
2625
|
+
state.output = utils.escapeLast(state.output, "(");
|
|
2626
|
+
decrement("parens");
|
|
2627
|
+
}
|
|
2628
|
+
while (state.braces > 0) {
|
|
2629
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
|
|
2630
|
+
state.output = utils.escapeLast(state.output, "{");
|
|
2631
|
+
decrement("braces");
|
|
2632
|
+
}
|
|
2633
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
|
|
2634
|
+
type: "maybe_slash",
|
|
2635
|
+
value: "",
|
|
2636
|
+
output: `${SLASH_LITERAL}?`
|
|
2637
|
+
});
|
|
2638
|
+
if (state.backtrack === true) {
|
|
2639
|
+
state.output = "";
|
|
2640
|
+
for (const token of state.tokens) {
|
|
2641
|
+
state.output += token.output != null ? token.output : token.value;
|
|
2642
|
+
if (token.suffix) state.output += token.suffix;
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
return state;
|
|
2646
|
+
};
|
|
2647
|
+
/**
|
|
2648
|
+
* Fast paths for creating regular expressions for common glob patterns.
|
|
2649
|
+
* This can significantly speed up processing and has very little downside
|
|
2650
|
+
* impact when none of the fast paths match.
|
|
2651
|
+
*/
|
|
2652
|
+
parse.fastpaths = (input, options) => {
|
|
2653
|
+
const opts = { ...options };
|
|
2654
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
2655
|
+
const len = input.length;
|
|
2656
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
2657
|
+
input = REPLACEMENTS[input] || input;
|
|
2658
|
+
const win32 = utils.isWindows(options);
|
|
2659
|
+
const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32);
|
|
2660
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
2661
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
2662
|
+
const capture = opts.capture ? "" : "?:";
|
|
2663
|
+
const state = {
|
|
2664
|
+
negated: false,
|
|
2665
|
+
prefix: ""
|
|
2666
|
+
};
|
|
2667
|
+
let star = opts.bash === true ? ".*?" : STAR;
|
|
2668
|
+
if (opts.capture) star = `(${star})`;
|
|
2669
|
+
const globstar = (opts) => {
|
|
2670
|
+
if (opts.noglobstar === true) return star;
|
|
2671
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
2672
|
+
};
|
|
2673
|
+
const create = (str) => {
|
|
2674
|
+
switch (str) {
|
|
2675
|
+
case "*": return `${nodot}${ONE_CHAR}${star}`;
|
|
2676
|
+
case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2677
|
+
case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2678
|
+
case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
2679
|
+
case "**": return nodot + globstar(opts);
|
|
2680
|
+
case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
2681
|
+
case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2682
|
+
case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2683
|
+
default: {
|
|
2684
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
2685
|
+
if (!match) return;
|
|
2686
|
+
const source = create(match[1]);
|
|
2687
|
+
if (!source) return;
|
|
2688
|
+
return source + DOT_LITERAL + match[2];
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
let source = create(utils.removePrefix(input, state));
|
|
2693
|
+
if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
|
|
2694
|
+
return source;
|
|
2695
|
+
};
|
|
2696
|
+
module.exports = parse;
|
|
2697
|
+
}));
|
|
2698
|
+
|
|
2699
|
+
//#endregion
|
|
2700
|
+
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
|
|
2701
|
+
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2702
|
+
const path = require("node:path");
|
|
2703
|
+
const scan = require_scan();
|
|
2704
|
+
const parse = require_parse();
|
|
2705
|
+
const utils = require_utils();
|
|
2706
|
+
const constants = require_constants();
|
|
2707
|
+
const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
2708
|
+
/**
|
|
2709
|
+
* Creates a matcher function from one or more glob patterns. The
|
|
2710
|
+
* returned function takes a string to match as its first argument,
|
|
2711
|
+
* and returns true if the string is a match. The returned matcher
|
|
2712
|
+
* function also takes a boolean as the second argument that, when true,
|
|
2713
|
+
* returns an object with additional information.
|
|
2714
|
+
*
|
|
2715
|
+
* ```js
|
|
2716
|
+
* const picomatch = require('picomatch');
|
|
2717
|
+
* // picomatch(glob[, options]);
|
|
2718
|
+
*
|
|
2719
|
+
* const isMatch = picomatch('*.!(*a)');
|
|
2720
|
+
* console.log(isMatch('a.a')); //=> false
|
|
2721
|
+
* console.log(isMatch('a.b')); //=> true
|
|
2722
|
+
* ```
|
|
2723
|
+
* @name picomatch
|
|
2724
|
+
* @param {String|Array} `globs` One or more glob patterns.
|
|
2725
|
+
* @param {Object=} `options`
|
|
2726
|
+
* @return {Function=} Returns a matcher function.
|
|
2727
|
+
* @api public
|
|
2728
|
+
*/
|
|
2729
|
+
const picomatch = (glob, options, returnState = false) => {
|
|
2730
|
+
if (Array.isArray(glob)) {
|
|
2731
|
+
const fns = glob.map((input) => picomatch(input, options, returnState));
|
|
2732
|
+
const arrayMatcher = (str) => {
|
|
2733
|
+
for (const isMatch of fns) {
|
|
2734
|
+
const state = isMatch(str);
|
|
2735
|
+
if (state) return state;
|
|
2736
|
+
}
|
|
2737
|
+
return false;
|
|
2738
|
+
};
|
|
2739
|
+
return arrayMatcher;
|
|
2740
|
+
}
|
|
2741
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
2742
|
+
if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
|
|
2743
|
+
const opts = options || {};
|
|
2744
|
+
const posix = utils.isWindows(options);
|
|
2745
|
+
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
2746
|
+
const state = regex.state;
|
|
2747
|
+
delete regex.state;
|
|
2748
|
+
let isIgnored = () => false;
|
|
2749
|
+
if (opts.ignore) {
|
|
2750
|
+
const ignoreOpts = {
|
|
2751
|
+
...options,
|
|
2752
|
+
ignore: null,
|
|
2753
|
+
onMatch: null,
|
|
2754
|
+
onResult: null
|
|
2755
|
+
};
|
|
2756
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
2757
|
+
}
|
|
2758
|
+
const matcher = (input, returnObject = false) => {
|
|
2759
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, {
|
|
2760
|
+
glob,
|
|
2761
|
+
posix
|
|
2762
|
+
});
|
|
2763
|
+
const result = {
|
|
2764
|
+
glob,
|
|
2765
|
+
state,
|
|
2766
|
+
regex,
|
|
2767
|
+
posix,
|
|
2768
|
+
input,
|
|
2769
|
+
output,
|
|
2770
|
+
match,
|
|
2771
|
+
isMatch
|
|
2772
|
+
};
|
|
2773
|
+
if (typeof opts.onResult === "function") opts.onResult(result);
|
|
2774
|
+
if (isMatch === false) {
|
|
2775
|
+
result.isMatch = false;
|
|
2776
|
+
return returnObject ? result : false;
|
|
2777
|
+
}
|
|
2778
|
+
if (isIgnored(input)) {
|
|
2779
|
+
if (typeof opts.onIgnore === "function") opts.onIgnore(result);
|
|
2780
|
+
result.isMatch = false;
|
|
2781
|
+
return returnObject ? result : false;
|
|
2782
|
+
}
|
|
2783
|
+
if (typeof opts.onMatch === "function") opts.onMatch(result);
|
|
2784
|
+
return returnObject ? result : true;
|
|
2785
|
+
};
|
|
2786
|
+
if (returnState) matcher.state = state;
|
|
2787
|
+
return matcher;
|
|
2788
|
+
};
|
|
2789
|
+
/**
|
|
2790
|
+
* Test `input` with the given `regex`. This is used by the main
|
|
2791
|
+
* `picomatch()` function to test the input string.
|
|
2792
|
+
*
|
|
2793
|
+
* ```js
|
|
2794
|
+
* const picomatch = require('picomatch');
|
|
2795
|
+
* // picomatch.test(input, regex[, options]);
|
|
2796
|
+
*
|
|
2797
|
+
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
|
|
2798
|
+
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
|
|
2799
|
+
* ```
|
|
2800
|
+
* @param {String} `input` String to test.
|
|
2801
|
+
* @param {RegExp} `regex`
|
|
2802
|
+
* @return {Object} Returns an object with matching info.
|
|
2803
|
+
* @api public
|
|
2804
|
+
*/
|
|
2805
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
2806
|
+
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
|
|
2807
|
+
if (input === "") return {
|
|
2808
|
+
isMatch: false,
|
|
2809
|
+
output: ""
|
|
2810
|
+
};
|
|
2811
|
+
const opts = options || {};
|
|
2812
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
2813
|
+
let match = input === glob;
|
|
2814
|
+
let output = match && format ? format(input) : input;
|
|
2815
|
+
if (match === false) {
|
|
2816
|
+
output = format ? format(input) : input;
|
|
2817
|
+
match = output === glob;
|
|
2818
|
+
}
|
|
2819
|
+
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
|
|
2820
|
+
else match = regex.exec(output);
|
|
2821
|
+
return {
|
|
2822
|
+
isMatch: Boolean(match),
|
|
2823
|
+
match,
|
|
2824
|
+
output
|
|
2825
|
+
};
|
|
2826
|
+
};
|
|
2827
|
+
/**
|
|
2828
|
+
* Match the basename of a filepath.
|
|
2829
|
+
*
|
|
2830
|
+
* ```js
|
|
2831
|
+
* const picomatch = require('picomatch');
|
|
2832
|
+
* // picomatch.matchBase(input, glob[, options]);
|
|
2833
|
+
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
|
|
2834
|
+
* ```
|
|
2835
|
+
* @param {String} `input` String to test.
|
|
2836
|
+
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
2837
|
+
* @return {Boolean}
|
|
2838
|
+
* @api public
|
|
2839
|
+
*/
|
|
2840
|
+
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
2841
|
+
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path.basename(input));
|
|
2842
|
+
};
|
|
2843
|
+
/**
|
|
2844
|
+
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
2845
|
+
*
|
|
2846
|
+
* ```js
|
|
2847
|
+
* const picomatch = require('picomatch');
|
|
2848
|
+
* // picomatch.isMatch(string, patterns[, options]);
|
|
2849
|
+
*
|
|
2850
|
+
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
2851
|
+
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
|
|
2852
|
+
* ```
|
|
2853
|
+
* @param {String|Array} str The string to test.
|
|
2854
|
+
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
|
2855
|
+
* @param {Object} [options] See available [options](#options).
|
|
2856
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
2857
|
+
* @api public
|
|
2858
|
+
*/
|
|
2859
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
2860
|
+
/**
|
|
2861
|
+
* Parse a glob pattern to create the source string for a regular
|
|
2862
|
+
* expression.
|
|
2863
|
+
*
|
|
2864
|
+
* ```js
|
|
2865
|
+
* const picomatch = require('picomatch');
|
|
2866
|
+
* const result = picomatch.parse(pattern[, options]);
|
|
2867
|
+
* ```
|
|
2868
|
+
* @param {String} `pattern`
|
|
2869
|
+
* @param {Object} `options`
|
|
2870
|
+
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
|
|
2871
|
+
* @api public
|
|
2872
|
+
*/
|
|
2873
|
+
picomatch.parse = (pattern, options) => {
|
|
2874
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
2875
|
+
return parse(pattern, {
|
|
2876
|
+
...options,
|
|
2877
|
+
fastpaths: false
|
|
2878
|
+
});
|
|
2879
|
+
};
|
|
2880
|
+
/**
|
|
2881
|
+
* Scan a glob pattern to separate the pattern into segments.
|
|
2882
|
+
*
|
|
2883
|
+
* ```js
|
|
2884
|
+
* const picomatch = require('picomatch');
|
|
2885
|
+
* // picomatch.scan(input[, options]);
|
|
2886
|
+
*
|
|
2887
|
+
* const result = picomatch.scan('!./foo/*.js');
|
|
2888
|
+
* console.log(result);
|
|
2889
|
+
* { prefix: '!./',
|
|
2890
|
+
* input: '!./foo/*.js',
|
|
2891
|
+
* start: 3,
|
|
2892
|
+
* base: 'foo',
|
|
2893
|
+
* glob: '*.js',
|
|
2894
|
+
* isBrace: false,
|
|
2895
|
+
* isBracket: false,
|
|
2896
|
+
* isGlob: true,
|
|
2897
|
+
* isExtglob: false,
|
|
2898
|
+
* isGlobstar: false,
|
|
2899
|
+
* negated: true }
|
|
2900
|
+
* ```
|
|
2901
|
+
* @param {String} `input` Glob pattern to scan.
|
|
2902
|
+
* @param {Object} `options`
|
|
2903
|
+
* @return {Object} Returns an object with
|
|
2904
|
+
* @api public
|
|
2905
|
+
*/
|
|
2906
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
2907
|
+
/**
|
|
2908
|
+
* Compile a regular expression from the `state` object returned by the
|
|
2909
|
+
* [parse()](#parse) method.
|
|
2910
|
+
*
|
|
2911
|
+
* @param {Object} `state`
|
|
2912
|
+
* @param {Object} `options`
|
|
2913
|
+
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
2914
|
+
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
|
|
2915
|
+
* @return {RegExp}
|
|
2916
|
+
* @api public
|
|
2917
|
+
*/
|
|
2918
|
+
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
2919
|
+
if (returnOutput === true) return state.output;
|
|
2920
|
+
const opts = options || {};
|
|
2921
|
+
const prepend = opts.contains ? "" : "^";
|
|
2922
|
+
const append = opts.contains ? "" : "$";
|
|
2923
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
2924
|
+
if (state && state.negated === true) source = `^(?!${source}).*$`;
|
|
2925
|
+
const regex = picomatch.toRegex(source, options);
|
|
2926
|
+
if (returnState === true) regex.state = state;
|
|
2927
|
+
return regex;
|
|
2928
|
+
};
|
|
2929
|
+
/**
|
|
2930
|
+
* Create a regular expression from a parsed glob pattern.
|
|
2931
|
+
*
|
|
2932
|
+
* ```js
|
|
2933
|
+
* const picomatch = require('picomatch');
|
|
2934
|
+
* const state = picomatch.parse('*.js');
|
|
2935
|
+
* // picomatch.compileRe(state[, options]);
|
|
2936
|
+
*
|
|
2937
|
+
* console.log(picomatch.compileRe(state));
|
|
2938
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
2939
|
+
* ```
|
|
2940
|
+
* @param {String} `state` The object returned from the `.parse` method.
|
|
2941
|
+
* @param {Object} `options`
|
|
2942
|
+
* @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
|
|
2943
|
+
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
|
|
2944
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
2945
|
+
* @api public
|
|
2946
|
+
*/
|
|
2947
|
+
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
2948
|
+
if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
|
|
2949
|
+
let parsed = {
|
|
2950
|
+
negated: false,
|
|
2951
|
+
fastpaths: true
|
|
2952
|
+
};
|
|
2953
|
+
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
|
|
2954
|
+
if (!parsed.output) parsed = parse(input, options);
|
|
2955
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
2956
|
+
};
|
|
2957
|
+
/**
|
|
2958
|
+
* Create a regular expression from the given regex source string.
|
|
2959
|
+
*
|
|
2960
|
+
* ```js
|
|
2961
|
+
* const picomatch = require('picomatch');
|
|
2962
|
+
* // picomatch.toRegex(source[, options]);
|
|
2963
|
+
*
|
|
2964
|
+
* const { output } = picomatch.parse('*.js');
|
|
2965
|
+
* console.log(picomatch.toRegex(output));
|
|
2966
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
2967
|
+
* ```
|
|
2968
|
+
* @param {String} `source` Regular expression source string.
|
|
2969
|
+
* @param {Object} `options`
|
|
2970
|
+
* @return {RegExp}
|
|
2971
|
+
* @api public
|
|
2972
|
+
*/
|
|
2973
|
+
picomatch.toRegex = (source, options) => {
|
|
2974
|
+
try {
|
|
2975
|
+
const opts = options || {};
|
|
2976
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
2977
|
+
} catch (err) {
|
|
2978
|
+
if (options && options.debug === true) throw err;
|
|
2979
|
+
return /$^/;
|
|
2980
|
+
}
|
|
2981
|
+
};
|
|
2982
|
+
/**
|
|
2983
|
+
* Picomatch constants.
|
|
2984
|
+
* @return {Object}
|
|
2985
|
+
*/
|
|
2986
|
+
picomatch.constants = constants;
|
|
2987
|
+
/**
|
|
2988
|
+
* Expose "picomatch"
|
|
2989
|
+
*/
|
|
2990
|
+
module.exports = picomatch;
|
|
2991
|
+
}));
|
|
2992
|
+
|
|
2993
|
+
//#endregion
|
|
2994
|
+
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js
|
|
2995
|
+
var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2996
|
+
module.exports = require_picomatch$1();
|
|
2997
|
+
}));
|
|
2998
|
+
|
|
2999
|
+
//#endregion
|
|
3000
|
+
//#region ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
|
|
3001
|
+
var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3002
|
+
const util = require("node:util");
|
|
3003
|
+
const braces = require_braces();
|
|
3004
|
+
const picomatch = require_picomatch();
|
|
3005
|
+
const utils = require_utils();
|
|
3006
|
+
const isEmptyString = (v) => v === "" || v === "./";
|
|
3007
|
+
const hasBraces = (v) => {
|
|
3008
|
+
const index = v.indexOf("{");
|
|
3009
|
+
return index > -1 && v.indexOf("}", index) > -1;
|
|
3010
|
+
};
|
|
3011
|
+
/**
|
|
3012
|
+
* Returns an array of strings that match one or more glob patterns.
|
|
3013
|
+
*
|
|
3014
|
+
* ```js
|
|
3015
|
+
* const mm = require('micromatch');
|
|
3016
|
+
* // mm(list, patterns[, options]);
|
|
3017
|
+
*
|
|
3018
|
+
* console.log(mm(['a.js', 'a.txt'], ['*.js']));
|
|
3019
|
+
* //=> [ 'a.js' ]
|
|
3020
|
+
* ```
|
|
3021
|
+
* @param {String|Array<string>} `list` List of strings to match.
|
|
3022
|
+
* @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
|
|
3023
|
+
* @param {Object} `options` See available [options](#options)
|
|
3024
|
+
* @return {Array} Returns an array of matches
|
|
3025
|
+
* @summary false
|
|
3026
|
+
* @api public
|
|
3027
|
+
*/
|
|
3028
|
+
const micromatch = (list, patterns, options) => {
|
|
3029
|
+
patterns = [].concat(patterns);
|
|
3030
|
+
list = [].concat(list);
|
|
3031
|
+
let omit = /* @__PURE__ */ new Set();
|
|
3032
|
+
let keep = /* @__PURE__ */ new Set();
|
|
3033
|
+
let items = /* @__PURE__ */ new Set();
|
|
3034
|
+
let negatives = 0;
|
|
3035
|
+
let onResult = (state) => {
|
|
3036
|
+
items.add(state.output);
|
|
3037
|
+
if (options && options.onResult) options.onResult(state);
|
|
3038
|
+
};
|
|
3039
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
3040
|
+
let isMatch = picomatch(String(patterns[i]), {
|
|
3041
|
+
...options,
|
|
3042
|
+
onResult
|
|
3043
|
+
}, true);
|
|
3044
|
+
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
3045
|
+
if (negated) negatives++;
|
|
3046
|
+
for (let item of list) {
|
|
3047
|
+
let matched = isMatch(item, true);
|
|
3048
|
+
if (!(negated ? !matched.isMatch : matched.isMatch)) continue;
|
|
3049
|
+
if (negated) omit.add(matched.output);
|
|
3050
|
+
else {
|
|
3051
|
+
omit.delete(matched.output);
|
|
3052
|
+
keep.add(matched.output);
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
|
|
3057
|
+
if (options && matches.length === 0) {
|
|
3058
|
+
if (options.failglob === true) throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
3059
|
+
if (options.nonull === true || options.nullglob === true) return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
3060
|
+
}
|
|
3061
|
+
return matches;
|
|
3062
|
+
};
|
|
3063
|
+
/**
|
|
3064
|
+
* Backwards compatibility
|
|
3065
|
+
*/
|
|
3066
|
+
micromatch.match = micromatch;
|
|
3067
|
+
/**
|
|
3068
|
+
* Returns a matcher function from the given glob `pattern` and `options`.
|
|
3069
|
+
* The returned function takes a string to match as its only argument and returns
|
|
3070
|
+
* true if the string is a match.
|
|
3071
|
+
*
|
|
3072
|
+
* ```js
|
|
3073
|
+
* const mm = require('micromatch');
|
|
3074
|
+
* // mm.matcher(pattern[, options]);
|
|
3075
|
+
*
|
|
3076
|
+
* const isMatch = mm.matcher('*.!(*a)');
|
|
3077
|
+
* console.log(isMatch('a.a')); //=> false
|
|
3078
|
+
* console.log(isMatch('a.b')); //=> true
|
|
3079
|
+
* ```
|
|
3080
|
+
* @param {String} `pattern` Glob pattern
|
|
3081
|
+
* @param {Object} `options`
|
|
3082
|
+
* @return {Function} Returns a matcher function.
|
|
3083
|
+
* @api public
|
|
3084
|
+
*/
|
|
3085
|
+
micromatch.matcher = (pattern, options) => picomatch(pattern, options);
|
|
3086
|
+
/**
|
|
3087
|
+
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
3088
|
+
*
|
|
3089
|
+
* ```js
|
|
3090
|
+
* const mm = require('micromatch');
|
|
3091
|
+
* // mm.isMatch(string, patterns[, options]);
|
|
3092
|
+
*
|
|
3093
|
+
* console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
3094
|
+
* console.log(mm.isMatch('a.a', 'b.*')); //=> false
|
|
3095
|
+
* ```
|
|
3096
|
+
* @param {String} `str` The string to test.
|
|
3097
|
+
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
|
3098
|
+
* @param {Object} `[options]` See available [options](#options).
|
|
3099
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
3100
|
+
* @api public
|
|
3101
|
+
*/
|
|
3102
|
+
micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
3103
|
+
/**
|
|
3104
|
+
* Backwards compatibility
|
|
3105
|
+
*/
|
|
3106
|
+
micromatch.any = micromatch.isMatch;
|
|
3107
|
+
/**
|
|
3108
|
+
* Returns a list of strings that _**do not match any**_ of the given `patterns`.
|
|
3109
|
+
*
|
|
3110
|
+
* ```js
|
|
3111
|
+
* const mm = require('micromatch');
|
|
3112
|
+
* // mm.not(list, patterns[, options]);
|
|
3113
|
+
*
|
|
3114
|
+
* console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
|
|
3115
|
+
* //=> ['b.b', 'c.c']
|
|
3116
|
+
* ```
|
|
3117
|
+
* @param {Array} `list` Array of strings to match.
|
|
3118
|
+
* @param {String|Array} `patterns` One or more glob pattern to use for matching.
|
|
3119
|
+
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
|
3120
|
+
* @return {Array} Returns an array of strings that **do not match** the given patterns.
|
|
3121
|
+
* @api public
|
|
3122
|
+
*/
|
|
3123
|
+
micromatch.not = (list, patterns, options = {}) => {
|
|
3124
|
+
patterns = [].concat(patterns).map(String);
|
|
3125
|
+
let result = /* @__PURE__ */ new Set();
|
|
3126
|
+
let items = [];
|
|
3127
|
+
let onResult = (state) => {
|
|
3128
|
+
if (options.onResult) options.onResult(state);
|
|
3129
|
+
items.push(state.output);
|
|
3130
|
+
};
|
|
3131
|
+
let matches = new Set(micromatch(list, patterns, {
|
|
3132
|
+
...options,
|
|
3133
|
+
onResult
|
|
3134
|
+
}));
|
|
3135
|
+
for (let item of items) if (!matches.has(item)) result.add(item);
|
|
3136
|
+
return [...result];
|
|
3137
|
+
};
|
|
3138
|
+
/**
|
|
3139
|
+
* Returns true if the given `string` contains the given pattern. Similar
|
|
3140
|
+
* to [.isMatch](#isMatch) but the pattern can match any part of the string.
|
|
3141
|
+
*
|
|
3142
|
+
* ```js
|
|
3143
|
+
* var mm = require('micromatch');
|
|
3144
|
+
* // mm.contains(string, pattern[, options]);
|
|
3145
|
+
*
|
|
3146
|
+
* console.log(mm.contains('aa/bb/cc', '*b'));
|
|
3147
|
+
* //=> true
|
|
3148
|
+
* console.log(mm.contains('aa/bb/cc', '*d'));
|
|
3149
|
+
* //=> false
|
|
3150
|
+
* ```
|
|
3151
|
+
* @param {String} `str` The string to match.
|
|
3152
|
+
* @param {String|Array} `patterns` Glob pattern to use for matching.
|
|
3153
|
+
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
|
3154
|
+
* @return {Boolean} Returns true if any of the patterns matches any part of `str`.
|
|
3155
|
+
* @api public
|
|
3156
|
+
*/
|
|
3157
|
+
micromatch.contains = (str, pattern, options) => {
|
|
3158
|
+
if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
3159
|
+
if (Array.isArray(pattern)) return pattern.some((p) => micromatch.contains(str, p, options));
|
|
3160
|
+
if (typeof pattern === "string") {
|
|
3161
|
+
if (isEmptyString(str) || isEmptyString(pattern)) return false;
|
|
3162
|
+
if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) return true;
|
|
3163
|
+
}
|
|
3164
|
+
return micromatch.isMatch(str, pattern, {
|
|
3165
|
+
...options,
|
|
3166
|
+
contains: true
|
|
3167
|
+
});
|
|
3168
|
+
};
|
|
3169
|
+
/**
|
|
3170
|
+
* Filter the keys of the given object with the given `glob` pattern
|
|
3171
|
+
* and `options`. Does not attempt to match nested keys. If you need this feature,
|
|
3172
|
+
* use [glob-object][] instead.
|
|
3173
|
+
*
|
|
3174
|
+
* ```js
|
|
3175
|
+
* const mm = require('micromatch');
|
|
3176
|
+
* // mm.matchKeys(object, patterns[, options]);
|
|
3177
|
+
*
|
|
3178
|
+
* const obj = { aa: 'a', ab: 'b', ac: 'c' };
|
|
3179
|
+
* console.log(mm.matchKeys(obj, '*b'));
|
|
3180
|
+
* //=> { ab: 'b' }
|
|
3181
|
+
* ```
|
|
3182
|
+
* @param {Object} `object` The object with keys to filter.
|
|
3183
|
+
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
|
3184
|
+
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
|
3185
|
+
* @return {Object} Returns an object with only keys that match the given patterns.
|
|
3186
|
+
* @api public
|
|
3187
|
+
*/
|
|
3188
|
+
micromatch.matchKeys = (obj, patterns, options) => {
|
|
3189
|
+
if (!utils.isObject(obj)) throw new TypeError("Expected the first argument to be an object");
|
|
3190
|
+
let keys = micromatch(Object.keys(obj), patterns, options);
|
|
3191
|
+
let res = {};
|
|
3192
|
+
for (let key of keys) res[key] = obj[key];
|
|
3193
|
+
return res;
|
|
3194
|
+
};
|
|
3195
|
+
/**
|
|
3196
|
+
* Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
|
|
3197
|
+
*
|
|
3198
|
+
* ```js
|
|
3199
|
+
* const mm = require('micromatch');
|
|
3200
|
+
* // mm.some(list, patterns[, options]);
|
|
3201
|
+
*
|
|
3202
|
+
* console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
|
|
3203
|
+
* // true
|
|
3204
|
+
* console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
|
|
3205
|
+
* // false
|
|
3206
|
+
* ```
|
|
3207
|
+
* @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
|
|
3208
|
+
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
|
3209
|
+
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
|
3210
|
+
* @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
|
|
3211
|
+
* @api public
|
|
3212
|
+
*/
|
|
3213
|
+
micromatch.some = (list, patterns, options) => {
|
|
3214
|
+
let items = [].concat(list);
|
|
3215
|
+
for (let pattern of [].concat(patterns)) {
|
|
3216
|
+
let isMatch = picomatch(String(pattern), options);
|
|
3217
|
+
if (items.some((item) => isMatch(item))) return true;
|
|
3218
|
+
}
|
|
3219
|
+
return false;
|
|
3220
|
+
};
|
|
3221
|
+
/**
|
|
3222
|
+
* Returns true if every string in the given `list` matches
|
|
3223
|
+
* any of the given glob `patterns`.
|
|
3224
|
+
*
|
|
3225
|
+
* ```js
|
|
3226
|
+
* const mm = require('micromatch');
|
|
3227
|
+
* // mm.every(list, patterns[, options]);
|
|
3228
|
+
*
|
|
3229
|
+
* console.log(mm.every('foo.js', ['foo.js']));
|
|
3230
|
+
* // true
|
|
3231
|
+
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
|
|
3232
|
+
* // true
|
|
3233
|
+
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
|
|
3234
|
+
* // false
|
|
3235
|
+
* console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
|
|
3236
|
+
* // false
|
|
3237
|
+
* ```
|
|
3238
|
+
* @param {String|Array} `list` The string or array of strings to test.
|
|
3239
|
+
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
|
3240
|
+
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
|
3241
|
+
* @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
|
|
3242
|
+
* @api public
|
|
3243
|
+
*/
|
|
3244
|
+
micromatch.every = (list, patterns, options) => {
|
|
3245
|
+
let items = [].concat(list);
|
|
3246
|
+
for (let pattern of [].concat(patterns)) {
|
|
3247
|
+
let isMatch = picomatch(String(pattern), options);
|
|
3248
|
+
if (!items.every((item) => isMatch(item))) return false;
|
|
3249
|
+
}
|
|
3250
|
+
return true;
|
|
3251
|
+
};
|
|
3252
|
+
/**
|
|
3253
|
+
* Returns true if **all** of the given `patterns` match
|
|
3254
|
+
* the specified string.
|
|
3255
|
+
*
|
|
3256
|
+
* ```js
|
|
3257
|
+
* const mm = require('micromatch');
|
|
3258
|
+
* // mm.all(string, patterns[, options]);
|
|
3259
|
+
*
|
|
3260
|
+
* console.log(mm.all('foo.js', ['foo.js']));
|
|
3261
|
+
* // true
|
|
3262
|
+
*
|
|
3263
|
+
* console.log(mm.all('foo.js', ['*.js', '!foo.js']));
|
|
3264
|
+
* // false
|
|
3265
|
+
*
|
|
3266
|
+
* console.log(mm.all('foo.js', ['*.js', 'foo.js']));
|
|
3267
|
+
* // true
|
|
3268
|
+
*
|
|
3269
|
+
* console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
|
|
3270
|
+
* // true
|
|
3271
|
+
* ```
|
|
3272
|
+
* @param {String|Array} `str` The string to test.
|
|
3273
|
+
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
|
3274
|
+
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
|
3275
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
3276
|
+
* @api public
|
|
3277
|
+
*/
|
|
3278
|
+
micromatch.all = (str, patterns, options) => {
|
|
3279
|
+
if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
3280
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
3281
|
+
};
|
|
3282
|
+
/**
|
|
3283
|
+
* Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
|
|
3284
|
+
*
|
|
3285
|
+
* ```js
|
|
3286
|
+
* const mm = require('micromatch');
|
|
3287
|
+
* // mm.capture(pattern, string[, options]);
|
|
3288
|
+
*
|
|
3289
|
+
* console.log(mm.capture('test/*.js', 'test/foo.js'));
|
|
3290
|
+
* //=> ['foo']
|
|
3291
|
+
* console.log(mm.capture('test/*.js', 'foo/bar.css'));
|
|
3292
|
+
* //=> null
|
|
3293
|
+
* ```
|
|
3294
|
+
* @param {String} `glob` Glob pattern to use for matching.
|
|
3295
|
+
* @param {String} `input` String to match
|
|
3296
|
+
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
|
3297
|
+
* @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
|
|
3298
|
+
* @api public
|
|
3299
|
+
*/
|
|
3300
|
+
micromatch.capture = (glob, input, options) => {
|
|
3301
|
+
let posix = utils.isWindows(options);
|
|
3302
|
+
let match = picomatch.makeRe(String(glob), {
|
|
3303
|
+
...options,
|
|
3304
|
+
capture: true
|
|
3305
|
+
}).exec(posix ? utils.toPosixSlashes(input) : input);
|
|
3306
|
+
if (match) return match.slice(1).map((v) => v === void 0 ? "" : v);
|
|
3307
|
+
};
|
|
3308
|
+
/**
|
|
3309
|
+
* Create a regular expression from the given glob `pattern`.
|
|
3310
|
+
*
|
|
3311
|
+
* ```js
|
|
3312
|
+
* const mm = require('micromatch');
|
|
3313
|
+
* // mm.makeRe(pattern[, options]);
|
|
3314
|
+
*
|
|
3315
|
+
* console.log(mm.makeRe('*.js'));
|
|
3316
|
+
* //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
|
|
3317
|
+
* ```
|
|
3318
|
+
* @param {String} `pattern` A glob pattern to convert to regex.
|
|
3319
|
+
* @param {Object} `options`
|
|
3320
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
3321
|
+
* @api public
|
|
3322
|
+
*/
|
|
3323
|
+
micromatch.makeRe = (...args) => picomatch.makeRe(...args);
|
|
3324
|
+
/**
|
|
3325
|
+
* Scan a glob pattern to separate the pattern into segments. Used
|
|
3326
|
+
* by the [split](#split) method.
|
|
3327
|
+
*
|
|
3328
|
+
* ```js
|
|
3329
|
+
* const mm = require('micromatch');
|
|
3330
|
+
* const state = mm.scan(pattern[, options]);
|
|
3331
|
+
* ```
|
|
3332
|
+
* @param {String} `pattern`
|
|
3333
|
+
* @param {Object} `options`
|
|
3334
|
+
* @return {Object} Returns an object with
|
|
3335
|
+
* @api public
|
|
3336
|
+
*/
|
|
3337
|
+
micromatch.scan = (...args) => picomatch.scan(...args);
|
|
3338
|
+
/**
|
|
3339
|
+
* Parse a glob pattern to create the source string for a regular
|
|
3340
|
+
* expression.
|
|
3341
|
+
*
|
|
3342
|
+
* ```js
|
|
3343
|
+
* const mm = require('micromatch');
|
|
3344
|
+
* const state = mm.parse(pattern[, options]);
|
|
3345
|
+
* ```
|
|
3346
|
+
* @param {String} `glob`
|
|
3347
|
+
* @param {Object} `options`
|
|
3348
|
+
* @return {Object} Returns an object with useful properties and output to be used as regex source string.
|
|
3349
|
+
* @api public
|
|
3350
|
+
*/
|
|
3351
|
+
micromatch.parse = (patterns, options) => {
|
|
3352
|
+
let res = [];
|
|
3353
|
+
for (let pattern of [].concat(patterns || [])) for (let str of braces(String(pattern), options)) res.push(picomatch.parse(str, options));
|
|
3354
|
+
return res;
|
|
3355
|
+
};
|
|
3356
|
+
/**
|
|
3357
|
+
* Process the given brace `pattern`.
|
|
3358
|
+
*
|
|
3359
|
+
* ```js
|
|
3360
|
+
* const { braces } = require('micromatch');
|
|
3361
|
+
* console.log(braces('foo/{a,b,c}/bar'));
|
|
3362
|
+
* //=> [ 'foo/(a|b|c)/bar' ]
|
|
3363
|
+
*
|
|
3364
|
+
* console.log(braces('foo/{a,b,c}/bar', { expand: true }));
|
|
3365
|
+
* //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
|
|
3366
|
+
* ```
|
|
3367
|
+
* @param {String} `pattern` String with brace pattern to process.
|
|
3368
|
+
* @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
|
|
3369
|
+
* @return {Array}
|
|
3370
|
+
* @api public
|
|
3371
|
+
*/
|
|
3372
|
+
micromatch.braces = (pattern, options) => {
|
|
3373
|
+
if (typeof pattern !== "string") throw new TypeError("Expected a string");
|
|
3374
|
+
if (options && options.nobrace === true || !hasBraces(pattern)) return [pattern];
|
|
3375
|
+
return braces(pattern, options);
|
|
3376
|
+
};
|
|
3377
|
+
/**
|
|
3378
|
+
* Expand braces
|
|
3379
|
+
*/
|
|
3380
|
+
micromatch.braceExpand = (pattern, options) => {
|
|
3381
|
+
if (typeof pattern !== "string") throw new TypeError("Expected a string");
|
|
3382
|
+
return micromatch.braces(pattern, {
|
|
3383
|
+
...options,
|
|
3384
|
+
expand: true
|
|
3385
|
+
});
|
|
3386
|
+
};
|
|
3387
|
+
/**
|
|
3388
|
+
* Expose micromatch
|
|
3389
|
+
*/
|
|
3390
|
+
micromatch.hasBraces = hasBraces;
|
|
3391
|
+
module.exports = micromatch;
|
|
3392
|
+
}));
|
|
3393
|
+
|
|
3394
|
+
//#endregion
|
|
3395
|
+
//#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/resolver.js
|
|
3396
|
+
var import_micromatch = /* @__PURE__ */ __toESM(require_micromatch(), 1);
|
|
3397
|
+
const { createSourceFile, resolveModuleName, isStringLiteral, JSDocParsingMode, ScriptTarget } = typescript.default;
|
|
3398
|
+
function patternMatch(path, patterns, base) {
|
|
3399
|
+
const include = patterns.filter((pattern) => pattern[0] !== "!");
|
|
3400
|
+
const exclude = patterns.filter((pattern) => pattern[0] === "!").map((pattern) => pattern.substring(1));
|
|
3401
|
+
return import_micromatch.default.isMatch(path, include, { ignore: exclude });
|
|
3402
|
+
}
|
|
3403
|
+
/**
|
|
3404
|
+
* A utility to resolve a module path and its declaration.
|
|
3405
|
+
*
|
|
3406
|
+
* It automatically reads a SourceFile, binds and caches it.
|
|
3407
|
+
*/
|
|
3408
|
+
var Resolver = class {
|
|
3409
|
+
constructor(compilerOptions, host, sourceFiles) {
|
|
3410
|
+
this.compilerOptions = compilerOptions;
|
|
3411
|
+
this.host = host;
|
|
3412
|
+
this.sourceFiles = sourceFiles;
|
|
3413
|
+
}
|
|
3414
|
+
resolve(from, importOrExportNode) {
|
|
3415
|
+
const moduleSpecifier = importOrExportNode.moduleSpecifier;
|
|
3416
|
+
if (!moduleSpecifier) return;
|
|
3417
|
+
if (!isStringLiteral(moduleSpecifier)) return;
|
|
3418
|
+
return this.resolveSourceFile(from, moduleSpecifier);
|
|
3419
|
+
}
|
|
3420
|
+
resolveImpl(modulePath, sourceFile) {
|
|
3421
|
+
if (this.host.resolveModuleNameLiterals !== void 0) {
|
|
3422
|
+
const results = this.host.resolveModuleNameLiterals([modulePath], sourceFile.fileName, void 0, this.compilerOptions, sourceFile, void 0);
|
|
3423
|
+
if (results[0]) return results[0].resolvedModule;
|
|
3424
|
+
return;
|
|
3425
|
+
}
|
|
3426
|
+
if (this.host.resolveModuleNames !== void 0) return this.host.resolveModuleNames([modulePath.text], sourceFile.fileName, void 0, void 0, this.compilerOptions)[0];
|
|
3427
|
+
return resolveModuleName(modulePath.text, sourceFile.fileName, this.compilerOptions, this.host).resolvedModule;
|
|
3428
|
+
}
|
|
3429
|
+
/**
|
|
3430
|
+
* Tries to resolve the .ts/d.ts file path for a given module path.
|
|
3431
|
+
* Scans relative paths. Looks into package.json "types" and "exports" (with new 4.7 support)
|
|
3432
|
+
*
|
|
3433
|
+
* @param sourceFile the SourceFile of the file that contains the import. modulePath is relative to that.
|
|
3434
|
+
* @param modulePath the x in 'from x'.
|
|
3435
|
+
*/
|
|
3436
|
+
resolveSourceFile(sourceFile, modulePath) {
|
|
3437
|
+
const result = this.resolveImpl(modulePath, sourceFile);
|
|
3438
|
+
if (!result) return;
|
|
3439
|
+
if (!result.resolvedFileName.endsWith(".ts") && !result.resolvedFileName.endsWith(".tsx") && !result.resolvedFileName.endsWith(".d.ts")) return;
|
|
3440
|
+
const fileName = result.resolvedFileName;
|
|
3441
|
+
if (this.sourceFiles[fileName]) return this.sourceFiles[fileName];
|
|
3442
|
+
const source = this.host.readFile(result.resolvedFileName);
|
|
3443
|
+
if (!source) return;
|
|
3444
|
+
const moduleSourceFile = this.sourceFiles[fileName] = createSourceFile(fileName, source, {
|
|
3445
|
+
languageVersion: this.compilerOptions.target || ScriptTarget.ES2018,
|
|
3446
|
+
jsDocParsingMode: JSDocParsingMode ? JSDocParsingMode.ParseNone : void 0
|
|
3447
|
+
}, true);
|
|
3448
|
+
this.sourceFiles[fileName] = moduleSourceFile;
|
|
3449
|
+
typescript.default.bindSourceFile(moduleSourceFile, this.compilerOptions);
|
|
3450
|
+
return moduleSourceFile;
|
|
3451
|
+
}
|
|
3452
|
+
};
|
|
3453
|
+
|
|
3454
|
+
//#endregion
|
|
3455
|
+
//#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/config.js
|
|
3456
|
+
/**
|
|
3457
|
+
* Default means reflection is enabled for this file.
|
|
3458
|
+
* Never means the whole reflection is disabled for this file.
|
|
3459
|
+
* Explicit means that reflection is per default disabled for this file, but each symbol/type
|
|
3460
|
+
* in it is allowed to enable it using jsdoc `@reflection`.
|
|
3461
|
+
*/
|
|
3462
|
+
const reflectionModes = [
|
|
3463
|
+
"default",
|
|
3464
|
+
"explicit",
|
|
3465
|
+
"never"
|
|
3466
|
+
];
|
|
3467
|
+
function isObject(obj) {
|
|
3468
|
+
if (!obj) return false;
|
|
3469
|
+
return typeof obj === "object" && !Array.isArray(obj);
|
|
3470
|
+
}
|
|
3471
|
+
const defaultMergeStrategy = "merge";
|
|
3472
|
+
const reflectionLevel = [
|
|
3473
|
+
"minimal",
|
|
3474
|
+
"normal",
|
|
3475
|
+
"extended",
|
|
3476
|
+
"verbose"
|
|
3477
|
+
];
|
|
3478
|
+
/**
|
|
3479
|
+
* Read config and parses under TypeScript specification.
|
|
3480
|
+
*/
|
|
3481
|
+
function readTsConfig(parseConfigHost, path) {
|
|
3482
|
+
const configFile = typescript.default.readConfigFile(path, (path) => parseConfigHost.readFile(path));
|
|
3483
|
+
if (configFile.error) {
|
|
3484
|
+
debug(`Failed to read tsconfig ${path}: ${configFile.error.messageText}`);
|
|
3485
|
+
return;
|
|
3486
|
+
}
|
|
3487
|
+
const parsed = typescript.default.parseJsonConfigFileContent(configFile.config, parseConfigHost, (0, node_path.dirname)(path));
|
|
3488
|
+
const ignoredErrors = [18003];
|
|
3489
|
+
const softErrors = [18e3];
|
|
3490
|
+
const errors = parsed.errors.filter((v) => !ignoredErrors.includes(v.code));
|
|
3491
|
+
if (errors.length) debug(`Failed to parse tsconfig ${path}: ${parsed.errors.map((v) => v.messageText).join(", ")}`);
|
|
3492
|
+
if (errors.filter((v) => !softErrors.includes(v.code)).length) return;
|
|
3493
|
+
const json = (0, node_fs.readFileSync)(path, "utf8");
|
|
3494
|
+
const tsconfig = JSON.parse(json);
|
|
3495
|
+
return Object.assign(configFile.config, {
|
|
3496
|
+
compilerOptions: parsed.options,
|
|
3497
|
+
reflectionLevel: tsconfig.reflectionLevel ? String(tsconfig.reflectionLevel) : void 0
|
|
3498
|
+
});
|
|
3499
|
+
}
|
|
3500
|
+
function reflectionModeMatcher(config, filePath) {
|
|
3501
|
+
if (Array.isArray(config.exclude)) {
|
|
3502
|
+
if (patternMatch(filePath, config.exclude)) return "never";
|
|
3503
|
+
}
|
|
3504
|
+
if (Array.isArray(config.reflection)) return patternMatch(filePath, config.reflection) ? "default" : "never";
|
|
3505
|
+
if (config.reflection === "default" || config.reflection === "explicit") return config.reflection;
|
|
3506
|
+
return "never";
|
|
3507
|
+
}
|
|
3508
|
+
function ensureStringArray(value) {
|
|
3509
|
+
if (Array.isArray(value)) return value.map((v) => "" + v);
|
|
3510
|
+
if ("string" === typeof value) return [value];
|
|
3511
|
+
return [];
|
|
3512
|
+
}
|
|
3513
|
+
function parseRawMode(mode) {
|
|
3514
|
+
if ("boolean" === typeof mode) return mode ? "default" : "never";
|
|
3515
|
+
if (mode === "default" || mode === "explicit") return mode;
|
|
3516
|
+
return ensureStringArray(mode);
|
|
3517
|
+
}
|
|
3518
|
+
function resolvePaths(baseDir, paths) {
|
|
3519
|
+
if (!paths || !Array.isArray(paths)) return;
|
|
3520
|
+
for (let i = 0; i < paths.length; i++) {
|
|
3521
|
+
if ("string" !== typeof paths[i]) continue;
|
|
3522
|
+
if ((0, node_path.isAbsolute)(paths[i])) continue;
|
|
3523
|
+
let path = paths[i];
|
|
3524
|
+
let exclude = false;
|
|
3525
|
+
if (path.startsWith("!")) {
|
|
3526
|
+
exclude = true;
|
|
3527
|
+
path = path.substring(1);
|
|
3528
|
+
}
|
|
3529
|
+
if (path.startsWith("./") || path.includes("/")) path = (0, node_path.join)(baseDir, path);
|
|
3530
|
+
path = path.replace(/\\/g, "/");
|
|
3531
|
+
if (exclude) path = "!" + path;
|
|
3532
|
+
paths[i] = path;
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
function appendPaths(strategy = defaultMergeStrategy, parent, existing) {
|
|
3536
|
+
if (strategy === "replace") return [...existing || parent];
|
|
3537
|
+
if (!existing) return [...parent];
|
|
3538
|
+
return [...parent, ...existing];
|
|
3539
|
+
}
|
|
3540
|
+
function applyConfigValues(existing, parent, baseDir) {
|
|
3541
|
+
const parentReflection = isObject(parent.deepkitCompilerOptions) ? parent.deepkitCompilerOptions?.reflection : parent.reflection;
|
|
3542
|
+
const parentReflectionLevel = parent.deepkitCompilerOptions?.reflectionLevel || parent.reflectionLevel || parent.compilerOptions?.reflectionLevel;
|
|
3543
|
+
if (isObject(parent.deepkitCompilerOptions) && "undefined" === typeof existing.mergeStrategy) existing.mergeStrategy = parent.deepkitCompilerOptions.mergeStrategy;
|
|
3544
|
+
if ("undefined" !== typeof parentReflection) {
|
|
3545
|
+
const next = parseRawMode(parentReflection);
|
|
3546
|
+
if ("undefined" === typeof existing.reflection) existing.reflection = next;
|
|
3547
|
+
else if ("string" === typeof existing.reflection) {} else if (Array.isArray(next) && Array.isArray(existing.reflection)) existing.reflection = appendPaths(existing.mergeStrategy, next, existing.reflection);
|
|
3548
|
+
else if ("string" === typeof next && Array.isArray(existing.reflection)) {}
|
|
3549
|
+
}
|
|
3550
|
+
if ("undefined" !== typeof parentReflectionLevel) {
|
|
3551
|
+
if ("undefined" === typeof existing.reflectionLevel) existing.reflectionLevel = parentReflectionLevel;
|
|
3552
|
+
}
|
|
3553
|
+
if (isObject(parent.deepkitCompilerOptions)) {
|
|
3554
|
+
if (`undefined` !== typeof parent.deepkitCompilerOptions.exclude) {
|
|
3555
|
+
const next = ensureStringArray(parent.deepkitCompilerOptions.exclude);
|
|
3556
|
+
existing.exclude = appendPaths(existing.mergeStrategy, next, existing.exclude);
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
resolvePaths(baseDir, existing.reflection);
|
|
3560
|
+
resolvePaths(baseDir, existing.exclude);
|
|
3561
|
+
if (parent.compilerOptions) {
|
|
3562
|
+
if (Object.keys(existing.compilerOptions).length === 0) Object.assign(existing.compilerOptions, parent.compilerOptions);
|
|
3563
|
+
}
|
|
3564
|
+
existing.extends = parent.extends;
|
|
3565
|
+
}
|
|
3566
|
+
const defaultExcluded = [
|
|
3567
|
+
"lib.dom*.d.ts",
|
|
3568
|
+
"*typedarrays.d.ts",
|
|
3569
|
+
"lib.webworker*.d.ts",
|
|
3570
|
+
"lib.decorator*.d.ts",
|
|
3571
|
+
"lib.es2015.proxy.d.ts",
|
|
3572
|
+
"lib.es2020.sharedmemory.d.ts",
|
|
3573
|
+
"lib.es2015.core.d.ts"
|
|
3574
|
+
];
|
|
3575
|
+
function getConfigResolver(cache, host, compilerOptions, sourceFile, tsConfigPath = "") {
|
|
3576
|
+
let config = { compilerOptions: {} };
|
|
3577
|
+
tsConfigPath = tsConfigPath || ("string" === typeof compilerOptions.configFilePath ? compilerOptions.configFilePath : "");
|
|
3578
|
+
if (tsConfigPath) {
|
|
3579
|
+
if (cache[tsConfigPath]) return cache[tsConfigPath];
|
|
3580
|
+
const configFile = readTsConfig(host, tsConfigPath);
|
|
3581
|
+
if (configFile) applyConfigValues(config, configFile, (0, node_path.dirname)(tsConfigPath));
|
|
3582
|
+
} else {
|
|
3583
|
+
if (!tsConfigPath && sourceFile) {
|
|
3584
|
+
const baseDir = (0, node_path.dirname)(sourceFile.fileName);
|
|
3585
|
+
const configPath = typescript.default.findConfigFile(baseDir, (path) => {
|
|
3586
|
+
path = (0, node_path.isAbsolute)(path) ? path : (0, node_path.join)(baseDir, path);
|
|
3587
|
+
return host.fileExists(path);
|
|
3588
|
+
});
|
|
3589
|
+
debug2(`No tsConfigPath|compilerOptions.configFilePath provided. Manually searching for tsconfig.json in ${baseDir} returned ${configPath}`);
|
|
3590
|
+
if (configPath) tsConfigPath = (0, node_path.isAbsolute)(configPath) ? configPath : (0, node_path.join)(baseDir, configPath);
|
|
3591
|
+
}
|
|
3592
|
+
if (tsConfigPath) {
|
|
3593
|
+
if (cache[tsConfigPath]) return cache[tsConfigPath];
|
|
3594
|
+
const configFile = readTsConfig(host, tsConfigPath);
|
|
3595
|
+
if (configFile) applyConfigValues(config, configFile, (0, node_path.dirname)(tsConfigPath));
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
if (tsConfigPath) {
|
|
3599
|
+
let basePath = (0, node_path.dirname)(tsConfigPath);
|
|
3600
|
+
let currentConfig = config;
|
|
3601
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3602
|
+
seen.add(tsConfigPath);
|
|
3603
|
+
while (currentConfig.extends) {
|
|
3604
|
+
const path = (0, node_path.join)(basePath, currentConfig.extends);
|
|
3605
|
+
if (seen.has(path)) break;
|
|
3606
|
+
seen.add(path);
|
|
3607
|
+
const nextConfig = typescript.default.readConfigFile(path, (path) => host.readFile(path));
|
|
3608
|
+
if (!nextConfig) break;
|
|
3609
|
+
basePath = (0, node_path.dirname)(path);
|
|
3610
|
+
applyConfigValues(currentConfig, nextConfig.config, basePath);
|
|
3611
|
+
}
|
|
3612
|
+
} else throw new Error(`No tsconfig found for ${sourceFile?.fileName}, that is weird. Either provide a tsconfig or compilerOptions.configFilePath`);
|
|
3613
|
+
config.exclude = config.exclude ? [...defaultExcluded, ...config.exclude] : [...defaultExcluded];
|
|
3614
|
+
config.compilerOptions.configFilePath = tsConfigPath;
|
|
3615
|
+
const resolvedConfig = {
|
|
3616
|
+
path: tsConfigPath,
|
|
3617
|
+
compilerOptions: Object.assign(config.compilerOptions, compilerOptions),
|
|
3618
|
+
exclude: config.exclude,
|
|
3619
|
+
reflection: config.reflection,
|
|
3620
|
+
reflectionLevel: config.reflectionLevel || (config.compilerOptions?.reflectionLevel ? String(config.compilerOptions?.reflectionLevel) : void 0) || "normal",
|
|
3621
|
+
mergeStrategy: config.mergeStrategy || defaultMergeStrategy
|
|
3622
|
+
};
|
|
3623
|
+
if (isDebug()) debug(`Found config ${resolvedConfig.path}:\nreflection:`, resolvedConfig.reflection, `\nexclude:`, resolvedConfig.exclude, `\npaths:`, resolvedConfig.compilerOptions.paths);
|
|
3624
|
+
const match = (path) => {
|
|
3625
|
+
return {
|
|
3626
|
+
mode: reflectionModeMatcher(config, path),
|
|
3627
|
+
tsConfigPath,
|
|
3628
|
+
level: resolvedConfig.reflectionLevel
|
|
3629
|
+
};
|
|
3630
|
+
};
|
|
3631
|
+
return cache[tsConfigPath] = {
|
|
3632
|
+
config: resolvedConfig,
|
|
3633
|
+
match
|
|
3634
|
+
};
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
//#endregion
|
|
3638
|
+
Object.defineProperty(exports, 'Resolver', {
|
|
3639
|
+
enumerable: true,
|
|
3640
|
+
get: function () {
|
|
3641
|
+
return Resolver;
|
|
3642
|
+
}
|
|
3643
|
+
});
|
|
3644
|
+
Object.defineProperty(exports, '__commonJSMin', {
|
|
3645
|
+
enumerable: true,
|
|
3646
|
+
get: function () {
|
|
3647
|
+
return __commonJSMin;
|
|
3648
|
+
}
|
|
3649
|
+
});
|
|
3650
|
+
Object.defineProperty(exports, '__toESM', {
|
|
3651
|
+
enumerable: true,
|
|
3652
|
+
get: function () {
|
|
3653
|
+
return __toESM;
|
|
3654
|
+
}
|
|
3655
|
+
});
|
|
3656
|
+
Object.defineProperty(exports, 'debug', {
|
|
3657
|
+
enumerable: true,
|
|
3658
|
+
get: function () {
|
|
3659
|
+
return debug;
|
|
3660
|
+
}
|
|
3661
|
+
});
|
|
3662
|
+
Object.defineProperty(exports, 'debug2', {
|
|
3663
|
+
enumerable: true,
|
|
3664
|
+
get: function () {
|
|
3665
|
+
return debug2;
|
|
3666
|
+
}
|
|
3667
|
+
});
|
|
3668
|
+
Object.defineProperty(exports, 'defaultExcluded', {
|
|
3669
|
+
enumerable: true,
|
|
3670
|
+
get: function () {
|
|
3671
|
+
return defaultExcluded;
|
|
3672
|
+
}
|
|
3673
|
+
});
|
|
3674
|
+
Object.defineProperty(exports, 'getConfigResolver', {
|
|
3675
|
+
enumerable: true,
|
|
3676
|
+
get: function () {
|
|
3677
|
+
return getConfigResolver;
|
|
3678
|
+
}
|
|
3679
|
+
});
|
|
3680
|
+
Object.defineProperty(exports, 'isObject', {
|
|
3681
|
+
enumerable: true,
|
|
3682
|
+
get: function () {
|
|
3683
|
+
return isObject;
|
|
3684
|
+
}
|
|
3685
|
+
});
|
|
3686
|
+
Object.defineProperty(exports, 'parseRawMode', {
|
|
3687
|
+
enumerable: true,
|
|
3688
|
+
get: function () {
|
|
3689
|
+
return parseRawMode;
|
|
3690
|
+
}
|
|
3691
|
+
});
|
|
3692
|
+
Object.defineProperty(exports, 'reflectionLevel', {
|
|
3693
|
+
enumerable: true,
|
|
3694
|
+
get: function () {
|
|
3695
|
+
return reflectionLevel;
|
|
3696
|
+
}
|
|
3697
|
+
});
|
|
3698
|
+
Object.defineProperty(exports, 'reflectionModeMatcher', {
|
|
3699
|
+
enumerable: true,
|
|
3700
|
+
get: function () {
|
|
3701
|
+
return reflectionModeMatcher;
|
|
3702
|
+
}
|
|
3703
|
+
});
|
|
3704
|
+
Object.defineProperty(exports, 'reflectionModes', {
|
|
3705
|
+
enumerable: true,
|
|
3706
|
+
get: function () {
|
|
3707
|
+
return reflectionModes;
|
|
3708
|
+
}
|
|
3709
|
+
});
|