@powerlines/deepkit 0.6.167 → 0.7.1

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