1 | "use strict";
|
2 | var __getOwnPropNames = Object.getOwnPropertyNames;
|
3 | var __commonJS = (cb, mod) => function __require() {
|
4 | return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
5 | };
|
6 |
|
7 |
|
8 | var require_global = __commonJS({
|
9 | "node_modules/core-js/internals/global.js"(exports2, module2) {
|
10 | var check = function(it) {
|
11 | return it && it.Math == Math && it;
|
12 | };
|
13 | module2.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || function() {
|
14 | return this;
|
15 | }() || Function("return this")();
|
16 | }
|
17 | });
|
18 |
|
19 |
|
20 | var require_fails = __commonJS({
|
21 | "node_modules/core-js/internals/fails.js"(exports2, module2) {
|
22 | module2.exports = function(exec) {
|
23 | try {
|
24 | return !!exec();
|
25 | } catch (error) {
|
26 | return true;
|
27 | }
|
28 | };
|
29 | }
|
30 | });
|
31 |
|
32 |
|
33 | var require_descriptors = __commonJS({
|
34 | "node_modules/core-js/internals/descriptors.js"(exports2, module2) {
|
35 | var fails = require_fails();
|
36 | module2.exports = !fails(function() {
|
37 | return Object.defineProperty({}, 1, { get: function() {
|
38 | return 7;
|
39 | } })[1] != 7;
|
40 | });
|
41 | }
|
42 | });
|
43 |
|
44 |
|
45 | var require_function_bind_native = __commonJS({
|
46 | "node_modules/core-js/internals/function-bind-native.js"(exports2, module2) {
|
47 | var fails = require_fails();
|
48 | module2.exports = !fails(function() {
|
49 | var test = function() {
|
50 | }.bind();
|
51 | return typeof test != "function" || test.hasOwnProperty("prototype");
|
52 | });
|
53 | }
|
54 | });
|
55 |
|
56 |
|
57 | var require_function_call = __commonJS({
|
58 | "node_modules/core-js/internals/function-call.js"(exports2, module2) {
|
59 | var NATIVE_BIND = require_function_bind_native();
|
60 | var call = Function.prototype.call;
|
61 | module2.exports = NATIVE_BIND ? call.bind(call) : function() {
|
62 | return call.apply(call, arguments);
|
63 | };
|
64 | }
|
65 | });
|
66 |
|
67 |
|
68 | var require_object_property_is_enumerable = __commonJS({
|
69 | "node_modules/core-js/internals/object-property-is-enumerable.js"(exports2) {
|
70 | "use strict";
|
71 | var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
72 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
73 | var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
74 | exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
75 | var descriptor = getOwnPropertyDescriptor(this, V);
|
76 | return !!descriptor && descriptor.enumerable;
|
77 | } : $propertyIsEnumerable;
|
78 | }
|
79 | });
|
80 |
|
81 |
|
82 | var require_create_property_descriptor = __commonJS({
|
83 | "node_modules/core-js/internals/create-property-descriptor.js"(exports2, module2) {
|
84 | module2.exports = function(bitmap, value) {
|
85 | return {
|
86 | enumerable: !(bitmap & 1),
|
87 | configurable: !(bitmap & 2),
|
88 | writable: !(bitmap & 4),
|
89 | value
|
90 | };
|
91 | };
|
92 | }
|
93 | });
|
94 |
|
95 |
|
96 | var require_function_uncurry_this = __commonJS({
|
97 | "node_modules/core-js/internals/function-uncurry-this.js"(exports2, module2) {
|
98 | var NATIVE_BIND = require_function_bind_native();
|
99 | var FunctionPrototype = Function.prototype;
|
100 | var call = FunctionPrototype.call;
|
101 | var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
|
102 | module2.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn) {
|
103 | return function() {
|
104 | return call.apply(fn, arguments);
|
105 | };
|
106 | };
|
107 | }
|
108 | });
|
109 |
|
110 |
|
111 | var require_classof_raw = __commonJS({
|
112 | "node_modules/core-js/internals/classof-raw.js"(exports2, module2) {
|
113 | var uncurryThis = require_function_uncurry_this();
|
114 | var toString = uncurryThis({}.toString);
|
115 | var stringSlice = uncurryThis("".slice);
|
116 | module2.exports = function(it) {
|
117 | return stringSlice(toString(it), 8, -1);
|
118 | };
|
119 | }
|
120 | });
|
121 |
|
122 |
|
123 | var require_indexed_object = __commonJS({
|
124 | "node_modules/core-js/internals/indexed-object.js"(exports2, module2) {
|
125 | var uncurryThis = require_function_uncurry_this();
|
126 | var fails = require_fails();
|
127 | var classof = require_classof_raw();
|
128 | var $Object = Object;
|
129 | var split = uncurryThis("".split);
|
130 | module2.exports = fails(function() {
|
131 | return !$Object("z").propertyIsEnumerable(0);
|
132 | }) ? function(it) {
|
133 | return classof(it) == "String" ? split(it, "") : $Object(it);
|
134 | } : $Object;
|
135 | }
|
136 | });
|
137 |
|
138 |
|
139 | var require_is_null_or_undefined = __commonJS({
|
140 | "node_modules/core-js/internals/is-null-or-undefined.js"(exports2, module2) {
|
141 | module2.exports = function(it) {
|
142 | return it === null || it === void 0;
|
143 | };
|
144 | }
|
145 | });
|
146 |
|
147 |
|
148 | var require_require_object_coercible = __commonJS({
|
149 | "node_modules/core-js/internals/require-object-coercible.js"(exports2, module2) {
|
150 | var isNullOrUndefined = require_is_null_or_undefined();
|
151 | var $TypeError = TypeError;
|
152 | module2.exports = function(it) {
|
153 | if (isNullOrUndefined(it))
|
154 | throw $TypeError("Can't call method on " + it);
|
155 | return it;
|
156 | };
|
157 | }
|
158 | });
|
159 |
|
160 |
|
161 | var require_to_indexed_object = __commonJS({
|
162 | "node_modules/core-js/internals/to-indexed-object.js"(exports2, module2) {
|
163 | var IndexedObject = require_indexed_object();
|
164 | var requireObjectCoercible = require_require_object_coercible();
|
165 | module2.exports = function(it) {
|
166 | return IndexedObject(requireObjectCoercible(it));
|
167 | };
|
168 | }
|
169 | });
|
170 |
|
171 |
|
172 | var require_document_all = __commonJS({
|
173 | "node_modules/core-js/internals/document-all.js"(exports2, module2) {
|
174 | var documentAll = typeof document == "object" && document.all;
|
175 | var IS_HTMLDDA = typeof documentAll == "undefined" && documentAll !== void 0;
|
176 | module2.exports = {
|
177 | all: documentAll,
|
178 | IS_HTMLDDA
|
179 | };
|
180 | }
|
181 | });
|
182 |
|
183 |
|
184 | var require_is_callable = __commonJS({
|
185 | "node_modules/core-js/internals/is-callable.js"(exports2, module2) {
|
186 | var $documentAll = require_document_all();
|
187 | var documentAll = $documentAll.all;
|
188 | module2.exports = $documentAll.IS_HTMLDDA ? function(argument) {
|
189 | return typeof argument == "function" || argument === documentAll;
|
190 | } : function(argument) {
|
191 | return typeof argument == "function";
|
192 | };
|
193 | }
|
194 | });
|
195 |
|
196 |
|
197 | var require_is_object = __commonJS({
|
198 | "node_modules/core-js/internals/is-object.js"(exports2, module2) {
|
199 | var isCallable = require_is_callable();
|
200 | var $documentAll = require_document_all();
|
201 | var documentAll = $documentAll.all;
|
202 | module2.exports = $documentAll.IS_HTMLDDA ? function(it) {
|
203 | return typeof it == "object" ? it !== null : isCallable(it) || it === documentAll;
|
204 | } : function(it) {
|
205 | return typeof it == "object" ? it !== null : isCallable(it);
|
206 | };
|
207 | }
|
208 | });
|
209 |
|
210 |
|
211 | var require_get_built_in = __commonJS({
|
212 | "node_modules/core-js/internals/get-built-in.js"(exports2, module2) {
|
213 | var global2 = require_global();
|
214 | var isCallable = require_is_callable();
|
215 | var aFunction = function(argument) {
|
216 | return isCallable(argument) ? argument : void 0;
|
217 | };
|
218 | module2.exports = function(namespace, method) {
|
219 | return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
|
220 | };
|
221 | }
|
222 | });
|
223 |
|
224 |
|
225 | var require_object_is_prototype_of = __commonJS({
|
226 | "node_modules/core-js/internals/object-is-prototype-of.js"(exports2, module2) {
|
227 | var uncurryThis = require_function_uncurry_this();
|
228 | module2.exports = uncurryThis({}.isPrototypeOf);
|
229 | }
|
230 | });
|
231 |
|
232 |
|
233 | var require_engine_user_agent = __commonJS({
|
234 | "node_modules/core-js/internals/engine-user-agent.js"(exports2, module2) {
|
235 | var getBuiltIn = require_get_built_in();
|
236 | module2.exports = getBuiltIn("navigator", "userAgent") || "";
|
237 | }
|
238 | });
|
239 |
|
240 |
|
241 | var require_engine_v8_version = __commonJS({
|
242 | "node_modules/core-js/internals/engine-v8-version.js"(exports2, module2) {
|
243 | var global2 = require_global();
|
244 | var userAgent = require_engine_user_agent();
|
245 | var process2 = global2.process;
|
246 | var Deno = global2.Deno;
|
247 | var versions = process2 && process2.versions || Deno && Deno.version;
|
248 | var v8 = versions && versions.v8;
|
249 | var match;
|
250 | var version;
|
251 | if (v8) {
|
252 | match = v8.split(".");
|
253 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
254 | }
|
255 | if (!version && userAgent) {
|
256 | match = userAgent.match(/Edge\/(\d+)/);
|
257 | if (!match || match[1] >= 74) {
|
258 | match = userAgent.match(/Chrome\/(\d+)/);
|
259 | if (match)
|
260 | version = +match[1];
|
261 | }
|
262 | }
|
263 | module2.exports = version;
|
264 | }
|
265 | });
|
266 |
|
267 |
|
268 | var require_symbol_constructor_detection = __commonJS({
|
269 | "node_modules/core-js/internals/symbol-constructor-detection.js"(exports2, module2) {
|
270 | var V8_VERSION = require_engine_v8_version();
|
271 | var fails = require_fails();
|
272 | module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
|
273 | var symbol = Symbol();
|
274 | return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
275 | });
|
276 | }
|
277 | });
|
278 |
|
279 |
|
280 | var require_use_symbol_as_uid = __commonJS({
|
281 | "node_modules/core-js/internals/use-symbol-as-uid.js"(exports2, module2) {
|
282 | var NATIVE_SYMBOL = require_symbol_constructor_detection();
|
283 | module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
|
284 | }
|
285 | });
|
286 |
|
287 |
|
288 | var require_is_symbol = __commonJS({
|
289 | "node_modules/core-js/internals/is-symbol.js"(exports2, module2) {
|
290 | var getBuiltIn = require_get_built_in();
|
291 | var isCallable = require_is_callable();
|
292 | var isPrototypeOf = require_object_is_prototype_of();
|
293 | var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
|
294 | var $Object = Object;
|
295 | module2.exports = USE_SYMBOL_AS_UID ? function(it) {
|
296 | return typeof it == "symbol";
|
297 | } : function(it) {
|
298 | var $Symbol = getBuiltIn("Symbol");
|
299 | return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
|
300 | };
|
301 | }
|
302 | });
|
303 |
|
304 |
|
305 | var require_try_to_string = __commonJS({
|
306 | "node_modules/core-js/internals/try-to-string.js"(exports2, module2) {
|
307 | var $String = String;
|
308 | module2.exports = function(argument) {
|
309 | try {
|
310 | return $String(argument);
|
311 | } catch (error) {
|
312 | return "Object";
|
313 | }
|
314 | };
|
315 | }
|
316 | });
|
317 |
|
318 |
|
319 | var require_a_callable = __commonJS({
|
320 | "node_modules/core-js/internals/a-callable.js"(exports2, module2) {
|
321 | var isCallable = require_is_callable();
|
322 | var tryToString = require_try_to_string();
|
323 | var $TypeError = TypeError;
|
324 | module2.exports = function(argument) {
|
325 | if (isCallable(argument))
|
326 | return argument;
|
327 | throw $TypeError(tryToString(argument) + " is not a function");
|
328 | };
|
329 | }
|
330 | });
|
331 |
|
332 |
|
333 | var require_get_method = __commonJS({
|
334 | "node_modules/core-js/internals/get-method.js"(exports2, module2) {
|
335 | var aCallable = require_a_callable();
|
336 | var isNullOrUndefined = require_is_null_or_undefined();
|
337 | module2.exports = function(V, P) {
|
338 | var func = V[P];
|
339 | return isNullOrUndefined(func) ? void 0 : aCallable(func);
|
340 | };
|
341 | }
|
342 | });
|
343 |
|
344 |
|
345 | var require_ordinary_to_primitive = __commonJS({
|
346 | "node_modules/core-js/internals/ordinary-to-primitive.js"(exports2, module2) {
|
347 | var call = require_function_call();
|
348 | var isCallable = require_is_callable();
|
349 | var isObject = require_is_object();
|
350 | var $TypeError = TypeError;
|
351 | module2.exports = function(input, pref) {
|
352 | var fn, val;
|
353 | if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
|
354 | return val;
|
355 | if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))
|
356 | return val;
|
357 | if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
|
358 | return val;
|
359 | throw $TypeError("Can't convert object to primitive value");
|
360 | };
|
361 | }
|
362 | });
|
363 |
|
364 |
|
365 | var require_is_pure = __commonJS({
|
366 | "node_modules/core-js/internals/is-pure.js"(exports2, module2) {
|
367 | module2.exports = false;
|
368 | }
|
369 | });
|
370 |
|
371 |
|
372 | var require_define_global_property = __commonJS({
|
373 | "node_modules/core-js/internals/define-global-property.js"(exports2, module2) {
|
374 | var global2 = require_global();
|
375 | var defineProperty = Object.defineProperty;
|
376 | module2.exports = function(key, value) {
|
377 | try {
|
378 | defineProperty(global2, key, { value, configurable: true, writable: true });
|
379 | } catch (error) {
|
380 | global2[key] = value;
|
381 | }
|
382 | return value;
|
383 | };
|
384 | }
|
385 | });
|
386 |
|
387 |
|
388 | var require_shared_store = __commonJS({
|
389 | "node_modules/core-js/internals/shared-store.js"(exports2, module2) {
|
390 | var global2 = require_global();
|
391 | var defineGlobalProperty = require_define_global_property();
|
392 | var SHARED = "__core-js_shared__";
|
393 | var store = global2[SHARED] || defineGlobalProperty(SHARED, {});
|
394 | module2.exports = store;
|
395 | }
|
396 | });
|
397 |
|
398 |
|
399 | var require_shared = __commonJS({
|
400 | "node_modules/core-js/internals/shared.js"(exports2, module2) {
|
401 | var IS_PURE = require_is_pure();
|
402 | var store = require_shared_store();
|
403 | (module2.exports = function(key, value) {
|
404 | return store[key] || (store[key] = value !== void 0 ? value : {});
|
405 | })("versions", []).push({
|
406 | version: "3.26.1",
|
407 | mode: IS_PURE ? "pure" : "global",
|
408 | copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",
|
409 | license: "https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",
|
410 | source: "https://github.com/zloirock/core-js"
|
411 | });
|
412 | }
|
413 | });
|
414 |
|
415 |
|
416 | var require_to_object = __commonJS({
|
417 | "node_modules/core-js/internals/to-object.js"(exports2, module2) {
|
418 | var requireObjectCoercible = require_require_object_coercible();
|
419 | var $Object = Object;
|
420 | module2.exports = function(argument) {
|
421 | return $Object(requireObjectCoercible(argument));
|
422 | };
|
423 | }
|
424 | });
|
425 |
|
426 |
|
427 | var require_has_own_property = __commonJS({
|
428 | "node_modules/core-js/internals/has-own-property.js"(exports2, module2) {
|
429 | var uncurryThis = require_function_uncurry_this();
|
430 | var toObject = require_to_object();
|
431 | var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
432 | module2.exports = Object.hasOwn || function hasOwn(it, key) {
|
433 | return hasOwnProperty(toObject(it), key);
|
434 | };
|
435 | }
|
436 | });
|
437 |
|
438 |
|
439 | var require_uid = __commonJS({
|
440 | "node_modules/core-js/internals/uid.js"(exports2, module2) {
|
441 | var uncurryThis = require_function_uncurry_this();
|
442 | var id = 0;
|
443 | var postfix = Math.random();
|
444 | var toString = uncurryThis(1 .toString);
|
445 | module2.exports = function(key) {
|
446 | return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
|
447 | };
|
448 | }
|
449 | });
|
450 |
|
451 |
|
452 | var require_well_known_symbol = __commonJS({
|
453 | "node_modules/core-js/internals/well-known-symbol.js"(exports2, module2) {
|
454 | var global2 = require_global();
|
455 | var shared = require_shared();
|
456 | var hasOwn = require_has_own_property();
|
457 | var uid = require_uid();
|
458 | var NATIVE_SYMBOL = require_symbol_constructor_detection();
|
459 | var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
|
460 | var WellKnownSymbolsStore = shared("wks");
|
461 | var Symbol2 = global2.Symbol;
|
462 | var symbolFor = Symbol2 && Symbol2["for"];
|
463 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
|
464 | module2.exports = function(name) {
|
465 | if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
|
466 | var description = "Symbol." + name;
|
467 | if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) {
|
468 | WellKnownSymbolsStore[name] = Symbol2[name];
|
469 | } else if (USE_SYMBOL_AS_UID && symbolFor) {
|
470 | WellKnownSymbolsStore[name] = symbolFor(description);
|
471 | } else {
|
472 | WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
473 | }
|
474 | }
|
475 | return WellKnownSymbolsStore[name];
|
476 | };
|
477 | }
|
478 | });
|
479 |
|
480 |
|
481 | var require_to_primitive = __commonJS({
|
482 | "node_modules/core-js/internals/to-primitive.js"(exports2, module2) {
|
483 | var call = require_function_call();
|
484 | var isObject = require_is_object();
|
485 | var isSymbol = require_is_symbol();
|
486 | var getMethod = require_get_method();
|
487 | var ordinaryToPrimitive = require_ordinary_to_primitive();
|
488 | var wellKnownSymbol = require_well_known_symbol();
|
489 | var $TypeError = TypeError;
|
490 | var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
|
491 | module2.exports = function(input, pref) {
|
492 | if (!isObject(input) || isSymbol(input))
|
493 | return input;
|
494 | var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
495 | var result;
|
496 | if (exoticToPrim) {
|
497 | if (pref === void 0)
|
498 | pref = "default";
|
499 | result = call(exoticToPrim, input, pref);
|
500 | if (!isObject(result) || isSymbol(result))
|
501 | return result;
|
502 | throw $TypeError("Can't convert object to primitive value");
|
503 | }
|
504 | if (pref === void 0)
|
505 | pref = "number";
|
506 | return ordinaryToPrimitive(input, pref);
|
507 | };
|
508 | }
|
509 | });
|
510 |
|
511 |
|
512 | var require_to_property_key = __commonJS({
|
513 | "node_modules/core-js/internals/to-property-key.js"(exports2, module2) {
|
514 | var toPrimitive = require_to_primitive();
|
515 | var isSymbol = require_is_symbol();
|
516 | module2.exports = function(argument) {
|
517 | var key = toPrimitive(argument, "string");
|
518 | return isSymbol(key) ? key : key + "";
|
519 | };
|
520 | }
|
521 | });
|
522 |
|
523 |
|
524 | var require_document_create_element = __commonJS({
|
525 | "node_modules/core-js/internals/document-create-element.js"(exports2, module2) {
|
526 | var global2 = require_global();
|
527 | var isObject = require_is_object();
|
528 | var document2 = global2.document;
|
529 | var EXISTS = isObject(document2) && isObject(document2.createElement);
|
530 | module2.exports = function(it) {
|
531 | return EXISTS ? document2.createElement(it) : {};
|
532 | };
|
533 | }
|
534 | });
|
535 |
|
536 |
|
537 | var require_ie8_dom_define = __commonJS({
|
538 | "node_modules/core-js/internals/ie8-dom-define.js"(exports2, module2) {
|
539 | var DESCRIPTORS = require_descriptors();
|
540 | var fails = require_fails();
|
541 | var createElement = require_document_create_element();
|
542 | module2.exports = !DESCRIPTORS && !fails(function() {
|
543 | return Object.defineProperty(createElement("div"), "a", {
|
544 | get: function() {
|
545 | return 7;
|
546 | }
|
547 | }).a != 7;
|
548 | });
|
549 | }
|
550 | });
|
551 |
|
552 |
|
553 | var require_object_get_own_property_descriptor = __commonJS({
|
554 | "node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports2) {
|
555 | var DESCRIPTORS = require_descriptors();
|
556 | var call = require_function_call();
|
557 | var propertyIsEnumerableModule = require_object_property_is_enumerable();
|
558 | var createPropertyDescriptor = require_create_property_descriptor();
|
559 | var toIndexedObject = require_to_indexed_object();
|
560 | var toPropertyKey = require_to_property_key();
|
561 | var hasOwn = require_has_own_property();
|
562 | var IE8_DOM_DEFINE = require_ie8_dom_define();
|
563 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
564 | exports2.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
565 | O = toIndexedObject(O);
|
566 | P = toPropertyKey(P);
|
567 | if (IE8_DOM_DEFINE)
|
568 | try {
|
569 | return $getOwnPropertyDescriptor(O, P);
|
570 | } catch (error) {
|
571 | }
|
572 | if (hasOwn(O, P))
|
573 | return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
574 | };
|
575 | }
|
576 | });
|
577 |
|
578 |
|
579 | var require_v8_prototype_define_bug = __commonJS({
|
580 | "node_modules/core-js/internals/v8-prototype-define-bug.js"(exports2, module2) {
|
581 | var DESCRIPTORS = require_descriptors();
|
582 | var fails = require_fails();
|
583 | module2.exports = DESCRIPTORS && fails(function() {
|
584 | return Object.defineProperty(function() {
|
585 | }, "prototype", {
|
586 | value: 42,
|
587 | writable: false
|
588 | }).prototype != 42;
|
589 | });
|
590 | }
|
591 | });
|
592 |
|
593 |
|
594 | var require_an_object = __commonJS({
|
595 | "node_modules/core-js/internals/an-object.js"(exports2, module2) {
|
596 | var isObject = require_is_object();
|
597 | var $String = String;
|
598 | var $TypeError = TypeError;
|
599 | module2.exports = function(argument) {
|
600 | if (isObject(argument))
|
601 | return argument;
|
602 | throw $TypeError($String(argument) + " is not an object");
|
603 | };
|
604 | }
|
605 | });
|
606 |
|
607 |
|
608 | var require_object_define_property = __commonJS({
|
609 | "node_modules/core-js/internals/object-define-property.js"(exports2) {
|
610 | var DESCRIPTORS = require_descriptors();
|
611 | var IE8_DOM_DEFINE = require_ie8_dom_define();
|
612 | var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
|
613 | var anObject = require_an_object();
|
614 | var toPropertyKey = require_to_property_key();
|
615 | var $TypeError = TypeError;
|
616 | var $defineProperty = Object.defineProperty;
|
617 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
618 | var ENUMERABLE = "enumerable";
|
619 | var CONFIGURABLE = "configurable";
|
620 | var WRITABLE = "writable";
|
621 | exports2.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
622 | anObject(O);
|
623 | P = toPropertyKey(P);
|
624 | anObject(Attributes);
|
625 | if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
626 | var current = $getOwnPropertyDescriptor(O, P);
|
627 | if (current && current[WRITABLE]) {
|
628 | O[P] = Attributes.value;
|
629 | Attributes = {
|
630 | configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
631 | enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
632 | writable: false
|
633 | };
|
634 | }
|
635 | }
|
636 | return $defineProperty(O, P, Attributes);
|
637 | } : $defineProperty : function defineProperty(O, P, Attributes) {
|
638 | anObject(O);
|
639 | P = toPropertyKey(P);
|
640 | anObject(Attributes);
|
641 | if (IE8_DOM_DEFINE)
|
642 | try {
|
643 | return $defineProperty(O, P, Attributes);
|
644 | } catch (error) {
|
645 | }
|
646 | if ("get" in Attributes || "set" in Attributes)
|
647 | throw $TypeError("Accessors not supported");
|
648 | if ("value" in Attributes)
|
649 | O[P] = Attributes.value;
|
650 | return O;
|
651 | };
|
652 | }
|
653 | });
|
654 |
|
655 |
|
656 | var require_create_non_enumerable_property = __commonJS({
|
657 | "node_modules/core-js/internals/create-non-enumerable-property.js"(exports2, module2) {
|
658 | var DESCRIPTORS = require_descriptors();
|
659 | var definePropertyModule = require_object_define_property();
|
660 | var createPropertyDescriptor = require_create_property_descriptor();
|
661 | module2.exports = DESCRIPTORS ? function(object, key, value) {
|
662 | return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
663 | } : function(object, key, value) {
|
664 | object[key] = value;
|
665 | return object;
|
666 | };
|
667 | }
|
668 | });
|
669 |
|
670 |
|
671 | var require_function_name = __commonJS({
|
672 | "node_modules/core-js/internals/function-name.js"(exports2, module2) {
|
673 | var DESCRIPTORS = require_descriptors();
|
674 | var hasOwn = require_has_own_property();
|
675 | var FunctionPrototype = Function.prototype;
|
676 | var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
677 | var EXISTS = hasOwn(FunctionPrototype, "name");
|
678 | var PROPER = EXISTS && function something() {
|
679 | }.name === "something";
|
680 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
|
681 | module2.exports = {
|
682 | EXISTS,
|
683 | PROPER,
|
684 | CONFIGURABLE
|
685 | };
|
686 | }
|
687 | });
|
688 |
|
689 |
|
690 | var require_inspect_source = __commonJS({
|
691 | "node_modules/core-js/internals/inspect-source.js"(exports2, module2) {
|
692 | var uncurryThis = require_function_uncurry_this();
|
693 | var isCallable = require_is_callable();
|
694 | var store = require_shared_store();
|
695 | var functionToString = uncurryThis(Function.toString);
|
696 | if (!isCallable(store.inspectSource)) {
|
697 | store.inspectSource = function(it) {
|
698 | return functionToString(it);
|
699 | };
|
700 | }
|
701 | module2.exports = store.inspectSource;
|
702 | }
|
703 | });
|
704 |
|
705 |
|
706 | var require_weak_map_basic_detection = __commonJS({
|
707 | "node_modules/core-js/internals/weak-map-basic-detection.js"(exports2, module2) {
|
708 | var global2 = require_global();
|
709 | var isCallable = require_is_callable();
|
710 | var WeakMap2 = global2.WeakMap;
|
711 | module2.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
|
712 | }
|
713 | });
|
714 |
|
715 |
|
716 | var require_shared_key = __commonJS({
|
717 | "node_modules/core-js/internals/shared-key.js"(exports2, module2) {
|
718 | var shared = require_shared();
|
719 | var uid = require_uid();
|
720 | var keys = shared("keys");
|
721 | module2.exports = function(key) {
|
722 | return keys[key] || (keys[key] = uid(key));
|
723 | };
|
724 | }
|
725 | });
|
726 |
|
727 |
|
728 | var require_hidden_keys = __commonJS({
|
729 | "node_modules/core-js/internals/hidden-keys.js"(exports2, module2) {
|
730 | module2.exports = {};
|
731 | }
|
732 | });
|
733 |
|
734 |
|
735 | var require_internal_state = __commonJS({
|
736 | "node_modules/core-js/internals/internal-state.js"(exports2, module2) {
|
737 | var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
|
738 | var global2 = require_global();
|
739 | var isObject = require_is_object();
|
740 | var createNonEnumerableProperty = require_create_non_enumerable_property();
|
741 | var hasOwn = require_has_own_property();
|
742 | var shared = require_shared_store();
|
743 | var sharedKey = require_shared_key();
|
744 | var hiddenKeys = require_hidden_keys();
|
745 | var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
|
746 | var TypeError2 = global2.TypeError;
|
747 | var WeakMap2 = global2.WeakMap;
|
748 | var set;
|
749 | var get;
|
750 | var has;
|
751 | var enforce = function(it) {
|
752 | return has(it) ? get(it) : set(it, {});
|
753 | };
|
754 | var getterFor = function(TYPE) {
|
755 | return function(it) {
|
756 | var state;
|
757 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
758 | throw TypeError2("Incompatible receiver, " + TYPE + " required");
|
759 | }
|
760 | return state;
|
761 | };
|
762 | };
|
763 | if (NATIVE_WEAK_MAP || shared.state) {
|
764 | store = shared.state || (shared.state = new WeakMap2());
|
765 | store.get = store.get;
|
766 | store.has = store.has;
|
767 | store.set = store.set;
|
768 | set = function(it, metadata) {
|
769 | if (store.has(it))
|
770 | throw TypeError2(OBJECT_ALREADY_INITIALIZED);
|
771 | metadata.facade = it;
|
772 | store.set(it, metadata);
|
773 | return metadata;
|
774 | };
|
775 | get = function(it) {
|
776 | return store.get(it) || {};
|
777 | };
|
778 | has = function(it) {
|
779 | return store.has(it);
|
780 | };
|
781 | } else {
|
782 | STATE = sharedKey("state");
|
783 | hiddenKeys[STATE] = true;
|
784 | set = function(it, metadata) {
|
785 | if (hasOwn(it, STATE))
|
786 | throw TypeError2(OBJECT_ALREADY_INITIALIZED);
|
787 | metadata.facade = it;
|
788 | createNonEnumerableProperty(it, STATE, metadata);
|
789 | return metadata;
|
790 | };
|
791 | get = function(it) {
|
792 | return hasOwn(it, STATE) ? it[STATE] : {};
|
793 | };
|
794 | has = function(it) {
|
795 | return hasOwn(it, STATE);
|
796 | };
|
797 | }
|
798 | var store;
|
799 | var STATE;
|
800 | module2.exports = {
|
801 | set,
|
802 | get,
|
803 | has,
|
804 | enforce,
|
805 | getterFor
|
806 | };
|
807 | }
|
808 | });
|
809 |
|
810 | // node_modules/core-js/internals/make-built-in.js
|
811 | var require_make_built_in = __commonJS({
|
812 | "node_modules/core-js/internals/make-built-in.js"(exports2, module2) {
|
813 | var fails = require_fails();
|
814 | var isCallable = require_is_callable();
|
815 | var hasOwn = require_has_own_property();
|
816 | var DESCRIPTORS = require_descriptors();
|
817 | var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
|
818 | var inspectSource = require_inspect_source();
|
819 | var InternalStateModule = require_internal_state();
|
820 | var enforceInternalState = InternalStateModule.enforce;
|
821 | var getInternalState = InternalStateModule.get;
|
822 | var defineProperty = Object.defineProperty;
|
823 | var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
|
824 | return defineProperty(function() {
|
825 | }, "length", { value: 8 }).length !== 8;
|
826 | });
|
827 | var TEMPLATE = String(String).split("String");
|
828 | var makeBuiltIn = module2.exports = function(value, name, options) {
|
829 | if (String(name).slice(0, 7) === "Symbol(") {
|
830 | name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
|
831 | }
|
832 | if (options && options.getter)
|
833 | name = "get " + name;
|
834 | if (options && options.setter)
|
835 | name = "set " + name;
|
836 | if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
|
837 | if (DESCRIPTORS)
|
838 | defineProperty(value, "name", { value: name, configurable: true });
|
839 | else
|
840 | value.name = name;
|
841 | }
|
842 | if (CONFIGURABLE_LENGTH && options && hasOwn(options, "arity") && value.length !== options.arity) {
|
843 | defineProperty(value, "length", { value: options.arity });
|
844 | }
|
845 | try {
|
846 | if (options && hasOwn(options, "constructor") && options.constructor) {
|
847 | if (DESCRIPTORS)
|
848 | defineProperty(value, "prototype", { writable: false });
|
849 | } else if (value.prototype)
|
850 | value.prototype = void 0;
|
851 | } catch (error) {
|
852 | }
|
853 | var state = enforceInternalState(value);
|
854 | if (!hasOwn(state, "source")) {
|
855 | state.source = TEMPLATE.join(typeof name == "string" ? name : "");
|
856 | }
|
857 | return value;
|
858 | };
|
859 | Function.prototype.toString = makeBuiltIn(function toString() {
|
860 | return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
861 | }, "toString");
|
862 | }
|
863 | });
|
864 |
|
865 |
|
866 | var require_define_built_in = __commonJS({
|
867 | "node_modules/core-js/internals/define-built-in.js"(exports2, module2) {
|
868 | var isCallable = require_is_callable();
|
869 | var definePropertyModule = require_object_define_property();
|
870 | var makeBuiltIn = require_make_built_in();
|
871 | var defineGlobalProperty = require_define_global_property();
|
872 | module2.exports = function(O, key, value, options) {
|
873 | if (!options)
|
874 | options = {};
|
875 | var simple = options.enumerable;
|
876 | var name = options.name !== void 0 ? options.name : key;
|
877 | if (isCallable(value))
|
878 | makeBuiltIn(value, name, options);
|
879 | if (options.global) {
|
880 | if (simple)
|
881 | O[key] = value;
|
882 | else
|
883 | defineGlobalProperty(key, value);
|
884 | } else {
|
885 | try {
|
886 | if (!options.unsafe)
|
887 | delete O[key];
|
888 | else if (O[key])
|
889 | simple = true;
|
890 | } catch (error) {
|
891 | }
|
892 | if (simple)
|
893 | O[key] = value;
|
894 | else
|
895 | definePropertyModule.f(O, key, {
|
896 | value,
|
897 | enumerable: false,
|
898 | configurable: !options.nonConfigurable,
|
899 | writable: !options.nonWritable
|
900 | });
|
901 | }
|
902 | return O;
|
903 | };
|
904 | }
|
905 | });
|
906 |
|
907 |
|
908 | var require_math_trunc = __commonJS({
|
909 | "node_modules/core-js/internals/math-trunc.js"(exports2, module2) {
|
910 | var ceil = Math.ceil;
|
911 | var floor = Math.floor;
|
912 | module2.exports = Math.trunc || function trunc(x) {
|
913 | var n = +x;
|
914 | return (n > 0 ? floor : ceil)(n);
|
915 | };
|
916 | }
|
917 | });
|
918 |
|
919 |
|
920 | var require_to_integer_or_infinity = __commonJS({
|
921 | "node_modules/core-js/internals/to-integer-or-infinity.js"(exports2, module2) {
|
922 | var trunc = require_math_trunc();
|
923 | module2.exports = function(argument) {
|
924 | var number = +argument;
|
925 | return number !== number || number === 0 ? 0 : trunc(number);
|
926 | };
|
927 | }
|
928 | });
|
929 |
|
930 |
|
931 | var require_to_absolute_index = __commonJS({
|
932 | "node_modules/core-js/internals/to-absolute-index.js"(exports2, module2) {
|
933 | var toIntegerOrInfinity = require_to_integer_or_infinity();
|
934 | var max = Math.max;
|
935 | var min = Math.min;
|
936 | module2.exports = function(index, length) {
|
937 | var integer = toIntegerOrInfinity(index);
|
938 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
939 | };
|
940 | }
|
941 | });
|
942 |
|
943 |
|
944 | var require_to_length = __commonJS({
|
945 | "node_modules/core-js/internals/to-length.js"(exports2, module2) {
|
946 | var toIntegerOrInfinity = require_to_integer_or_infinity();
|
947 | var min = Math.min;
|
948 | module2.exports = function(argument) {
|
949 | return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
|
950 | };
|
951 | }
|
952 | });
|
953 |
|
954 |
|
955 | var require_length_of_array_like = __commonJS({
|
956 | "node_modules/core-js/internals/length-of-array-like.js"(exports2, module2) {
|
957 | var toLength = require_to_length();
|
958 | module2.exports = function(obj) {
|
959 | return toLength(obj.length);
|
960 | };
|
961 | }
|
962 | });
|
963 |
|
964 |
|
965 | var require_array_includes = __commonJS({
|
966 | "node_modules/core-js/internals/array-includes.js"(exports2, module2) {
|
967 | var toIndexedObject = require_to_indexed_object();
|
968 | var toAbsoluteIndex = require_to_absolute_index();
|
969 | var lengthOfArrayLike = require_length_of_array_like();
|
970 | var createMethod = function(IS_INCLUDES) {
|
971 | return function($this, el, fromIndex) {
|
972 | var O = toIndexedObject($this);
|
973 | var length = lengthOfArrayLike(O);
|
974 | var index = toAbsoluteIndex(fromIndex, length);
|
975 | var value;
|
976 | if (IS_INCLUDES && el != el)
|
977 | while (length > index) {
|
978 | value = O[index++];
|
979 | if (value != value)
|
980 | return true;
|
981 | }
|
982 | else
|
983 | for (; length > index; index++) {
|
984 | if ((IS_INCLUDES || index in O) && O[index] === el)
|
985 | return IS_INCLUDES || index || 0;
|
986 | }
|
987 | return !IS_INCLUDES && -1;
|
988 | };
|
989 | };
|
990 | module2.exports = {
|
991 | includes: createMethod(true),
|
992 | indexOf: createMethod(false)
|
993 | };
|
994 | }
|
995 | });
|
996 |
|
997 |
|
998 | var require_object_keys_internal = __commonJS({
|
999 | "node_modules/core-js/internals/object-keys-internal.js"(exports2, module2) {
|
1000 | var uncurryThis = require_function_uncurry_this();
|
1001 | var hasOwn = require_has_own_property();
|
1002 | var toIndexedObject = require_to_indexed_object();
|
1003 | var indexOf = require_array_includes().indexOf;
|
1004 | var hiddenKeys = require_hidden_keys();
|
1005 | var push = uncurryThis([].push);
|
1006 | module2.exports = function(object, names) {
|
1007 | var O = toIndexedObject(object);
|
1008 | var i = 0;
|
1009 | var result = [];
|
1010 | var key;
|
1011 | for (key in O)
|
1012 | !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
1013 | while (names.length > i)
|
1014 | if (hasOwn(O, key = names[i++])) {
|
1015 | ~indexOf(result, key) || push(result, key);
|
1016 | }
|
1017 | return result;
|
1018 | };
|
1019 | }
|
1020 | });
|
1021 |
|
1022 |
|
1023 | var require_enum_bug_keys = __commonJS({
|
1024 | "node_modules/core-js/internals/enum-bug-keys.js"(exports2, module2) {
|
1025 | module2.exports = [
|
1026 | "constructor",
|
1027 | "hasOwnProperty",
|
1028 | "isPrototypeOf",
|
1029 | "propertyIsEnumerable",
|
1030 | "toLocaleString",
|
1031 | "toString",
|
1032 | "valueOf"
|
1033 | ];
|
1034 | }
|
1035 | });
|
1036 |
|
1037 |
|
1038 | var require_object_get_own_property_names = __commonJS({
|
1039 | "node_modules/core-js/internals/object-get-own-property-names.js"(exports2) {
|
1040 | var internalObjectKeys = require_object_keys_internal();
|
1041 | var enumBugKeys = require_enum_bug_keys();
|
1042 | var hiddenKeys = enumBugKeys.concat("length", "prototype");
|
1043 | exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1044 | return internalObjectKeys(O, hiddenKeys);
|
1045 | };
|
1046 | }
|
1047 | });
|
1048 |
|
1049 |
|
1050 | var require_object_get_own_property_symbols = __commonJS({
|
1051 | "node_modules/core-js/internals/object-get-own-property-symbols.js"(exports2) {
|
1052 | exports2.f = Object.getOwnPropertySymbols;
|
1053 | }
|
1054 | });
|
1055 |
|
1056 |
|
1057 | var require_own_keys = __commonJS({
|
1058 | "node_modules/core-js/internals/own-keys.js"(exports2, module2) {
|
1059 | var getBuiltIn = require_get_built_in();
|
1060 | var uncurryThis = require_function_uncurry_this();
|
1061 | var getOwnPropertyNamesModule = require_object_get_own_property_names();
|
1062 | var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
|
1063 | var anObject = require_an_object();
|
1064 | var concat = uncurryThis([].concat);
|
1065 | module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
|
1066 | var keys = getOwnPropertyNamesModule.f(anObject(it));
|
1067 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
1068 | return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
1069 | };
|
1070 | }
|
1071 | });
|
1072 |
|
1073 |
|
1074 | var require_copy_constructor_properties = __commonJS({
|
1075 | "node_modules/core-js/internals/copy-constructor-properties.js"(exports2, module2) {
|
1076 | var hasOwn = require_has_own_property();
|
1077 | var ownKeys = require_own_keys();
|
1078 | var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
|
1079 | var definePropertyModule = require_object_define_property();
|
1080 | module2.exports = function(target, source, exceptions) {
|
1081 | var keys = ownKeys(source);
|
1082 | var defineProperty = definePropertyModule.f;
|
1083 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
1084 | for (var i = 0; i < keys.length; i++) {
|
1085 | var key = keys[i];
|
1086 | if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
1087 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
1088 | }
|
1089 | }
|
1090 | };
|
1091 | }
|
1092 | });
|
1093 |
|
1094 |
|
1095 | var require_is_forced = __commonJS({
|
1096 | "node_modules/core-js/internals/is-forced.js"(exports2, module2) {
|
1097 | var fails = require_fails();
|
1098 | var isCallable = require_is_callable();
|
1099 | var replacement = /#|\.prototype\./;
|
1100 | var isForced = function(feature, detection) {
|
1101 | var value = data[normalize(feature)];
|
1102 | return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
|
1103 | };
|
1104 | var normalize = isForced.normalize = function(string) {
|
1105 | return String(string).replace(replacement, ".").toLowerCase();
|
1106 | };
|
1107 | var data = isForced.data = {};
|
1108 | var NATIVE = isForced.NATIVE = "N";
|
1109 | var POLYFILL = isForced.POLYFILL = "P";
|
1110 | module2.exports = isForced;
|
1111 | }
|
1112 | });
|
1113 |
|
1114 |
|
1115 | var require_export = __commonJS({
|
1116 | "node_modules/core-js/internals/export.js"(exports2, module2) {
|
1117 | var global2 = require_global();
|
1118 | var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
|
1119 | var createNonEnumerableProperty = require_create_non_enumerable_property();
|
1120 | var defineBuiltIn = require_define_built_in();
|
1121 | var defineGlobalProperty = require_define_global_property();
|
1122 | var copyConstructorProperties = require_copy_constructor_properties();
|
1123 | var isForced = require_is_forced();
|
1124 | module2.exports = function(options, source) {
|
1125 | var TARGET = options.target;
|
1126 | var GLOBAL = options.global;
|
1127 | var STATIC = options.stat;
|
1128 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
1129 | if (GLOBAL) {
|
1130 | target = global2;
|
1131 | } else if (STATIC) {
|
1132 | target = global2[TARGET] || defineGlobalProperty(TARGET, {});
|
1133 | } else {
|
1134 | target = (global2[TARGET] || {}).prototype;
|
1135 | }
|
1136 | if (target)
|
1137 | for (key in source) {
|
1138 | sourceProperty = source[key];
|
1139 | if (options.dontCallGetSet) {
|
1140 | descriptor = getOwnPropertyDescriptor(target, key);
|
1141 | targetProperty = descriptor && descriptor.value;
|
1142 | } else
|
1143 | targetProperty = target[key];
|
1144 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
|
1145 | if (!FORCED && targetProperty !== void 0) {
|
1146 | if (typeof sourceProperty == typeof targetProperty)
|
1147 | continue;
|
1148 | copyConstructorProperties(sourceProperty, targetProperty);
|
1149 | }
|
1150 | if (options.sham || targetProperty && targetProperty.sham) {
|
1151 | createNonEnumerableProperty(sourceProperty, "sham", true);
|
1152 | }
|
1153 | defineBuiltIn(target, key, sourceProperty, options);
|
1154 | }
|
1155 | };
|
1156 | }
|
1157 | });
|
1158 |
|
1159 |
|
1160 | var require_function_uncurry_this_clause = __commonJS({
|
1161 | "node_modules/core-js/internals/function-uncurry-this-clause.js"(exports2, module2) {
|
1162 | var classofRaw = require_classof_raw();
|
1163 | var uncurryThis = require_function_uncurry_this();
|
1164 | module2.exports = function(fn) {
|
1165 | if (classofRaw(fn) === "Function")
|
1166 | return uncurryThis(fn);
|
1167 | };
|
1168 | }
|
1169 | });
|
1170 |
|
1171 |
|
1172 | var require_function_bind_context = __commonJS({
|
1173 | "node_modules/core-js/internals/function-bind-context.js"(exports2, module2) {
|
1174 | var uncurryThis = require_function_uncurry_this_clause();
|
1175 | var aCallable = require_a_callable();
|
1176 | var NATIVE_BIND = require_function_bind_native();
|
1177 | var bind = uncurryThis(uncurryThis.bind);
|
1178 | module2.exports = function(fn, that) {
|
1179 | aCallable(fn);
|
1180 | return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
|
1181 | return fn.apply(that, arguments);
|
1182 | };
|
1183 | };
|
1184 | }
|
1185 | });
|
1186 |
|
1187 |
|
1188 | var require_iterators = __commonJS({
|
1189 | "node_modules/core-js/internals/iterators.js"(exports2, module2) {
|
1190 | module2.exports = {};
|
1191 | }
|
1192 | });
|
1193 |
|
1194 |
|
1195 | var require_is_array_iterator_method = __commonJS({
|
1196 | "node_modules/core-js/internals/is-array-iterator-method.js"(exports2, module2) {
|
1197 | var wellKnownSymbol = require_well_known_symbol();
|
1198 | var Iterators = require_iterators();
|
1199 | var ITERATOR = wellKnownSymbol("iterator");
|
1200 | var ArrayPrototype = Array.prototype;
|
1201 | module2.exports = function(it) {
|
1202 | return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
1203 | };
|
1204 | }
|
1205 | });
|
1206 |
|
1207 |
|
1208 | var require_to_string_tag_support = __commonJS({
|
1209 | "node_modules/core-js/internals/to-string-tag-support.js"(exports2, module2) {
|
1210 | var wellKnownSymbol = require_well_known_symbol();
|
1211 | var TO_STRING_TAG = wellKnownSymbol("toStringTag");
|
1212 | var test = {};
|
1213 | test[TO_STRING_TAG] = "z";
|
1214 | module2.exports = String(test) === "[object z]";
|
1215 | }
|
1216 | });
|
1217 |
|
1218 |
|
1219 | var require_classof = __commonJS({
|
1220 | "node_modules/core-js/internals/classof.js"(exports2, module2) {
|
1221 | var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
|
1222 | var isCallable = require_is_callable();
|
1223 | var classofRaw = require_classof_raw();
|
1224 | var wellKnownSymbol = require_well_known_symbol();
|
1225 | var TO_STRING_TAG = wellKnownSymbol("toStringTag");
|
1226 | var $Object = Object;
|
1227 | var CORRECT_ARGUMENTS = classofRaw(function() {
|
1228 | return arguments;
|
1229 | }()) == "Arguments";
|
1230 | var tryGet = function(it, key) {
|
1231 | try {
|
1232 | return it[key];
|
1233 | } catch (error) {
|
1234 | }
|
1235 | };
|
1236 | module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
|
1237 | var O, tag, result;
|
1238 | return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result;
|
1239 | };
|
1240 | }
|
1241 | });
|
1242 |
|
1243 |
|
1244 | var require_get_iterator_method = __commonJS({
|
1245 | "node_modules/core-js/internals/get-iterator-method.js"(exports2, module2) {
|
1246 | var classof = require_classof();
|
1247 | var getMethod = require_get_method();
|
1248 | var isNullOrUndefined = require_is_null_or_undefined();
|
1249 | var Iterators = require_iterators();
|
1250 | var wellKnownSymbol = require_well_known_symbol();
|
1251 | var ITERATOR = wellKnownSymbol("iterator");
|
1252 | module2.exports = function(it) {
|
1253 | if (!isNullOrUndefined(it))
|
1254 | return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];
|
1255 | };
|
1256 | }
|
1257 | });
|
1258 |
|
1259 |
|
1260 | var require_get_iterator = __commonJS({
|
1261 | "node_modules/core-js/internals/get-iterator.js"(exports2, module2) {
|
1262 | var call = require_function_call();
|
1263 | var aCallable = require_a_callable();
|
1264 | var anObject = require_an_object();
|
1265 | var tryToString = require_try_to_string();
|
1266 | var getIteratorMethod = require_get_iterator_method();
|
1267 | var $TypeError = TypeError;
|
1268 | module2.exports = function(argument, usingIterator) {
|
1269 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
1270 | if (aCallable(iteratorMethod))
|
1271 | return anObject(call(iteratorMethod, argument));
|
1272 | throw $TypeError(tryToString(argument) + " is not iterable");
|
1273 | };
|
1274 | }
|
1275 | });
|
1276 |
|
1277 |
|
1278 | var require_iterator_close = __commonJS({
|
1279 | "node_modules/core-js/internals/iterator-close.js"(exports2, module2) {
|
1280 | var call = require_function_call();
|
1281 | var anObject = require_an_object();
|
1282 | var getMethod = require_get_method();
|
1283 | module2.exports = function(iterator, kind, value) {
|
1284 | var innerResult, innerError;
|
1285 | anObject(iterator);
|
1286 | try {
|
1287 | innerResult = getMethod(iterator, "return");
|
1288 | if (!innerResult) {
|
1289 | if (kind === "throw")
|
1290 | throw value;
|
1291 | return value;
|
1292 | }
|
1293 | innerResult = call(innerResult, iterator);
|
1294 | } catch (error) {
|
1295 | innerError = true;
|
1296 | innerResult = error;
|
1297 | }
|
1298 | if (kind === "throw")
|
1299 | throw value;
|
1300 | if (innerError)
|
1301 | throw innerResult;
|
1302 | anObject(innerResult);
|
1303 | return value;
|
1304 | };
|
1305 | }
|
1306 | });
|
1307 |
|
1308 |
|
1309 | var require_iterate = __commonJS({
|
1310 | "node_modules/core-js/internals/iterate.js"(exports2, module2) {
|
1311 | var bind = require_function_bind_context();
|
1312 | var call = require_function_call();
|
1313 | var anObject = require_an_object();
|
1314 | var tryToString = require_try_to_string();
|
1315 | var isArrayIteratorMethod = require_is_array_iterator_method();
|
1316 | var lengthOfArrayLike = require_length_of_array_like();
|
1317 | var isPrototypeOf = require_object_is_prototype_of();
|
1318 | var getIterator = require_get_iterator();
|
1319 | var getIteratorMethod = require_get_iterator_method();
|
1320 | var iteratorClose = require_iterator_close();
|
1321 | var $TypeError = TypeError;
|
1322 | var Result = function(stopped, result) {
|
1323 | this.stopped = stopped;
|
1324 | this.result = result;
|
1325 | };
|
1326 | var ResultPrototype = Result.prototype;
|
1327 | module2.exports = function(iterable, unboundFunction, options) {
|
1328 | var that = options && options.that;
|
1329 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
1330 | var IS_RECORD = !!(options && options.IS_RECORD);
|
1331 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
1332 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
1333 | var fn = bind(unboundFunction, that);
|
1334 | var iterator, iterFn, index, length, result, next, step;
|
1335 | var stop = function(condition) {
|
1336 | if (iterator)
|
1337 | iteratorClose(iterator, "normal", condition);
|
1338 | return new Result(true, condition);
|
1339 | };
|
1340 | var callFn = function(value) {
|
1341 | if (AS_ENTRIES) {
|
1342 | anObject(value);
|
1343 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
1344 | }
|
1345 | return INTERRUPTED ? fn(value, stop) : fn(value);
|
1346 | };
|
1347 | if (IS_RECORD) {
|
1348 | iterator = iterable.iterator;
|
1349 | } else if (IS_ITERATOR) {
|
1350 | iterator = iterable;
|
1351 | } else {
|
1352 | iterFn = getIteratorMethod(iterable);
|
1353 | if (!iterFn)
|
1354 | throw $TypeError(tryToString(iterable) + " is not iterable");
|
1355 | if (isArrayIteratorMethod(iterFn)) {
|
1356 | for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
1357 | result = callFn(iterable[index]);
|
1358 | if (result && isPrototypeOf(ResultPrototype, result))
|
1359 | return result;
|
1360 | }
|
1361 | return new Result(false);
|
1362 | }
|
1363 | iterator = getIterator(iterable, iterFn);
|
1364 | }
|
1365 | next = IS_RECORD ? iterable.next : iterator.next;
|
1366 | while (!(step = call(next, iterator)).done) {
|
1367 | try {
|
1368 | result = callFn(step.value);
|
1369 | } catch (error) {
|
1370 | iteratorClose(iterator, "throw", error);
|
1371 | }
|
1372 | if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
|
1373 | return result;
|
1374 | }
|
1375 | return new Result(false);
|
1376 | };
|
1377 | }
|
1378 | });
|
1379 |
|
1380 |
|
1381 | var require_create_property = __commonJS({
|
1382 | "node_modules/core-js/internals/create-property.js"(exports2, module2) {
|
1383 | "use strict";
|
1384 | var toPropertyKey = require_to_property_key();
|
1385 | var definePropertyModule = require_object_define_property();
|
1386 | var createPropertyDescriptor = require_create_property_descriptor();
|
1387 | module2.exports = function(object, key, value) {
|
1388 | var propertyKey = toPropertyKey(key);
|
1389 | if (propertyKey in object)
|
1390 | definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
1391 | else
|
1392 | object[propertyKey] = value;
|
1393 | };
|
1394 | }
|
1395 | });
|
1396 |
|
1397 |
|
1398 | var require_es_object_from_entries = __commonJS({
|
1399 | "node_modules/core-js/modules/es.object.from-entries.js"() {
|
1400 | var $ = require_export();
|
1401 | var iterate = require_iterate();
|
1402 | var createProperty = require_create_property();
|
1403 | $({ target: "Object", stat: true }, {
|
1404 | fromEntries: function fromEntries(iterable) {
|
1405 | var obj = {};
|
1406 | iterate(iterable, function(k, v) {
|
1407 | createProperty(obj, k, v);
|
1408 | }, { AS_ENTRIES: true });
|
1409 | return obj;
|
1410 | }
|
1411 | });
|
1412 | }
|
1413 | });
|
1414 |
|
1415 |
|
1416 | var require_is_array = __commonJS({
|
1417 | "node_modules/core-js/internals/is-array.js"(exports2, module2) {
|
1418 | var classof = require_classof_raw();
|
1419 | module2.exports = Array.isArray || function isArray(argument) {
|
1420 | return classof(argument) == "Array";
|
1421 | };
|
1422 | }
|
1423 | });
|
1424 |
|
1425 |
|
1426 | var require_does_not_exceed_safe_integer = __commonJS({
|
1427 | "node_modules/core-js/internals/does-not-exceed-safe-integer.js"(exports2, module2) {
|
1428 | var $TypeError = TypeError;
|
1429 | var MAX_SAFE_INTEGER = 9007199254740991;
|
1430 | module2.exports = function(it) {
|
1431 | if (it > MAX_SAFE_INTEGER)
|
1432 | throw $TypeError("Maximum allowed index exceeded");
|
1433 | return it;
|
1434 | };
|
1435 | }
|
1436 | });
|
1437 |
|
1438 |
|
1439 | var require_flatten_into_array = __commonJS({
|
1440 | "node_modules/core-js/internals/flatten-into-array.js"(exports2, module2) {
|
1441 | "use strict";
|
1442 | var isArray = require_is_array();
|
1443 | var lengthOfArrayLike = require_length_of_array_like();
|
1444 | var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
|
1445 | var bind = require_function_bind_context();
|
1446 | var flattenIntoArray = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
|
1447 | var targetIndex = start;
|
1448 | var sourceIndex = 0;
|
1449 | var mapFn = mapper ? bind(mapper, thisArg) : false;
|
1450 | var element, elementLen;
|
1451 | while (sourceIndex < sourceLen) {
|
1452 | if (sourceIndex in source) {
|
1453 | element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
1454 | if (depth > 0 && isArray(element)) {
|
1455 | elementLen = lengthOfArrayLike(element);
|
1456 | targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
|
1457 | } else {
|
1458 | doesNotExceedSafeInteger(targetIndex + 1);
|
1459 | target[targetIndex] = element;
|
1460 | }
|
1461 | targetIndex++;
|
1462 | }
|
1463 | sourceIndex++;
|
1464 | }
|
1465 | return targetIndex;
|
1466 | };
|
1467 | module2.exports = flattenIntoArray;
|
1468 | }
|
1469 | });
|
1470 |
|
1471 |
|
1472 | var require_is_constructor = __commonJS({
|
1473 | "node_modules/core-js/internals/is-constructor.js"(exports2, module2) {
|
1474 | var uncurryThis = require_function_uncurry_this();
|
1475 | var fails = require_fails();
|
1476 | var isCallable = require_is_callable();
|
1477 | var classof = require_classof();
|
1478 | var getBuiltIn = require_get_built_in();
|
1479 | var inspectSource = require_inspect_source();
|
1480 | var noop = function() {
|
1481 | };
|
1482 | var empty = [];
|
1483 | var construct = getBuiltIn("Reflect", "construct");
|
1484 | var constructorRegExp = /^\s*(?:class|function)\b/;
|
1485 | var exec = uncurryThis(constructorRegExp.exec);
|
1486 | var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
1487 | var isConstructorModern = function isConstructor(argument) {
|
1488 | if (!isCallable(argument))
|
1489 | return false;
|
1490 | try {
|
1491 | construct(noop, empty, argument);
|
1492 | return true;
|
1493 | } catch (error) {
|
1494 | return false;
|
1495 | }
|
1496 | };
|
1497 | var isConstructorLegacy = function isConstructor(argument) {
|
1498 | if (!isCallable(argument))
|
1499 | return false;
|
1500 | switch (classof(argument)) {
|
1501 | case "AsyncFunction":
|
1502 | case "GeneratorFunction":
|
1503 | case "AsyncGeneratorFunction":
|
1504 | return false;
|
1505 | }
|
1506 | try {
|
1507 | return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
1508 | } catch (error) {
|
1509 | return true;
|
1510 | }
|
1511 | };
|
1512 | isConstructorLegacy.sham = true;
|
1513 | module2.exports = !construct || fails(function() {
|
1514 | var called;
|
1515 | return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
|
1516 | called = true;
|
1517 | }) || called;
|
1518 | }) ? isConstructorLegacy : isConstructorModern;
|
1519 | }
|
1520 | });
|
1521 |
|
1522 |
|
1523 | var require_array_species_constructor = __commonJS({
|
1524 | "node_modules/core-js/internals/array-species-constructor.js"(exports2, module2) {
|
1525 | var isArray = require_is_array();
|
1526 | var isConstructor = require_is_constructor();
|
1527 | var isObject = require_is_object();
|
1528 | var wellKnownSymbol = require_well_known_symbol();
|
1529 | var SPECIES = wellKnownSymbol("species");
|
1530 | var $Array = Array;
|
1531 | module2.exports = function(originalArray) {
|
1532 | var C;
|
1533 | if (isArray(originalArray)) {
|
1534 | C = originalArray.constructor;
|
1535 | if (isConstructor(C) && (C === $Array || isArray(C.prototype)))
|
1536 | C = void 0;
|
1537 | else if (isObject(C)) {
|
1538 | C = C[SPECIES];
|
1539 | if (C === null)
|
1540 | C = void 0;
|
1541 | }
|
1542 | }
|
1543 | return C === void 0 ? $Array : C;
|
1544 | };
|
1545 | }
|
1546 | });
|
1547 |
|
1548 |
|
1549 | var require_array_species_create = __commonJS({
|
1550 | "node_modules/core-js/internals/array-species-create.js"(exports2, module2) {
|
1551 | var arraySpeciesConstructor = require_array_species_constructor();
|
1552 | module2.exports = function(originalArray, length) {
|
1553 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
1554 | };
|
1555 | }
|
1556 | });
|
1557 |
|
1558 |
|
1559 | var require_es_array_flat_map = __commonJS({
|
1560 | "node_modules/core-js/modules/es.array.flat-map.js"() {
|
1561 | "use strict";
|
1562 | var $ = require_export();
|
1563 | var flattenIntoArray = require_flatten_into_array();
|
1564 | var aCallable = require_a_callable();
|
1565 | var toObject = require_to_object();
|
1566 | var lengthOfArrayLike = require_length_of_array_like();
|
1567 | var arraySpeciesCreate = require_array_species_create();
|
1568 | $({ target: "Array", proto: true }, {
|
1569 | flatMap: function flatMap(callbackfn) {
|
1570 | var O = toObject(this);
|
1571 | var sourceLen = lengthOfArrayLike(O);
|
1572 | var A;
|
1573 | aCallable(callbackfn);
|
1574 | A = arraySpeciesCreate(O, 0);
|
1575 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
|
1576 | return A;
|
1577 | }
|
1578 | });
|
1579 | }
|
1580 | });
|
1581 |
|
1582 |
|
1583 | var require_es_array_flat = __commonJS({
|
1584 | "node_modules/core-js/modules/es.array.flat.js"() {
|
1585 | "use strict";
|
1586 | var $ = require_export();
|
1587 | var flattenIntoArray = require_flatten_into_array();
|
1588 | var toObject = require_to_object();
|
1589 | var lengthOfArrayLike = require_length_of_array_like();
|
1590 | var toIntegerOrInfinity = require_to_integer_or_infinity();
|
1591 | var arraySpeciesCreate = require_array_species_create();
|
1592 | $({ target: "Array", proto: true }, {
|
1593 | flat: function flat() {
|
1594 | var depthArg = arguments.length ? arguments[0] : void 0;
|
1595 | var O = toObject(this);
|
1596 | var sourceLen = lengthOfArrayLike(O);
|
1597 | var A = arraySpeciesCreate(O, 0);
|
1598 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity(depthArg));
|
1599 | return A;
|
1600 | }
|
1601 | });
|
1602 | }
|
1603 | });
|
1604 |
|
1605 |
|
1606 | var require_define_built_in_accessor = __commonJS({
|
1607 | "node_modules/core-js/internals/define-built-in-accessor.js"(exports2, module2) {
|
1608 | var makeBuiltIn = require_make_built_in();
|
1609 | var defineProperty = require_object_define_property();
|
1610 | module2.exports = function(target, name, descriptor) {
|
1611 | if (descriptor.get)
|
1612 | makeBuiltIn(descriptor.get, name, { getter: true });
|
1613 | if (descriptor.set)
|
1614 | makeBuiltIn(descriptor.set, name, { setter: true });
|
1615 | return defineProperty.f(target, name, descriptor);
|
1616 | };
|
1617 | }
|
1618 | });
|
1619 |
|
1620 |
|
1621 | var require_regexp_flags = __commonJS({
|
1622 | "node_modules/core-js/internals/regexp-flags.js"(exports2, module2) {
|
1623 | "use strict";
|
1624 | var anObject = require_an_object();
|
1625 | module2.exports = function() {
|
1626 | var that = anObject(this);
|
1627 | var result = "";
|
1628 | if (that.hasIndices)
|
1629 | result += "d";
|
1630 | if (that.global)
|
1631 | result += "g";
|
1632 | if (that.ignoreCase)
|
1633 | result += "i";
|
1634 | if (that.multiline)
|
1635 | result += "m";
|
1636 | if (that.dotAll)
|
1637 | result += "s";
|
1638 | if (that.unicode)
|
1639 | result += "u";
|
1640 | if (that.unicodeSets)
|
1641 | result += "v";
|
1642 | if (that.sticky)
|
1643 | result += "y";
|
1644 | return result;
|
1645 | };
|
1646 | }
|
1647 | });
|
1648 |
|
1649 |
|
1650 | var require_es_regexp_flags = __commonJS({
|
1651 | "node_modules/core-js/modules/es.regexp.flags.js"() {
|
1652 | var global2 = require_global();
|
1653 | var DESCRIPTORS = require_descriptors();
|
1654 | var defineBuiltInAccessor = require_define_built_in_accessor();
|
1655 | var regExpFlags = require_regexp_flags();
|
1656 | var fails = require_fails();
|
1657 | var RegExp2 = global2.RegExp;
|
1658 | var RegExpPrototype = RegExp2.prototype;
|
1659 | var FORCED = DESCRIPTORS && fails(function() {
|
1660 | var INDICES_SUPPORT = true;
|
1661 | try {
|
1662 | RegExp2(".", "d");
|
1663 | } catch (error) {
|
1664 | INDICES_SUPPORT = false;
|
1665 | }
|
1666 | var O = {};
|
1667 | var calls = "";
|
1668 | var expected = INDICES_SUPPORT ? "dgimsy" : "gimsy";
|
1669 | var addGetter = function(key2, chr) {
|
1670 | Object.defineProperty(O, key2, { get: function() {
|
1671 | calls += chr;
|
1672 | return true;
|
1673 | } });
|
1674 | };
|
1675 | var pairs = {
|
1676 | dotAll: "s",
|
1677 | global: "g",
|
1678 | ignoreCase: "i",
|
1679 | multiline: "m",
|
1680 | sticky: "y"
|
1681 | };
|
1682 | if (INDICES_SUPPORT)
|
1683 | pairs.hasIndices = "d";
|
1684 | for (var key in pairs)
|
1685 | addGetter(key, pairs[key]);
|
1686 | var result = Object.getOwnPropertyDescriptor(RegExpPrototype, "flags").get.call(O);
|
1687 | return result !== expected || calls !== expected;
|
1688 | });
|
1689 | if (FORCED)
|
1690 | defineBuiltInAccessor(RegExpPrototype, "flags", {
|
1691 | configurable: true,
|
1692 | get: regExpFlags
|
1693 | });
|
1694 | }
|
1695 | });
|
1696 |
|
1697 | // dist/_cli.js.cjs.js
|
1698 | require_es_object_from_entries();
|
1699 | require_es_array_flat_map();
|
1700 | require_es_array_flat();
|
1701 | require_es_regexp_flags();
|
1702 | var __create = Object.create;
|
1703 | var __defProp = Object.defineProperty;
|
1704 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
1705 | var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
1706 | var __getProtoOf = Object.getPrototypeOf;
|
1707 | var __hasOwnProp = Object.prototype.hasOwnProperty;
|
1708 | var __esm = (fn, res) => function __init() {
|
1709 | return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
|
1710 | };
|
1711 | var __commonJS2 = (cb, mod) => function __require() {
|
1712 | return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = {
|
1713 | exports: {}
|
1714 | }).exports, mod), mod.exports;
|
1715 | };
|
1716 | var __export = (target, all) => {
|
1717 | for (var name in all)
|
1718 | __defProp(target, name, {
|
1719 | get: all[name],
|
1720 | enumerable: true
|
1721 | });
|
1722 | };
|
1723 | var __copyProps = (to, from, except, desc) => {
|
1724 | if (from && typeof from === "object" || typeof from === "function") {
|
1725 | for (let key of __getOwnPropNames2(from))
|
1726 | if (!__hasOwnProp.call(to, key) && key !== except)
|
1727 | __defProp(to, key, {
|
1728 | get: () => from[key],
|
1729 | enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
1730 | });
|
1731 | }
|
1732 | return to;
|
1733 | };
|
1734 | var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
1735 | value: mod,
|
1736 | enumerable: true
|
1737 | }) : target, mod));
|
1738 | var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", {
|
1739 | value: true
|
1740 | }), mod);
|
1741 | var require_fast_json_stable_stringify = __commonJS2({
|
1742 | "node_modules/fast-json-stable-stringify/index.js"(exports2, module2) {
|
1743 | "use strict";
|
1744 | module2.exports = function(data, opts) {
|
1745 | if (!opts)
|
1746 | opts = {};
|
1747 | if (typeof opts === "function")
|
1748 | opts = {
|
1749 | cmp: opts
|
1750 | };
|
1751 | var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
|
1752 | var cmp = opts.cmp && function(f) {
|
1753 | return function(node) {
|
1754 | return function(a, b) {
|
1755 | var aobj = {
|
1756 | key: a,
|
1757 | value: node[a]
|
1758 | };
|
1759 | var bobj = {
|
1760 | key: b,
|
1761 | value: node[b]
|
1762 | };
|
1763 | return f(aobj, bobj);
|
1764 | };
|
1765 | };
|
1766 | }(opts.cmp);
|
1767 | var seen = [];
|
1768 | return function stringify2(node) {
|
1769 | if (node && node.toJSON && typeof node.toJSON === "function") {
|
1770 | node = node.toJSON();
|
1771 | }
|
1772 | if (node === void 0)
|
1773 | return;
|
1774 | if (typeof node == "number")
|
1775 | return isFinite(node) ? "" + node : "null";
|
1776 | if (typeof node !== "object")
|
1777 | return JSON.stringify(node);
|
1778 | var i, out;
|
1779 | if (Array.isArray(node)) {
|
1780 | out = "[";
|
1781 | for (i = 0; i < node.length; i++) {
|
1782 | if (i)
|
1783 | out += ",";
|
1784 | out += stringify2(node[i]) || "null";
|
1785 | }
|
1786 | return out + "]";
|
1787 | }
|
1788 | if (node === null)
|
1789 | return "null";
|
1790 | if (seen.indexOf(node) !== -1) {
|
1791 | if (cycles)
|
1792 | return JSON.stringify("__cycle__");
|
1793 | throw new TypeError("Converting circular structure to JSON");
|
1794 | }
|
1795 | var seenIndex = seen.push(node) - 1;
|
1796 | var keys = Object.keys(node).sort(cmp && cmp(node));
|
1797 | out = "";
|
1798 | for (i = 0; i < keys.length; i++) {
|
1799 | var key = keys[i];
|
1800 | var value = stringify2(node[key]);
|
1801 | if (!value)
|
1802 | continue;
|
1803 | if (out)
|
1804 | out += ",";
|
1805 | out += JSON.stringify(key) + ":" + value;
|
1806 | }
|
1807 | seen.splice(seenIndex, 1);
|
1808 | return "{" + out + "}";
|
1809 | }(data);
|
1810 | };
|
1811 | }
|
1812 | });
|
1813 | var require_clone = __commonJS2({
|
1814 | "node_modules/clone/clone.js"(exports2, module2) {
|
1815 | var clone = function() {
|
1816 | "use strict";
|
1817 | function clone2(parent, circular, depth, prototype) {
|
1818 | var filter;
|
1819 | if (typeof circular === "object") {
|
1820 | depth = circular.depth;
|
1821 | prototype = circular.prototype;
|
1822 | filter = circular.filter;
|
1823 | circular = circular.circular;
|
1824 | }
|
1825 | var allParents = [];
|
1826 | var allChildren = [];
|
1827 | var useBuffer = typeof Buffer != "undefined";
|
1828 | if (typeof circular == "undefined")
|
1829 | circular = true;
|
1830 | if (typeof depth == "undefined")
|
1831 | depth = Infinity;
|
1832 | function _clone(parent2, depth2) {
|
1833 | if (parent2 === null)
|
1834 | return null;
|
1835 | if (depth2 == 0)
|
1836 | return parent2;
|
1837 | var child;
|
1838 | var proto2;
|
1839 | if (typeof parent2 != "object") {
|
1840 | return parent2;
|
1841 | }
|
1842 | if (clone2.__isArray(parent2)) {
|
1843 | child = [];
|
1844 | } else if (clone2.__isRegExp(parent2)) {
|
1845 | child = new RegExp(parent2.source, __getRegExpFlags(parent2));
|
1846 | if (parent2.lastIndex)
|
1847 | child.lastIndex = parent2.lastIndex;
|
1848 | } else if (clone2.__isDate(parent2)) {
|
1849 | child = new Date(parent2.getTime());
|
1850 | } else if (useBuffer && Buffer.isBuffer(parent2)) {
|
1851 | if (Buffer.allocUnsafe) {
|
1852 | child = Buffer.allocUnsafe(parent2.length);
|
1853 | } else {
|
1854 | child = new Buffer(parent2.length);
|
1855 | }
|
1856 | parent2.copy(child);
|
1857 | return child;
|
1858 | } else {
|
1859 | if (typeof prototype == "undefined") {
|
1860 | proto2 = Object.getPrototypeOf(parent2);
|
1861 | child = Object.create(proto2);
|
1862 | } else {
|
1863 | child = Object.create(prototype);
|
1864 | proto2 = prototype;
|
1865 | }
|
1866 | }
|
1867 | if (circular) {
|
1868 | var index = allParents.indexOf(parent2);
|
1869 | if (index != -1) {
|
1870 | return allChildren[index];
|
1871 | }
|
1872 | allParents.push(parent2);
|
1873 | allChildren.push(child);
|
1874 | }
|
1875 | for (var i in parent2) {
|
1876 | var attrs;
|
1877 | if (proto2) {
|
1878 | attrs = Object.getOwnPropertyDescriptor(proto2, i);
|
1879 | }
|
1880 | if (attrs && attrs.set == null) {
|
1881 | continue;
|
1882 | }
|
1883 | child[i] = _clone(parent2[i], depth2 - 1);
|
1884 | }
|
1885 | return child;
|
1886 | }
|
1887 | return _clone(parent, depth);
|
1888 | }
|
1889 | clone2.clonePrototype = function clonePrototype(parent) {
|
1890 | if (parent === null)
|
1891 | return null;
|
1892 | var c = function() {
|
1893 | };
|
1894 | c.prototype = parent;
|
1895 | return new c();
|
1896 | };
|
1897 | function __objToStr(o) {
|
1898 | return Object.prototype.toString.call(o);
|
1899 | }
|
1900 | ;
|
1901 | clone2.__objToStr = __objToStr;
|
1902 | function __isDate(o) {
|
1903 | return typeof o === "object" && __objToStr(o) === "[object Date]";
|
1904 | }
|
1905 | ;
|
1906 | clone2.__isDate = __isDate;
|
1907 | function __isArray(o) {
|
1908 | return typeof o === "object" && __objToStr(o) === "[object Array]";
|
1909 | }
|
1910 | ;
|
1911 | clone2.__isArray = __isArray;
|
1912 | function __isRegExp(o) {
|
1913 | return typeof o === "object" && __objToStr(o) === "[object RegExp]";
|
1914 | }
|
1915 | ;
|
1916 | clone2.__isRegExp = __isRegExp;
|
1917 | function __getRegExpFlags(re) {
|
1918 | var flags = "";
|
1919 | if (re.global)
|
1920 | flags += "g";
|
1921 | if (re.ignoreCase)
|
1922 | flags += "i";
|
1923 | if (re.multiline)
|
1924 | flags += "m";
|
1925 | return flags;
|
1926 | }
|
1927 | ;
|
1928 | clone2.__getRegExpFlags = __getRegExpFlags;
|
1929 | return clone2;
|
1930 | }();
|
1931 | if (typeof module2 === "object" && module2.exports) {
|
1932 | module2.exports = clone;
|
1933 | }
|
1934 | }
|
1935 | });
|
1936 | var require_defaults = __commonJS2({
|
1937 | "node_modules/defaults/index.js"(exports2, module2) {
|
1938 | var clone = require_clone();
|
1939 | module2.exports = function(options, defaults) {
|
1940 | options = options || {};
|
1941 | Object.keys(defaults).forEach(function(key) {
|
1942 | if (typeof options[key] === "undefined") {
|
1943 | options[key] = clone(defaults[key]);
|
1944 | }
|
1945 | });
|
1946 | return options;
|
1947 | };
|
1948 | }
|
1949 | });
|
1950 | var require_combining = __commonJS2({
|
1951 | "node_modules/wcwidth/combining.js"(exports2, module2) {
|
1952 | module2.exports = [[768, 879], [1155, 1158], [1160, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1539], [1552, 1557], [1611, 1630], [1648, 1648], [1750, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2305, 2306], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2388], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2672, 2673], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2883], [2893, 2893], [2902, 2902], [2946, 2946], [3008, 3008], [3021, 3021], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3393, 3395], [3405, 3405], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3769], [3771, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3984, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4146], [4150, 4151], [4153, 4153], [4184, 4185], [4448, 4607], [4959, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6157], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7616, 7626], [7678, 7679], [8203, 8207], [8234, 8238], [8288, 8291], [8298, 8303], [8400, 8431], [12330, 12335], [12441, 12442], [43014, 43014], [43019, 43019], [43045, 43046], [64286, 64286], [65024, 65039], [65056, 65059], [65279, 65279], [65529, 65531], [68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [917505, 917505], [917536, 917631], [917760, 917999]];
|
1953 | }
|
1954 | });
|
1955 | var require_wcwidth = __commonJS2({
|
1956 | "node_modules/wcwidth/index.js"(exports2, module2) {
|
1957 | "use strict";
|
1958 | var defaults = require_defaults();
|
1959 | var combining = require_combining();
|
1960 | var DEFAULTS = {
|
1961 | nul: 0,
|
1962 | control: 0
|
1963 | };
|
1964 | module2.exports = function wcwidth2(str) {
|
1965 | return wcswidth(str, DEFAULTS);
|
1966 | };
|
1967 | module2.exports.config = function(opts) {
|
1968 | opts = defaults(opts || {}, DEFAULTS);
|
1969 | return function wcwidth2(str) {
|
1970 | return wcswidth(str, opts);
|
1971 | };
|
1972 | };
|
1973 | function wcswidth(str, opts) {
|
1974 | if (typeof str !== "string")
|
1975 | return wcwidth(str, opts);
|
1976 | var s = 0;
|
1977 | for (var i = 0; i < str.length; i++) {
|
1978 | var n = wcwidth(str.charCodeAt(i), opts);
|
1979 | if (n < 0)
|
1980 | return -1;
|
1981 | s += n;
|
1982 | }
|
1983 | return s;
|
1984 | }
|
1985 | function wcwidth(ucs, opts) {
|
1986 | if (ucs === 0)
|
1987 | return opts.nul;
|
1988 | if (ucs < 32 || ucs >= 127 && ucs < 160)
|
1989 | return opts.control;
|
1990 | if (bisearch(ucs))
|
1991 | return 0;
|
1992 | return 1 + (ucs >= 4352 && (ucs <= 4447 || ucs == 9001 || ucs == 9002 || ucs >= 11904 && ucs <= 42191 && ucs != 12351 || ucs >= 44032 && ucs <= 55203 || ucs >= 63744 && ucs <= 64255 || ucs >= 65040 && ucs <= 65049 || ucs >= 65072 && ucs <= 65135 || ucs >= 65280 && ucs <= 65376 || ucs >= 65504 && ucs <= 65510 || ucs >= 131072 && ucs <= 196605 || ucs >= 196608 && ucs <= 262141));
|
1993 | }
|
1994 | function bisearch(ucs) {
|
1995 | var min = 0;
|
1996 | var max = combining.length - 1;
|
1997 | var mid;
|
1998 | if (ucs < combining[0][0] || ucs > combining[max][1])
|
1999 | return false;
|
2000 | while (max >= min) {
|
2001 | mid = Math.floor((min + max) / 2);
|
2002 | if (ucs > combining[mid][1])
|
2003 | min = mid + 1;
|
2004 | else if (ucs < combining[mid][0])
|
2005 | max = mid - 1;
|
2006 | else
|
2007 | return true;
|
2008 | }
|
2009 | return false;
|
2010 | }
|
2011 | }
|
2012 | });
|
2013 | function ansiRegex({
|
2014 | onlyFirst = false
|
2015 | } = {}) {
|
2016 | const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
2017 | return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
2018 | }
|
2019 | var init_ansi_regex = __esm({
|
2020 | "node_modules/strip-ansi/node_modules/ansi-regex/index.js"() {
|
2021 | }
|
2022 | });
|
2023 | var strip_ansi_exports = {};
|
2024 | __export(strip_ansi_exports, {
|
2025 | default: () => stripAnsi
|
2026 | });
|
2027 | function stripAnsi(string) {
|
2028 | if (typeof string !== "string") {
|
2029 | throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
2030 | }
|
2031 | return string.replace(ansiRegex(), "");
|
2032 | }
|
2033 | var init_strip_ansi = __esm({
|
2034 | "node_modules/strip-ansi/index.js"() {
|
2035 | init_ansi_regex();
|
2036 | }
|
2037 | });
|
2038 | function assembleStyles() {
|
2039 | const codes = new Map();
|
2040 | const styles2 = {
|
2041 | modifier: {
|
2042 | reset: [0, 0],
|
2043 | bold: [1, 22],
|
2044 | dim: [2, 22],
|
2045 | italic: [3, 23],
|
2046 | underline: [4, 24],
|
2047 | overline: [53, 55],
|
2048 | inverse: [7, 27],
|
2049 | hidden: [8, 28],
|
2050 | strikethrough: [9, 29]
|
2051 | },
|
2052 | color: {
|
2053 | black: [30, 39],
|
2054 | red: [31, 39],
|
2055 | green: [32, 39],
|
2056 | yellow: [33, 39],
|
2057 | blue: [34, 39],
|
2058 | magenta: [35, 39],
|
2059 | cyan: [36, 39],
|
2060 | white: [37, 39],
|
2061 | blackBright: [90, 39],
|
2062 | redBright: [91, 39],
|
2063 | greenBright: [92, 39],
|
2064 | yellowBright: [93, 39],
|
2065 | blueBright: [94, 39],
|
2066 | magentaBright: [95, 39],
|
2067 | cyanBright: [96, 39],
|
2068 | whiteBright: [97, 39]
|
2069 | },
|
2070 | bgColor: {
|
2071 | bgBlack: [40, 49],
|
2072 | bgRed: [41, 49],
|
2073 | bgGreen: [42, 49],
|
2074 | bgYellow: [43, 49],
|
2075 | bgBlue: [44, 49],
|
2076 | bgMagenta: [45, 49],
|
2077 | bgCyan: [46, 49],
|
2078 | bgWhite: [47, 49],
|
2079 | bgBlackBright: [100, 49],
|
2080 | bgRedBright: [101, 49],
|
2081 | bgGreenBright: [102, 49],
|
2082 | bgYellowBright: [103, 49],
|
2083 | bgBlueBright: [104, 49],
|
2084 | bgMagentaBright: [105, 49],
|
2085 | bgCyanBright: [106, 49],
|
2086 | bgWhiteBright: [107, 49]
|
2087 | }
|
2088 | };
|
2089 | styles2.color.gray = styles2.color.blackBright;
|
2090 | styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
2091 | styles2.color.grey = styles2.color.blackBright;
|
2092 | styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
2093 | for (const [groupName, group] of Object.entries(styles2)) {
|
2094 | for (const [styleName, style] of Object.entries(group)) {
|
2095 | styles2[styleName] = {
|
2096 | open: `\x1B[${style[0]}m`,
|
2097 | close: `\x1B[${style[1]}m`
|
2098 | };
|
2099 | group[styleName] = styles2[styleName];
|
2100 | codes.set(style[0], style[1]);
|
2101 | }
|
2102 | Object.defineProperty(styles2, groupName, {
|
2103 | value: group,
|
2104 | enumerable: false
|
2105 | });
|
2106 | }
|
2107 | Object.defineProperty(styles2, "codes", {
|
2108 | value: codes,
|
2109 | enumerable: false
|
2110 | });
|
2111 | styles2.color.close = "\x1B[39m";
|
2112 | styles2.bgColor.close = "\x1B[49m";
|
2113 | styles2.color.ansi = wrapAnsi16();
|
2114 | styles2.color.ansi256 = wrapAnsi256();
|
2115 | styles2.color.ansi16m = wrapAnsi16m();
|
2116 | styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
2117 | styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
2118 | styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
2119 | Object.defineProperties(styles2, {
|
2120 | rgbToAnsi256: {
|
2121 | value: (red, green, blue) => {
|
2122 | if (red === green && green === blue) {
|
2123 | if (red < 8) {
|
2124 | return 16;
|
2125 | }
|
2126 | if (red > 248) {
|
2127 | return 231;
|
2128 | }
|
2129 | return Math.round((red - 8) / 247 * 24) + 232;
|
2130 | }
|
2131 | return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
2132 | },
|
2133 | enumerable: false
|
2134 | },
|
2135 | hexToRgb: {
|
2136 | value: (hex) => {
|
2137 | const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
2138 | if (!matches) {
|
2139 | return [0, 0, 0];
|
2140 | }
|
2141 | let {
|
2142 | colorString
|
2143 | } = matches.groups;
|
2144 | if (colorString.length === 3) {
|
2145 | colorString = [...colorString].map((character) => character + character).join("");
|
2146 | }
|
2147 | const integer = Number.parseInt(colorString, 16);
|
2148 | return [integer >> 16 & 255, integer >> 8 & 255, integer & 255];
|
2149 | },
|
2150 | enumerable: false
|
2151 | },
|
2152 | hexToAnsi256: {
|
2153 | value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
|
2154 | enumerable: false
|
2155 | },
|
2156 | ansi256ToAnsi: {
|
2157 | value: (code) => {
|
2158 | if (code < 8) {
|
2159 | return 30 + code;
|
2160 | }
|
2161 | if (code < 16) {
|
2162 | return 90 + (code - 8);
|
2163 | }
|
2164 | let red;
|
2165 | let green;
|
2166 | let blue;
|
2167 | if (code >= 232) {
|
2168 | red = ((code - 232) * 10 + 8) / 255;
|
2169 | green = red;
|
2170 | blue = red;
|
2171 | } else {
|
2172 | code -= 16;
|
2173 | const remainder = code % 36;
|
2174 | red = Math.floor(code / 36) / 5;
|
2175 | green = Math.floor(remainder / 6) / 5;
|
2176 | blue = remainder % 6 / 5;
|
2177 | }
|
2178 | const value = Math.max(red, green, blue) * 2;
|
2179 | if (value === 0) {
|
2180 | return 30;
|
2181 | }
|
2182 | let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
2183 | if (value === 2) {
|
2184 | result += 60;
|
2185 | }
|
2186 | return result;
|
2187 | },
|
2188 | enumerable: false
|
2189 | },
|
2190 | rgbToAnsi: {
|
2191 | value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
|
2192 | enumerable: false
|
2193 | },
|
2194 | hexToAnsi: {
|
2195 | value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
|
2196 | enumerable: false
|
2197 | }
|
2198 | });
|
2199 | return styles2;
|
2200 | }
|
2201 | var ANSI_BACKGROUND_OFFSET;
|
2202 | var wrapAnsi16;
|
2203 | var wrapAnsi256;
|
2204 | var wrapAnsi16m;
|
2205 | var ansiStyles;
|
2206 | var ansi_styles_default;
|
2207 | var init_ansi_styles = __esm({
|
2208 | "node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
2209 | ANSI_BACKGROUND_OFFSET = 10;
|
2210 | wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
2211 | wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
2212 | wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
2213 | ansiStyles = assembleStyles();
|
2214 | ansi_styles_default = ansiStyles;
|
2215 | }
|
2216 | });
|
2217 | function hasFlag(flag, argv = import_node_process.default.argv) {
|
2218 | const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
2219 | const position = argv.indexOf(prefix + flag);
|
2220 | const terminatorPosition = argv.indexOf("--");
|
2221 | return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
2222 | }
|
2223 | function envForceColor() {
|
2224 | if ("FORCE_COLOR" in env) {
|
2225 | if (env.FORCE_COLOR === "true") {
|
2226 | return 1;
|
2227 | }
|
2228 | if (env.FORCE_COLOR === "false") {
|
2229 | return 0;
|
2230 | }
|
2231 | return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
2232 | }
|
2233 | }
|
2234 | function translateLevel(level) {
|
2235 | if (level === 0) {
|
2236 | return false;
|
2237 | }
|
2238 | return {
|
2239 | level,
|
2240 | hasBasic: true,
|
2241 | has256: level >= 2,
|
2242 | has16m: level >= 3
|
2243 | };
|
2244 | }
|
2245 | function _supportsColor(haveStream, {
|
2246 | streamIsTTY,
|
2247 | sniffFlags = true
|
2248 | } = {}) {
|
2249 | const noFlagForceColor = envForceColor();
|
2250 | if (noFlagForceColor !== void 0) {
|
2251 | flagForceColor = noFlagForceColor;
|
2252 | }
|
2253 | const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
2254 | if (forceColor === 0) {
|
2255 | return 0;
|
2256 | }
|
2257 | if (sniffFlags) {
|
2258 | if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
2259 | return 3;
|
2260 | }
|
2261 | if (hasFlag("color=256")) {
|
2262 | return 2;
|
2263 | }
|
2264 | }
|
2265 | if (haveStream && !streamIsTTY && forceColor === void 0) {
|
2266 | return 0;
|
2267 | }
|
2268 | const min = forceColor || 0;
|
2269 | if (env.TERM === "dumb") {
|
2270 | return min;
|
2271 | }
|
2272 | if (import_node_process.default.platform === "win32") {
|
2273 | const osRelease = import_node_os.default.release().split(".");
|
2274 | if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
2275 | return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
2276 | }
|
2277 | return 1;
|
2278 | }
|
2279 | if ("CI" in env) {
|
2280 | if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
2281 | return 1;
|
2282 | }
|
2283 | return min;
|
2284 | }
|
2285 | if ("TEAMCITY_VERSION" in env) {
|
2286 | return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
2287 | }
|
2288 | if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
2289 | return 1;
|
2290 | }
|
2291 | if (env.COLORTERM === "truecolor") {
|
2292 | return 3;
|
2293 | }
|
2294 | if ("TERM_PROGRAM" in env) {
|
2295 | const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
2296 | switch (env.TERM_PROGRAM) {
|
2297 | case "iTerm.app":
|
2298 | return version >= 3 ? 3 : 2;
|
2299 | case "Apple_Terminal":
|
2300 | return 2;
|
2301 | }
|
2302 | }
|
2303 | if (/-256(color)?$/i.test(env.TERM)) {
|
2304 | return 2;
|
2305 | }
|
2306 | if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
2307 | return 1;
|
2308 | }
|
2309 | if ("COLORTERM" in env) {
|
2310 | return 1;
|
2311 | }
|
2312 | return min;
|
2313 | }
|
2314 | function createSupportsColor(stream, options = {}) {
|
2315 | const level = _supportsColor(stream, Object.assign({
|
2316 | streamIsTTY: stream && stream.isTTY
|
2317 | }, options));
|
2318 | return translateLevel(level);
|
2319 | }
|
2320 | var import_node_process;
|
2321 | var import_node_os;
|
2322 | var import_node_tty;
|
2323 | var env;
|
2324 | var flagForceColor;
|
2325 | var supportsColor;
|
2326 | var supports_color_default;
|
2327 | var init_supports_color = __esm({
|
2328 | "node_modules/chalk/source/vendor/supports-color/index.js"() {
|
2329 | import_node_process = __toESM(require("process"), 1);
|
2330 | import_node_os = __toESM(require("os"), 1);
|
2331 | import_node_tty = __toESM(require("tty"), 1);
|
2332 | ({
|
2333 | env
|
2334 | } = import_node_process.default);
|
2335 | if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
2336 | flagForceColor = 0;
|
2337 | } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
2338 | flagForceColor = 1;
|
2339 | }
|
2340 | supportsColor = {
|
2341 | stdout: createSupportsColor({
|
2342 | isTTY: import_node_tty.default.isatty(1)
|
2343 | }),
|
2344 | stderr: createSupportsColor({
|
2345 | isTTY: import_node_tty.default.isatty(2)
|
2346 | })
|
2347 | };
|
2348 | supports_color_default = supportsColor;
|
2349 | }
|
2350 | });
|
2351 | function stringReplaceAll(string, substring, replacer) {
|
2352 | let index = string.indexOf(substring);
|
2353 | if (index === -1) {
|
2354 | return string;
|
2355 | }
|
2356 | const substringLength = substring.length;
|
2357 | let endIndex = 0;
|
2358 | let returnValue = "";
|
2359 | do {
|
2360 | returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
2361 | endIndex = index + substringLength;
|
2362 | index = string.indexOf(substring, endIndex);
|
2363 | } while (index !== -1);
|
2364 | returnValue += string.slice(endIndex);
|
2365 | return returnValue;
|
2366 | }
|
2367 | function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
2368 | let endIndex = 0;
|
2369 | let returnValue = "";
|
2370 | do {
|
2371 | const gotCR = string[index - 1] === "\r";
|
2372 | returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
2373 | endIndex = index + 1;
|
2374 | index = string.indexOf("\n", endIndex);
|
2375 | } while (index !== -1);
|
2376 | returnValue += string.slice(endIndex);
|
2377 | return returnValue;
|
2378 | }
|
2379 | var init_utilities = __esm({
|
2380 | "node_modules/chalk/source/utilities.js"() {
|
2381 | }
|
2382 | });
|
2383 | var source_exports = {};
|
2384 | __export(source_exports, {
|
2385 | Chalk: () => Chalk,
|
2386 | chalkStderr: () => chalkStderr,
|
2387 | default: () => source_default,
|
2388 | supportsColor: () => stdoutColor,
|
2389 | supportsColorStderr: () => stderrColor
|
2390 | });
|
2391 | function createChalk(options) {
|
2392 | return chalkFactory(options);
|
2393 | }
|
2394 | var stdoutColor;
|
2395 | var stderrColor;
|
2396 | var GENERATOR;
|
2397 | var STYLER;
|
2398 | var IS_EMPTY;
|
2399 | var levelMapping;
|
2400 | var styles;
|
2401 | var applyOptions;
|
2402 | var Chalk;
|
2403 | var chalkFactory;
|
2404 | var getModelAnsi;
|
2405 | var usedModels;
|
2406 | var proto;
|
2407 | var createStyler;
|
2408 | var createBuilder;
|
2409 | var applyStyle;
|
2410 | var chalk;
|
2411 | var chalkStderr;
|
2412 | var source_default;
|
2413 | var init_source = __esm({
|
2414 | "node_modules/chalk/source/index.js"() {
|
2415 | init_ansi_styles();
|
2416 | init_supports_color();
|
2417 | init_utilities();
|
2418 | ({
|
2419 | stdout: stdoutColor,
|
2420 | stderr: stderrColor
|
2421 | } = supports_color_default);
|
2422 | GENERATOR = Symbol("GENERATOR");
|
2423 | STYLER = Symbol("STYLER");
|
2424 | IS_EMPTY = Symbol("IS_EMPTY");
|
2425 | levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
|
2426 | styles = Object.create(null);
|
2427 | applyOptions = (object, options = {}) => {
|
2428 | if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
2429 | throw new Error("The `level` option should be an integer from 0 to 3");
|
2430 | }
|
2431 | const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
2432 | object.level = options.level === void 0 ? colorLevel : options.level;
|
2433 | };
|
2434 | Chalk = class {
|
2435 | constructor(options) {
|
2436 | return chalkFactory(options);
|
2437 | }
|
2438 | };
|
2439 | chalkFactory = (options) => {
|
2440 | const chalk2 = (...strings) => strings.join(" ");
|
2441 | applyOptions(chalk2, options);
|
2442 | Object.setPrototypeOf(chalk2, createChalk.prototype);
|
2443 | return chalk2;
|
2444 | };
|
2445 | Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
2446 | for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
2447 | styles[styleName] = {
|
2448 | get() {
|
2449 | const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
2450 | Object.defineProperty(this, styleName, {
|
2451 | value: builder
|
2452 | });
|
2453 | return builder;
|
2454 | }
|
2455 | };
|
2456 | }
|
2457 | styles.visible = {
|
2458 | get() {
|
2459 | const builder = createBuilder(this, this[STYLER], true);
|
2460 | Object.defineProperty(this, "visible", {
|
2461 | value: builder
|
2462 | });
|
2463 | return builder;
|
2464 | }
|
2465 | };
|
2466 | getModelAnsi = (model, level, type, ...arguments_) => {
|
2467 | if (model === "rgb") {
|
2468 | if (level === "ansi16m") {
|
2469 | return ansi_styles_default[type].ansi16m(...arguments_);
|
2470 | }
|
2471 | if (level === "ansi256") {
|
2472 | return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
2473 | }
|
2474 | return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
2475 | }
|
2476 | if (model === "hex") {
|
2477 | return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
2478 | }
|
2479 | return ansi_styles_default[type][model](...arguments_);
|
2480 | };
|
2481 | usedModels = ["rgb", "hex", "ansi256"];
|
2482 | for (const model of usedModels) {
|
2483 | styles[model] = {
|
2484 | get() {
|
2485 | const {
|
2486 | level
|
2487 | } = this;
|
2488 | return function(...arguments_) {
|
2489 | const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
2490 | return createBuilder(this, styler, this[IS_EMPTY]);
|
2491 | };
|
2492 | }
|
2493 | };
|
2494 | const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
2495 | styles[bgModel] = {
|
2496 | get() {
|
2497 | const {
|
2498 | level
|
2499 | } = this;
|
2500 | return function(...arguments_) {
|
2501 | const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
2502 | return createBuilder(this, styler, this[IS_EMPTY]);
|
2503 | };
|
2504 | }
|
2505 | };
|
2506 | }
|
2507 | proto = Object.defineProperties(() => {
|
2508 | }, Object.assign(Object.assign({}, styles), {}, {
|
2509 | level: {
|
2510 | enumerable: true,
|
2511 | get() {
|
2512 | return this[GENERATOR].level;
|
2513 | },
|
2514 | set(level) {
|
2515 | this[GENERATOR].level = level;
|
2516 | }
|
2517 | }
|
2518 | }));
|
2519 | createStyler = (open, close, parent) => {
|
2520 | let openAll;
|
2521 | let closeAll;
|
2522 | if (parent === void 0) {
|
2523 | openAll = open;
|
2524 | closeAll = close;
|
2525 | } else {
|
2526 | openAll = parent.openAll + open;
|
2527 | closeAll = close + parent.closeAll;
|
2528 | }
|
2529 | return {
|
2530 | open,
|
2531 | close,
|
2532 | openAll,
|
2533 | closeAll,
|
2534 | parent
|
2535 | };
|
2536 | };
|
2537 | createBuilder = (self2, _styler, _isEmpty) => {
|
2538 | const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
2539 | Object.setPrototypeOf(builder, proto);
|
2540 | builder[GENERATOR] = self2;
|
2541 | builder[STYLER] = _styler;
|
2542 | builder[IS_EMPTY] = _isEmpty;
|
2543 | return builder;
|
2544 | };
|
2545 | applyStyle = (self2, string) => {
|
2546 | if (self2.level <= 0 || !string) {
|
2547 | return self2[IS_EMPTY] ? "" : string;
|
2548 | }
|
2549 | let styler = self2[STYLER];
|
2550 | if (styler === void 0) {
|
2551 | return string;
|
2552 | }
|
2553 | const {
|
2554 | openAll,
|
2555 | closeAll
|
2556 | } = styler;
|
2557 | if (string.includes("\x1B")) {
|
2558 | while (styler !== void 0) {
|
2559 | string = stringReplaceAll(string, styler.close, styler.open);
|
2560 | styler = styler.parent;
|
2561 | }
|
2562 | }
|
2563 | const lfIndex = string.indexOf("\n");
|
2564 | if (lfIndex !== -1) {
|
2565 | string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
2566 | }
|
2567 | return openAll + string + closeAll;
|
2568 | };
|
2569 | Object.defineProperties(createChalk.prototype, styles);
|
2570 | chalk = createChalk();
|
2571 | chalkStderr = createChalk({
|
2572 | level: stderrColor ? stderrColor.level : 0
|
2573 | });
|
2574 | source_default = chalk;
|
2575 | }
|
2576 | });
|
2577 | var require_logger = __commonJS2({
|
2578 | "src/cli/logger.js"(exports2, module2) {
|
2579 | "use strict";
|
2580 | var readline = require("readline");
|
2581 | var wcwidth = require_wcwidth();
|
2582 | var {
|
2583 | default: stripAnsi2
|
2584 | } = (init_strip_ansi(), __toCommonJS(strip_ansi_exports));
|
2585 | var {
|
2586 | default: chalk2,
|
2587 | chalkStderr: chalkStderr2
|
2588 | } = (init_source(), __toCommonJS(source_exports));
|
2589 | var countLines = (stream, text) => {
|
2590 | const columns = stream.columns || 80;
|
2591 | let lineCount = 0;
|
2592 | for (const line of stripAnsi2(text).split("\n")) {
|
2593 | lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns));
|
2594 | }
|
2595 | return lineCount;
|
2596 | };
|
2597 | var clear = (stream, text) => () => {
|
2598 | const lineCount = countLines(stream, text);
|
2599 | for (let line = 0; line < lineCount; line++) {
|
2600 | if (line > 0) {
|
2601 | readline.moveCursor(stream, 0, -1);
|
2602 | }
|
2603 | readline.clearLine(stream, 0);
|
2604 | readline.cursorTo(stream, 0);
|
2605 | }
|
2606 | };
|
2607 | var emptyLogResult = {
|
2608 | clear() {
|
2609 | }
|
2610 | };
|
2611 | function createLogger2(logLevel = "log") {
|
2612 | return {
|
2613 | logLevel,
|
2614 | warn: createLogFunc("warn", "yellow"),
|
2615 | error: createLogFunc("error", "red"),
|
2616 | debug: createLogFunc("debug", "blue"),
|
2617 | log: createLogFunc("log")
|
2618 | };
|
2619 | function createLogFunc(loggerName, color) {
|
2620 | if (!shouldLog(loggerName)) {
|
2621 | return () => emptyLogResult;
|
2622 | }
|
2623 | const stream = process[loggerName === "log" ? "stdout" : "stderr"];
|
2624 | const chalkInstance = loggerName === "log" ? chalk2 : chalkStderr2;
|
2625 | const prefix = color ? `[${chalkInstance[color](loggerName)}] ` : "";
|
2626 | return (message, options) => {
|
2627 | options = Object.assign({
|
2628 | newline: true,
|
2629 | clearable: false
|
2630 | }, options);
|
2631 | message = message.replace(/^/gm, prefix) + (options.newline ? "\n" : "");
|
2632 | stream.write(message);
|
2633 | if (options.clearable) {
|
2634 | return {
|
2635 | clear: clear(stream, message)
|
2636 | };
|
2637 | }
|
2638 | };
|
2639 | }
|
2640 | function shouldLog(loggerName) {
|
2641 | switch (logLevel) {
|
2642 | case "silent":
|
2643 | return false;
|
2644 | case "debug":
|
2645 | if (loggerName === "debug") {
|
2646 | return true;
|
2647 | }
|
2648 | case "log":
|
2649 | if (loggerName === "log") {
|
2650 | return true;
|
2651 | }
|
2652 | case "warn":
|
2653 | if (loggerName === "warn") {
|
2654 | return true;
|
2655 | }
|
2656 | case "error":
|
2657 | return loggerName === "error";
|
2658 | }
|
2659 | }
|
2660 | }
|
2661 | module2.exports = createLogger2;
|
2662 | }
|
2663 | });
|
2664 | var require_prettier_internal = __commonJS2({
|
2665 | "src/cli/prettier-internal.js"(exports2, module2) {
|
2666 | "use strict";
|
2667 | module2.exports = require("./index.js").__internal;
|
2668 | }
|
2669 | });
|
2670 | var require_lib = __commonJS2({
|
2671 | "node_modules/outdent/lib/index.js"(exports2, module2) {
|
2672 | "use strict";
|
2673 | Object.defineProperty(exports2, "__esModule", {
|
2674 | value: true
|
2675 | });
|
2676 | exports2.outdent = void 0;
|
2677 | function noop() {
|
2678 | var args = [];
|
2679 | for (var _i = 0; _i < arguments.length; _i++) {
|
2680 | args[_i] = arguments[_i];
|
2681 | }
|
2682 | }
|
2683 | function createWeakMap() {
|
2684 | if (typeof WeakMap !== "undefined") {
|
2685 | return new WeakMap();
|
2686 | } else {
|
2687 | return fakeSetOrMap();
|
2688 | }
|
2689 | }
|
2690 | function fakeSetOrMap() {
|
2691 | return {
|
2692 | add: noop,
|
2693 | delete: noop,
|
2694 | get: noop,
|
2695 | set: noop,
|
2696 | has: function(k) {
|
2697 | return false;
|
2698 | }
|
2699 | };
|
2700 | }
|
2701 | var hop = Object.prototype.hasOwnProperty;
|
2702 | var has = function(obj, prop) {
|
2703 | return hop.call(obj, prop);
|
2704 | };
|
2705 | function extend(target, source) {
|
2706 | for (var prop in source) {
|
2707 | if (has(source, prop)) {
|
2708 | target[prop] = source[prop];
|
2709 | }
|
2710 | }
|
2711 | return target;
|
2712 | }
|
2713 | var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
|
2714 | var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
|
2715 | var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
|
2716 | var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
|
2717 | var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
|
2718 | function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
|
2719 | var indentationLevel = 0;
|
2720 | var match = strings[0].match(reDetectIndentation);
|
2721 | if (match) {
|
2722 | indentationLevel = match[1].length;
|
2723 | }
|
2724 | var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
|
2725 | var reMatchIndent = new RegExp(reSource, "g");
|
2726 | if (firstInterpolatedValueSetsIndentationLevel) {
|
2727 | strings = strings.slice(1);
|
2728 | }
|
2729 | var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
|
2730 | var normalizeNewlines = typeof newline === "string";
|
2731 | var l = strings.length;
|
2732 | var outdentedStrings = strings.map(function(v, i) {
|
2733 | v = v.replace(reMatchIndent, "$1");
|
2734 | if (i === 0 && trimLeadingNewline) {
|
2735 | v = v.replace(reLeadingNewline, "");
|
2736 | }
|
2737 | if (i === l - 1 && trimTrailingNewline) {
|
2738 | v = v.replace(reTrailingNewline, "");
|
2739 | }
|
2740 | if (normalizeNewlines) {
|
2741 | v = v.replace(/\r\n|\n|\r/g, function(_) {
|
2742 | return newline;
|
2743 | });
|
2744 | }
|
2745 | return v;
|
2746 | });
|
2747 | return outdentedStrings;
|
2748 | }
|
2749 | function concatStringsAndValues(strings, values) {
|
2750 | var ret = "";
|
2751 | for (var i = 0, l = strings.length; i < l; i++) {
|
2752 | ret += strings[i];
|
2753 | if (i < l - 1) {
|
2754 | ret += values[i];
|
2755 | }
|
2756 | }
|
2757 | return ret;
|
2758 | }
|
2759 | function isTemplateStringsArray(v) {
|
2760 | return has(v, "raw") && has(v, "length");
|
2761 | }
|
2762 | function createInstance(options) {
|
2763 | var arrayAutoIndentCache = createWeakMap();
|
2764 | var arrayFirstInterpSetsIndentCache = createWeakMap();
|
2765 | function outdent(stringsOrOptions) {
|
2766 | var values = [];
|
2767 | for (var _i = 1; _i < arguments.length; _i++) {
|
2768 | values[_i - 1] = arguments[_i];
|
2769 | }
|
2770 | if (isTemplateStringsArray(stringsOrOptions)) {
|
2771 | var strings = stringsOrOptions;
|
2772 | var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
|
2773 | var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
|
2774 | var renderedArray = cache.get(strings);
|
2775 | if (!renderedArray) {
|
2776 | renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
|
2777 | cache.set(strings, renderedArray);
|
2778 | }
|
2779 | if (values.length === 0) {
|
2780 | return renderedArray[0];
|
2781 | }
|
2782 | var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
|
2783 | return rendered;
|
2784 | } else {
|
2785 | return createInstance(extend(extend({}, options), stringsOrOptions || {}));
|
2786 | }
|
2787 | }
|
2788 | var fullOutdent = extend(outdent, {
|
2789 | string: function(str) {
|
2790 | return _outdentArray([str], false, options)[0];
|
2791 | }
|
2792 | });
|
2793 | return fullOutdent;
|
2794 | }
|
2795 | var defaultOutdent = createInstance({
|
2796 | trimLeadingNewline: true,
|
2797 | trimTrailingNewline: true
|
2798 | });
|
2799 | exports2.outdent = defaultOutdent;
|
2800 | exports2.default = defaultOutdent;
|
2801 | if (typeof module2 !== "undefined") {
|
2802 | try {
|
2803 | module2.exports = defaultOutdent;
|
2804 | Object.defineProperty(defaultOutdent, "__esModule", {
|
2805 | value: true
|
2806 | });
|
2807 | defaultOutdent.default = defaultOutdent;
|
2808 | defaultOutdent.outdent = defaultOutdent;
|
2809 | } catch (e) {
|
2810 | }
|
2811 | }
|
2812 | }
|
2813 | });
|
2814 | var require_constant = __commonJS2({
|
2815 | "src/cli/constant.js"(exports2, module2) {
|
2816 | "use strict";
|
2817 | var {
|
2818 | outdent
|
2819 | } = require_lib();
|
2820 | var {
|
2821 | coreOptions
|
2822 | } = require_prettier_internal();
|
2823 | var categoryOrder = [coreOptions.CATEGORY_OUTPUT, coreOptions.CATEGORY_FORMAT, coreOptions.CATEGORY_CONFIG, coreOptions.CATEGORY_EDITOR, coreOptions.CATEGORY_OTHER];
|
2824 | var options = {
|
2825 | cache: {
|
2826 | default: false,
|
2827 | description: "Only format changed files. Cannot use with --stdin-filepath.",
|
2828 | type: "boolean"
|
2829 | },
|
2830 | "cache-location": {
|
2831 | description: "Path to the cache file.",
|
2832 | type: "path"
|
2833 | },
|
2834 | "cache-strategy": {
|
2835 | choices: [{
|
2836 | description: "Use the file metadata such as timestamps as cache keys",
|
2837 | value: "metadata"
|
2838 | }, {
|
2839 | description: "Use the file content as cache keys",
|
2840 | value: "content"
|
2841 | }],
|
2842 | description: "Strategy for the cache to use for detecting changed files.",
|
2843 | type: "choice"
|
2844 | },
|
2845 | check: {
|
2846 | alias: "c",
|
2847 | category: coreOptions.CATEGORY_OUTPUT,
|
2848 | description: outdent`
|
2849 | Check if the given files are formatted, print a human-friendly summary
|
2850 | message and paths to unformatted files (see also --list-different).
|
2851 | `,
|
2852 | type: "boolean"
|
2853 | },
|
2854 | color: {
|
2855 | default: true,
|
2856 | description: "Colorize error messages.",
|
2857 | oppositeDescription: "Do not colorize error messages.",
|
2858 | type: "boolean"
|
2859 | },
|
2860 | config: {
|
2861 | category: coreOptions.CATEGORY_CONFIG,
|
2862 | description: "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
|
2863 | exception: (value) => value === false,
|
2864 | oppositeDescription: "Do not look for a configuration file.",
|
2865 | type: "path"
|
2866 | },
|
2867 | "config-precedence": {
|
2868 | category: coreOptions.CATEGORY_CONFIG,
|
2869 | choices: [{
|
2870 | description: "CLI options take precedence over config file",
|
2871 | value: "cli-override"
|
2872 | }, {
|
2873 | description: "Config file take precedence over CLI options",
|
2874 | value: "file-override"
|
2875 | }, {
|
2876 | description: outdent`
|
2877 | If a config file is found will evaluate it and ignore other CLI options.
|
2878 | If no config file is found CLI options will evaluate as normal.
|
2879 | `,
|
2880 | value: "prefer-file"
|
2881 | }],
|
2882 | default: "cli-override",
|
2883 | description: "Define in which order config files and CLI options should be evaluated.",
|
2884 | type: "choice"
|
2885 | },
|
2886 | "debug-benchmark": {
|
2887 | type: "boolean"
|
2888 | },
|
2889 | "debug-check": {
|
2890 | type: "boolean"
|
2891 | },
|
2892 | "debug-print-ast": {
|
2893 | type: "boolean"
|
2894 | },
|
2895 | "debug-print-comments": {
|
2896 | type: "boolean"
|
2897 | },
|
2898 | "debug-print-doc": {
|
2899 | type: "boolean"
|
2900 | },
|
2901 | "debug-repeat": {
|
2902 | default: 0,
|
2903 | type: "int"
|
2904 | },
|
2905 | editorconfig: {
|
2906 | category: coreOptions.CATEGORY_CONFIG,
|
2907 | default: true,
|
2908 | description: "Take .editorconfig into account when parsing configuration.",
|
2909 | oppositeDescription: "Don't take .editorconfig into account when parsing configuration.",
|
2910 | type: "boolean"
|
2911 | },
|
2912 | "error-on-unmatched-pattern": {
|
2913 | oppositeDescription: "Prevent errors when pattern is unmatched.",
|
2914 | type: "boolean"
|
2915 | },
|
2916 | "file-info": {
|
2917 | description: outdent`
|
2918 | Extract the following info (as JSON) for a given file path. Reported fields:
|
2919 | * ignored (boolean) - true if file path is filtered by --ignore-path
|
2920 | * inferredParser (string | null) - name of parser inferred from file path
|
2921 | `,
|
2922 | type: "path"
|
2923 | },
|
2924 | "find-config-path": {
|
2925 | category: coreOptions.CATEGORY_CONFIG,
|
2926 | description: "Find and print the path to a configuration file for the given input file.",
|
2927 | type: "path"
|
2928 | },
|
2929 | help: {
|
2930 | alias: "h",
|
2931 | description: outdent`
|
2932 | Show CLI usage, or details about the given flag.
|
2933 | Example: --help write
|
2934 | `,
|
2935 | exception: (value) => value === "",
|
2936 | type: "flag"
|
2937 | },
|
2938 | "ignore-path": {
|
2939 | category: coreOptions.CATEGORY_CONFIG,
|
2940 | default: ".prettierignore",
|
2941 | description: "Path to a file with patterns describing files to ignore.",
|
2942 | type: "path"
|
2943 | },
|
2944 | "ignore-unknown": {
|
2945 | alias: "u",
|
2946 | description: "Ignore unknown files.",
|
2947 | type: "boolean"
|
2948 | },
|
2949 | "list-different": {
|
2950 | alias: "l",
|
2951 | category: coreOptions.CATEGORY_OUTPUT,
|
2952 | description: "Print the names of files that are different from Prettier's formatting (see also --check).",
|
2953 | type: "boolean"
|
2954 | },
|
2955 | loglevel: {
|
2956 | choices: ["silent", "error", "warn", "log", "debug"],
|
2957 | default: "log",
|
2958 | description: "What level of logs to report.",
|
2959 | type: "choice"
|
2960 | },
|
2961 | "plugin-search": {
|
2962 | oppositeDescription: "Disable plugin autoloading.",
|
2963 | type: "boolean"
|
2964 | },
|
2965 | "support-info": {
|
2966 | description: "Print support information as JSON.",
|
2967 | type: "boolean"
|
2968 | },
|
2969 | version: {
|
2970 | alias: "v",
|
2971 | description: "Print Prettier version.",
|
2972 | type: "boolean"
|
2973 | },
|
2974 | "with-node-modules": {
|
2975 | category: coreOptions.CATEGORY_CONFIG,
|
2976 | description: "Process files inside 'node_modules' directory.",
|
2977 | type: "boolean"
|
2978 | },
|
2979 | write: {
|
2980 | alias: "w",
|
2981 | category: coreOptions.CATEGORY_OUTPUT,
|
2982 | description: "Edit files in-place. (Beware!)",
|
2983 | type: "boolean"
|
2984 | }
|
2985 | };
|
2986 | var usageSummary = outdent`
|
2987 | Usage: prettier [options] [file/dir/glob ...]
|
2988 |
|
2989 | By default, output is written to stdout.
|
2990 | Stdin is read if it is piped to Prettier and no files are given.
|
2991 | `;
|
2992 | module2.exports = {
|
2993 | categoryOrder,
|
2994 | options,
|
2995 | usageSummary
|
2996 | };
|
2997 | }
|
2998 | });
|
2999 | var require_dashify = __commonJS2({
|
3000 | "node_modules/dashify/index.js"(exports2, module2) {
|
3001 | "use strict";
|
3002 | module2.exports = (str, options) => {
|
3003 | if (typeof str !== "string")
|
3004 | throw new TypeError("expected a string");
|
3005 | return str.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/\W/g, (m) => /[À-ž]/.test(m) ? m : "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, (m) => options && options.condense ? "-" : m).toLowerCase();
|
3006 | };
|
3007 | }
|
3008 | });
|
3009 | var require_option_map = __commonJS2({
|
3010 | "src/cli/options/option-map.js"(exports2, module2) {
|
3011 | "use strict";
|
3012 | var dashify = require_dashify();
|
3013 | var {
|
3014 | coreOptions
|
3015 | } = require_prettier_internal();
|
3016 | function normalizeDetailedOption(name, option) {
|
3017 | return Object.assign(Object.assign({
|
3018 | category: coreOptions.CATEGORY_OTHER
|
3019 | }, option), {}, {
|
3020 | choices: option.choices && option.choices.map((choice) => {
|
3021 | const newChoice = Object.assign({
|
3022 | description: "",
|
3023 | deprecated: false
|
3024 | }, typeof choice === "object" ? choice : {
|
3025 | value: choice
|
3026 | });
|
3027 | if (newChoice.value === true) {
|
3028 | newChoice.value = "";
|
3029 | }
|
3030 | return newChoice;
|
3031 | })
|
3032 | });
|
3033 | }
|
3034 | function normalizeDetailedOptionMap(detailedOptionMap) {
|
3035 | return Object.fromEntries(Object.entries(detailedOptionMap).sort(([leftName], [rightName]) => leftName.localeCompare(rightName)).map(([name, option]) => [name, normalizeDetailedOption(name, option)]));
|
3036 | }
|
3037 | function createDetailedOptionMap(supportOptions) {
|
3038 | return Object.fromEntries(supportOptions.map((option) => {
|
3039 | const newOption = Object.assign(Object.assign({}, option), {}, {
|
3040 | name: option.cliName || dashify(option.name),
|
3041 | description: option.cliDescription || option.description,
|
3042 | category: option.cliCategory || coreOptions.CATEGORY_FORMAT,
|
3043 | forwardToApi: option.name
|
3044 | });
|
3045 | if (option.deprecated) {
|
3046 | delete newOption.forwardToApi;
|
3047 | delete newOption.description;
|
3048 | delete newOption.oppositeDescription;
|
3049 | newOption.deprecated = true;
|
3050 | }
|
3051 | return [newOption.name, newOption];
|
3052 | }));
|
3053 | }
|
3054 | module2.exports = {
|
3055 | normalizeDetailedOptionMap,
|
3056 | createDetailedOptionMap
|
3057 | };
|
3058 | }
|
3059 | });
|
3060 | var require_get_context_options = __commonJS2({
|
3061 | "src/cli/options/get-context-options.js"(exports2, module2) {
|
3062 | "use strict";
|
3063 | var prettier2 = require("./index.js");
|
3064 | var {
|
3065 | optionsModule,
|
3066 | utils: {
|
3067 | arrayify
|
3068 | }
|
3069 | } = require_prettier_internal();
|
3070 | var constant = require_constant();
|
3071 | var {
|
3072 | normalizeDetailedOptionMap,
|
3073 | createDetailedOptionMap
|
3074 | } = require_option_map();
|
3075 | function getContextOptions(plugins, pluginSearchDirs) {
|
3076 | const {
|
3077 | options: supportOptions,
|
3078 | languages
|
3079 | } = prettier2.getSupportInfo({
|
3080 | showDeprecated: true,
|
3081 | showUnreleased: true,
|
3082 | showInternal: true,
|
3083 | plugins,
|
3084 | pluginSearchDirs
|
3085 | });
|
3086 | const detailedOptionMap = normalizeDetailedOptionMap(Object.assign(Object.assign({}, createDetailedOptionMap(supportOptions)), constant.options));
|
3087 | const detailedOptions = arrayify(detailedOptionMap, "name");
|
3088 | const apiDefaultOptions = Object.assign(Object.assign({}, optionsModule.hiddenDefaults), Object.fromEntries(supportOptions.filter(({
|
3089 | deprecated
|
3090 | }) => !deprecated).map((option) => [option.name, option.default])));
|
3091 | return {
|
3092 | supportOptions,
|
3093 | detailedOptions,
|
3094 | detailedOptionMap,
|
3095 | apiDefaultOptions,
|
3096 | languages
|
3097 | };
|
3098 | }
|
3099 | module2.exports = getContextOptions;
|
3100 | }
|
3101 | });
|
3102 | var require_camelcase = __commonJS2({
|
3103 | "node_modules/camelcase/index.js"(exports2, module2) {
|
3104 | "use strict";
|
3105 | var UPPERCASE = /[\p{Lu}]/u;
|
3106 | var LOWERCASE = /[\p{Ll}]/u;
|
3107 | var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
|
3108 | var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
|
3109 | var SEPARATORS = /[_.\- ]+/;
|
3110 | var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
|
3111 | var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
3112 | var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
|
3113 | var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
|
3114 | let isLastCharLower = false;
|
3115 | let isLastCharUpper = false;
|
3116 | let isLastLastCharUpper = false;
|
3117 | for (let i = 0; i < string.length; i++) {
|
3118 | const character = string[i];
|
3119 | if (isLastCharLower && UPPERCASE.test(character)) {
|
3120 | string = string.slice(0, i) + "-" + string.slice(i);
|
3121 | isLastCharLower = false;
|
3122 | isLastLastCharUpper = isLastCharUpper;
|
3123 | isLastCharUpper = true;
|
3124 | i++;
|
3125 | } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
|
3126 | string = string.slice(0, i - 1) + "-" + string.slice(i - 1);
|
3127 | isLastLastCharUpper = isLastCharUpper;
|
3128 | isLastCharUpper = false;
|
3129 | isLastCharLower = true;
|
3130 | } else {
|
3131 | isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
3132 | isLastLastCharUpper = isLastCharUpper;
|
3133 | isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
3134 | }
|
3135 | }
|
3136 | return string;
|
3137 | };
|
3138 | var preserveConsecutiveUppercase = (input, toLowerCase) => {
|
3139 | LEADING_CAPITAL.lastIndex = 0;
|
3140 | return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
|
3141 | };
|
3142 | var postProcess = (input, toUpperCase) => {
|
3143 | SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
3144 | NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
3145 | return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
|
3146 | };
|
3147 | var camelCase = (input, options) => {
|
3148 | if (!(typeof input === "string" || Array.isArray(input))) {
|
3149 | throw new TypeError("Expected the input to be `string | string[]`");
|
3150 | }
|
3151 | options = Object.assign({
|
3152 | pascalCase: false,
|
3153 | preserveConsecutiveUppercase: false
|
3154 | }, options);
|
3155 | if (Array.isArray(input)) {
|
3156 | input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
|
3157 | } else {
|
3158 | input = input.trim();
|
3159 | }
|
3160 | if (input.length === 0) {
|
3161 | return "";
|
3162 | }
|
3163 | const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
|
3164 | const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
|
3165 | if (input.length === 1) {
|
3166 | return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
3167 | }
|
3168 | const hasUpperCase = input !== toLowerCase(input);
|
3169 | if (hasUpperCase) {
|
3170 | input = preserveCamelCase(input, toLowerCase, toUpperCase);
|
3171 | }
|
3172 | input = input.replace(LEADING_SEPARATORS, "");
|
3173 | if (options.preserveConsecutiveUppercase) {
|
3174 | input = preserveConsecutiveUppercase(input, toLowerCase);
|
3175 | } else {
|
3176 | input = toLowerCase(input);
|
3177 | }
|
3178 | if (options.pascalCase) {
|
3179 | input = toUpperCase(input.charAt(0)) + input.slice(1);
|
3180 | }
|
3181 | return postProcess(input, toUpperCase);
|
3182 | };
|
3183 | module2.exports = camelCase;
|
3184 | module2.exports.default = camelCase;
|
3185 | }
|
3186 | });
|
3187 | var sdbm_exports = {};
|
3188 | __export(sdbm_exports, {
|
3189 | default: () => sdbm
|
3190 | });
|
3191 | function sdbm(string) {
|
3192 | let hash = 0;
|
3193 | for (let i = 0; i < string.length; i++) {
|
3194 | hash = string.charCodeAt(i) + (hash << 6) + (hash << 16) - hash;
|
3195 | }
|
3196 | return hash >>> 0;
|
3197 | }
|
3198 | var init_sdbm = __esm({
|
3199 | "node_modules/sdbm/index.js"() {
|
3200 | }
|
3201 | });
|
3202 | var require_utils = __commonJS2({
|
3203 | "src/cli/utils.js"(exports2, module2) {
|
3204 | "use strict";
|
3205 | var {
|
3206 | promises: fs
|
3207 | } = require("fs");
|
3208 | var {
|
3209 | default: sdbm2
|
3210 | } = (init_sdbm(), __toCommonJS(sdbm_exports));
|
3211 | var printToScreen2 = console.log.bind(console);
|
3212 | function groupBy(array2, iteratee) {
|
3213 | const result = Object.create(null);
|
3214 | for (const value of array2) {
|
3215 | const key = iteratee(value);
|
3216 | if (Array.isArray(result[key])) {
|
3217 | result[key].push(value);
|
3218 | } else {
|
3219 | result[key] = [value];
|
3220 | }
|
3221 | }
|
3222 | return result;
|
3223 | }
|
3224 | function pick(object, keys) {
|
3225 | const entries = keys.map((key) => [key, object[key]]);
|
3226 | return Object.fromEntries(entries);
|
3227 | }
|
3228 | function createHash(source) {
|
3229 | return String(sdbm2(source));
|
3230 | }
|
3231 | async function statSafe(filePath) {
|
3232 | try {
|
3233 | return await fs.stat(filePath);
|
3234 | } catch (error) {
|
3235 | if (error.code !== "ENOENT") {
|
3236 | throw error;
|
3237 | }
|
3238 | }
|
3239 | }
|
3240 | function isJson(value) {
|
3241 | try {
|
3242 | JSON.parse(value);
|
3243 | return true;
|
3244 | } catch {
|
3245 | return false;
|
3246 | }
|
3247 | }
|
3248 | module2.exports = {
|
3249 | printToScreen: printToScreen2,
|
3250 | groupBy,
|
3251 | pick,
|
3252 | createHash,
|
3253 | statSafe,
|
3254 | isJson
|
3255 | };
|
3256 | }
|
3257 | });
|
3258 | var require_minimist = __commonJS2({
|
3259 | "node_modules/minimist/index.js"(exports2, module2) {
|
3260 | module2.exports = function(args, opts) {
|
3261 | if (!opts)
|
3262 | opts = {};
|
3263 | var flags = {
|
3264 | bools: {},
|
3265 | strings: {},
|
3266 | unknownFn: null
|
3267 | };
|
3268 | if (typeof opts["unknown"] === "function") {
|
3269 | flags.unknownFn = opts["unknown"];
|
3270 | }
|
3271 | if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
|
3272 | flags.allBools = true;
|
3273 | } else {
|
3274 | [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
|
3275 | flags.bools[key2] = true;
|
3276 | });
|
3277 | }
|
3278 | var aliases = {};
|
3279 | Object.keys(opts.alias || {}).forEach(function(key2) {
|
3280 | aliases[key2] = [].concat(opts.alias[key2]);
|
3281 | aliases[key2].forEach(function(x) {
|
3282 | aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
|
3283 | return x !== y;
|
3284 | }));
|
3285 | });
|
3286 | });
|
3287 | [].concat(opts.string).filter(Boolean).forEach(function(key2) {
|
3288 | flags.strings[key2] = true;
|
3289 | if (aliases[key2]) {
|
3290 | flags.strings[aliases[key2]] = true;
|
3291 | }
|
3292 | });
|
3293 | var defaults = opts["default"] || {};
|
3294 | var argv = {
|
3295 | _: []
|
3296 | };
|
3297 | Object.keys(flags.bools).forEach(function(key2) {
|
3298 | setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
|
3299 | });
|
3300 | var notFlags = [];
|
3301 | if (args.indexOf("--") !== -1) {
|
3302 | notFlags = args.slice(args.indexOf("--") + 1);
|
3303 | args = args.slice(0, args.indexOf("--"));
|
3304 | }
|
3305 | function argDefined(key2, arg2) {
|
3306 | return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
|
3307 | }
|
3308 | function setArg(key2, val, arg2) {
|
3309 | if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
|
3310 | if (flags.unknownFn(arg2) === false)
|
3311 | return;
|
3312 | }
|
3313 | var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
|
3314 | setKey(argv, key2.split("."), value2);
|
3315 | (aliases[key2] || []).forEach(function(x) {
|
3316 | setKey(argv, x.split("."), value2);
|
3317 | });
|
3318 | }
|
3319 | function setKey(obj, keys, value2) {
|
3320 | var o = obj;
|
3321 | for (var i2 = 0; i2 < keys.length - 1; i2++) {
|
3322 | var key2 = keys[i2];
|
3323 | if (isConstructorOrProto(o, key2))
|
3324 | return;
|
3325 | if (o[key2] === void 0)
|
3326 | o[key2] = {};
|
3327 | if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype)
|
3328 | o[key2] = {};
|
3329 | if (o[key2] === Array.prototype)
|
3330 | o[key2] = [];
|
3331 | o = o[key2];
|
3332 | }
|
3333 | var key2 = keys[keys.length - 1];
|
3334 | if (isConstructorOrProto(o, key2))
|
3335 | return;
|
3336 | if (o === Object.prototype || o === Number.prototype || o === String.prototype)
|
3337 | o = {};
|
3338 | if (o === Array.prototype)
|
3339 | o = [];
|
3340 | if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") {
|
3341 | o[key2] = value2;
|
3342 | } else if (Array.isArray(o[key2])) {
|
3343 | o[key2].push(value2);
|
3344 | } else {
|
3345 | o[key2] = [o[key2], value2];
|
3346 | }
|
3347 | }
|
3348 | function aliasIsBoolean(key2) {
|
3349 | return aliases[key2].some(function(x) {
|
3350 | return flags.bools[x];
|
3351 | });
|
3352 | }
|
3353 | for (var i = 0; i < args.length; i++) {
|
3354 | var arg = args[i];
|
3355 | if (/^--.+=/.test(arg)) {
|
3356 | var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
3357 | var key = m[1];
|
3358 | var value = m[2];
|
3359 | if (flags.bools[key]) {
|
3360 | value = value !== "false";
|
3361 | }
|
3362 | setArg(key, value, arg);
|
3363 | } else if (/^--no-.+/.test(arg)) {
|
3364 | var key = arg.match(/^--no-(.+)/)[1];
|
3365 | setArg(key, false, arg);
|
3366 | } else if (/^--.+/.test(arg)) {
|
3367 | var key = arg.match(/^--(.+)/)[1];
|
3368 | var next = args[i + 1];
|
3369 | if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
3370 | setArg(key, next, arg);
|
3371 | i++;
|
3372 | } else if (/^(true|false)$/.test(next)) {
|
3373 | setArg(key, next === "true", arg);
|
3374 | i++;
|
3375 | } else {
|
3376 | setArg(key, flags.strings[key] ? "" : true, arg);
|
3377 | }
|
3378 | } else if (/^-[^-]+/.test(arg)) {
|
3379 | var letters = arg.slice(1, -1).split("");
|
3380 | var broken = false;
|
3381 | for (var j = 0; j < letters.length; j++) {
|
3382 | var next = arg.slice(j + 2);
|
3383 | if (next === "-") {
|
3384 | setArg(letters[j], next, arg);
|
3385 | continue;
|
3386 | }
|
3387 | if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
|
3388 | setArg(letters[j], next.split("=")[1], arg);
|
3389 | broken = true;
|
3390 | break;
|
3391 | }
|
3392 | if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
3393 | setArg(letters[j], next, arg);
|
3394 | broken = true;
|
3395 | break;
|
3396 | }
|
3397 | if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
3398 | setArg(letters[j], arg.slice(j + 2), arg);
|
3399 | broken = true;
|
3400 | break;
|
3401 | } else {
|
3402 | setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
|
3403 | }
|
3404 | }
|
3405 | var key = arg.slice(-1)[0];
|
3406 | if (!broken && key !== "-") {
|
3407 | if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
3408 | setArg(key, args[i + 1], arg);
|
3409 | i++;
|
3410 | } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
|
3411 | setArg(key, args[i + 1] === "true", arg);
|
3412 | i++;
|
3413 | } else {
|
3414 | setArg(key, flags.strings[key] ? "" : true, arg);
|
3415 | }
|
3416 | }
|
3417 | } else {
|
3418 | if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
|
3419 | argv._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
|
3420 | }
|
3421 | if (opts.stopEarly) {
|
3422 | argv._.push.apply(argv._, args.slice(i + 1));
|
3423 | break;
|
3424 | }
|
3425 | }
|
3426 | }
|
3427 | Object.keys(defaults).forEach(function(key2) {
|
3428 | if (!hasKey(argv, key2.split("."))) {
|
3429 | setKey(argv, key2.split("."), defaults[key2]);
|
3430 | (aliases[key2] || []).forEach(function(x) {
|
3431 | setKey(argv, x.split("."), defaults[key2]);
|
3432 | });
|
3433 | }
|
3434 | });
|
3435 | if (opts["--"]) {
|
3436 | argv["--"] = new Array();
|
3437 | notFlags.forEach(function(key2) {
|
3438 | argv["--"].push(key2);
|
3439 | });
|
3440 | } else {
|
3441 | notFlags.forEach(function(key2) {
|
3442 | argv._.push(key2);
|
3443 | });
|
3444 | }
|
3445 | return argv;
|
3446 | };
|
3447 | function hasKey(obj, keys) {
|
3448 | var o = obj;
|
3449 | keys.slice(0, -1).forEach(function(key2) {
|
3450 | o = o[key2] || {};
|
3451 | });
|
3452 | var key = keys[keys.length - 1];
|
3453 | return key in o;
|
3454 | }
|
3455 | function isNumber(x) {
|
3456 | if (typeof x === "number")
|
3457 | return true;
|
3458 | if (/^0x[0-9a-f]+$/i.test(x))
|
3459 | return true;
|
3460 | return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
3461 | }
|
3462 | function isConstructorOrProto(obj, key) {
|
3463 | return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
|
3464 | }
|
3465 | }
|
3466 | });
|
3467 | var require_minimist2 = __commonJS2({
|
3468 | "src/cli/options/minimist.js"(exports2, module2) {
|
3469 | "use strict";
|
3470 | var minimist = require_minimist();
|
3471 | var PLACEHOLDER = null;
|
3472 | module2.exports = function(args, options) {
|
3473 | const boolean = options.boolean || [];
|
3474 | const defaults = options.default || {};
|
3475 | const booleanWithoutDefault = boolean.filter((key) => !(key in defaults));
|
3476 | const newDefaults = Object.assign(Object.assign({}, defaults), Object.fromEntries(booleanWithoutDefault.map((key) => [key, PLACEHOLDER])));
|
3477 | const parsed = minimist(args, Object.assign(Object.assign({}, options), {}, {
|
3478 | default: newDefaults
|
3479 | }));
|
3480 | return Object.fromEntries(Object.entries(parsed).filter(([, value]) => value !== PLACEHOLDER));
|
3481 | };
|
3482 | }
|
3483 | });
|
3484 | var require_create_minimist_options = __commonJS2({
|
3485 | "src/cli/options/create-minimist-options.js"(exports2, module2) {
|
3486 | "use strict";
|
3487 | var {
|
3488 | utils: {
|
3489 | partition
|
3490 | }
|
3491 | } = require_prettier_internal();
|
3492 | module2.exports = function createMinimistOptions(detailedOptions) {
|
3493 | const [boolean, string] = partition(detailedOptions, ({
|
3494 | type
|
3495 | }) => type === "boolean").map((detailedOptions2) => detailedOptions2.flatMap(({
|
3496 | name,
|
3497 | alias
|
3498 | }) => alias ? [name, alias] : [name]));
|
3499 | const defaults = Object.fromEntries(detailedOptions.filter((option) => !option.deprecated && (!option.forwardToApi || option.name === "plugin" || option.name === "plugin-search-dir") && option.default !== void 0).map((option) => [option.name, option.default]));
|
3500 | return {
|
3501 | alias: {},
|
3502 | boolean,
|
3503 | string,
|
3504 | default: defaults
|
3505 | };
|
3506 | };
|
3507 | }
|
3508 | });
|
3509 | var leven_exports = {};
|
3510 | __export(leven_exports, {
|
3511 | default: () => leven
|
3512 | });
|
3513 | function leven(first, second) {
|
3514 | if (first === second) {
|
3515 | return 0;
|
3516 | }
|
3517 | const swap = first;
|
3518 | if (first.length > second.length) {
|
3519 | first = second;
|
3520 | second = swap;
|
3521 | }
|
3522 | let firstLength = first.length;
|
3523 | let secondLength = second.length;
|
3524 | while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) {
|
3525 | firstLength--;
|
3526 | secondLength--;
|
3527 | }
|
3528 | let start = 0;
|
3529 | while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) {
|
3530 | start++;
|
3531 | }
|
3532 | firstLength -= start;
|
3533 | secondLength -= start;
|
3534 | if (firstLength === 0) {
|
3535 | return secondLength;
|
3536 | }
|
3537 | let bCharacterCode;
|
3538 | let result;
|
3539 | let temporary;
|
3540 | let temporary2;
|
3541 | let index = 0;
|
3542 | let index2 = 0;
|
3543 | while (index < firstLength) {
|
3544 | characterCodeCache[index] = first.charCodeAt(start + index);
|
3545 | array[index] = ++index;
|
3546 | }
|
3547 | while (index2 < secondLength) {
|
3548 | bCharacterCode = second.charCodeAt(start + index2);
|
3549 | temporary = index2++;
|
3550 | result = index2;
|
3551 | for (index = 0; index < firstLength; index++) {
|
3552 | temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1;
|
3553 | temporary = array[index];
|
3554 | result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2;
|
3555 | }
|
3556 | }
|
3557 | return result;
|
3558 | }
|
3559 | var array;
|
3560 | var characterCodeCache;
|
3561 | var init_leven = __esm({
|
3562 | "node_modules/leven/index.js"() {
|
3563 | array = [];
|
3564 | characterCodeCache = [];
|
3565 | }
|
3566 | });
|
3567 | var require_normalize_cli_options = __commonJS2({
|
3568 | "src/cli/options/normalize-cli-options.js"(exports2, module2) {
|
3569 | "use strict";
|
3570 | var {
|
3571 | default: chalk2
|
3572 | } = (init_source(), __toCommonJS(source_exports));
|
3573 | var {
|
3574 | default: leven2
|
3575 | } = (init_leven(), __toCommonJS(leven_exports));
|
3576 | var {
|
3577 | optionsNormalizer
|
3578 | } = require_prettier_internal();
|
3579 | function normalizeCliOptions(options, optionInfos, opts) {
|
3580 | return optionsNormalizer.normalizeCliOptions(options, optionInfos, Object.assign({
|
3581 | colorsModule: chalk2,
|
3582 | levenshteinDistance: leven2
|
3583 | }, opts));
|
3584 | }
|
3585 | module2.exports = normalizeCliOptions;
|
3586 | }
|
3587 | });
|
3588 | var require_parse_cli_arguments = __commonJS2({
|
3589 | "src/cli/options/parse-cli-arguments.js"(exports2, module2) {
|
3590 | "use strict";
|
3591 | var camelCase = require_camelcase();
|
3592 | var {
|
3593 | pick
|
3594 | } = require_utils();
|
3595 | var getContextOptions = require_get_context_options();
|
3596 | var minimist = require_minimist2();
|
3597 | var createMinimistOptions = require_create_minimist_options();
|
3598 | var normalizeCliOptions = require_normalize_cli_options();
|
3599 | function parseArgv(rawArguments, detailedOptions, logger, keys) {
|
3600 | const minimistOptions = createMinimistOptions(detailedOptions);
|
3601 | let argv = minimist(rawArguments, minimistOptions);
|
3602 | if (keys) {
|
3603 | if (keys.includes("plugin-search-dir") && !keys.includes("plugin-search")) {
|
3604 | keys.push("plugin-search");
|
3605 | }
|
3606 | detailedOptions = detailedOptions.filter((option) => keys.includes(option.name));
|
3607 | argv = pick(argv, keys);
|
3608 | }
|
3609 | const normalized = normalizeCliOptions(argv, detailedOptions, {
|
3610 | logger
|
3611 | });
|
3612 | return Object.assign(Object.assign({}, Object.fromEntries(Object.entries(normalized).map(([key, value]) => {
|
3613 | const option = detailedOptions.find(({
|
3614 | name
|
3615 | }) => name === key) || {};
|
3616 | return [option.forwardToApi || camelCase(key), value];
|
3617 | }))), {}, {
|
3618 | get __raw() {
|
3619 | return argv;
|
3620 | }
|
3621 | });
|
3622 | }
|
3623 | var detailedOptionsWithoutPlugins = getContextOptions([], false).detailedOptions;
|
3624 | function parseArgvWithoutPlugins2(rawArguments, logger, keys) {
|
3625 | return parseArgv(rawArguments, detailedOptionsWithoutPlugins, logger, typeof keys === "string" ? [keys] : keys);
|
3626 | }
|
3627 | module2.exports = {
|
3628 | parseArgv,
|
3629 | parseArgvWithoutPlugins: parseArgvWithoutPlugins2
|
3630 | };
|
3631 | }
|
3632 | });
|
3633 | var require_context = __commonJS2({
|
3634 | "src/cli/context.js"(exports2, module2) {
|
3635 | "use strict";
|
3636 | var {
|
3637 | utils: {
|
3638 | getLast
|
3639 | }
|
3640 | } = require_prettier_internal();
|
3641 | var getContextOptions = require_get_context_options();
|
3642 | var {
|
3643 | parseArgv,
|
3644 | parseArgvWithoutPlugins: parseArgvWithoutPlugins2
|
3645 | } = require_parse_cli_arguments();
|
3646 | var Context2 = class {
|
3647 | constructor({
|
3648 | rawArguments,
|
3649 | logger
|
3650 | }) {
|
3651 | this.rawArguments = rawArguments;
|
3652 | this.logger = logger;
|
3653 | this.stack = [];
|
3654 | const {
|
3655 | plugins,
|
3656 | pluginSearchDirs
|
3657 | } = parseArgvWithoutPlugins2(rawArguments, logger, ["plugin", "plugin-search-dir"]);
|
3658 | this.pushContextPlugins(plugins, pluginSearchDirs);
|
3659 | const argv = parseArgv(rawArguments, this.detailedOptions, logger);
|
3660 | this.argv = argv;
|
3661 | this.filePatterns = argv._.map(String);
|
3662 | }
|
3663 | pushContextPlugins(plugins, pluginSearchDirs) {
|
3664 | const options = getContextOptions(plugins, pluginSearchDirs);
|
3665 | this.stack.push(options);
|
3666 | Object.assign(this, options);
|
3667 | }
|
3668 | popContextPlugins() {
|
3669 | this.stack.pop();
|
3670 | Object.assign(this, getLast(this.stack));
|
3671 | }
|
3672 | get performanceTestFlag() {
|
3673 | const {
|
3674 | debugBenchmark,
|
3675 | debugRepeat
|
3676 | } = this.argv;
|
3677 | if (debugBenchmark) {
|
3678 | return {
|
3679 | name: "--debug-benchmark",
|
3680 | debugBenchmark: true
|
3681 | };
|
3682 | }
|
3683 | if (debugRepeat > 0) {
|
3684 | return {
|
3685 | name: "--debug-repeat",
|
3686 | debugRepeat
|
3687 | };
|
3688 | }
|
3689 | const {
|
3690 | PRETTIER_PERF_REPEAT
|
3691 | } = process.env;
|
3692 | if (PRETTIER_PERF_REPEAT && /^\d+$/.test(PRETTIER_PERF_REPEAT)) {
|
3693 | return {
|
3694 | name: "PRETTIER_PERF_REPEAT (environment variable)",
|
3695 | debugRepeat: Number(PRETTIER_PERF_REPEAT)
|
3696 | };
|
3697 | }
|
3698 | }
|
3699 | };
|
3700 | module2.exports = Context2;
|
3701 | }
|
3702 | });
|
3703 | var require_usage = __commonJS2({
|
3704 | "src/cli/usage.js"(exports2, module2) {
|
3705 | "use strict";
|
3706 | var camelCase = require_camelcase();
|
3707 | var constant = require_constant();
|
3708 | var {
|
3709 | groupBy
|
3710 | } = require_utils();
|
3711 | var OPTION_USAGE_THRESHOLD = 25;
|
3712 | var CHOICE_USAGE_MARGIN = 3;
|
3713 | var CHOICE_USAGE_INDENTATION = 2;
|
3714 | function indent(str, spaces) {
|
3715 | return str.replace(/^/gm, " ".repeat(spaces));
|
3716 | }
|
3717 | function createDefaultValueDisplay(value) {
|
3718 | return Array.isArray(value) ? `[${value.map(createDefaultValueDisplay).join(", ")}]` : value;
|
3719 | }
|
3720 | function getOptionDefaultValue(context, optionName) {
|
3721 | if (!(optionName in context.detailedOptionMap)) {
|
3722 | return;
|
3723 | }
|
3724 | const option = context.detailedOptionMap[optionName];
|
3725 | if (option.default !== void 0) {
|
3726 | return option.default;
|
3727 | }
|
3728 | const optionCamelName = camelCase(optionName);
|
3729 | if (optionCamelName in context.apiDefaultOptions) {
|
3730 | return context.apiDefaultOptions[optionCamelName];
|
3731 | }
|
3732 | }
|
3733 | function createOptionUsageHeader(option) {
|
3734 | const name = `--${option.name}`;
|
3735 | const alias = option.alias ? `-${option.alias},` : null;
|
3736 | const type = createOptionUsageType(option);
|
3737 | return [alias, name, type].filter(Boolean).join(" ");
|
3738 | }
|
3739 | function createOptionUsageRow(header, content, threshold) {
|
3740 | const separator = header.length >= threshold ? `
|
3741 | ${" ".repeat(threshold)}` : " ".repeat(threshold - header.length);
|
3742 | const description = content.replace(/\n/g, `
|
3743 | ${" ".repeat(threshold)}`);
|
3744 | return `${header}${separator}${description}`;
|
3745 | }
|
3746 | function createOptionUsageType(option) {
|
3747 | switch (option.type) {
|
3748 | case "boolean":
|
3749 | return null;
|
3750 | case "choice":
|
3751 | return `<${option.choices.filter((choice) => !choice.deprecated && choice.since !== null).map((choice) => choice.value).join("|")}>`;
|
3752 | default:
|
3753 | return `<${option.type}>`;
|
3754 | }
|
3755 | }
|
3756 | function createChoiceUsages(choices, margin, indentation) {
|
3757 | const activeChoices = choices.filter((choice) => !choice.deprecated && choice.since !== null);
|
3758 | const threshold = Math.max(0, ...activeChoices.map((choice) => choice.value.length)) + margin;
|
3759 | return activeChoices.map((choice) => indent(createOptionUsageRow(choice.value, choice.description, threshold), indentation));
|
3760 | }
|
3761 | function createOptionUsage(context, option, threshold) {
|
3762 | const header = createOptionUsageHeader(option);
|
3763 | const optionDefaultValue = getOptionDefaultValue(context, option.name);
|
3764 | return createOptionUsageRow(header, `${option.description}${optionDefaultValue === void 0 ? "" : `
|
3765 | Defaults to ${createDefaultValueDisplay(optionDefaultValue)}.`}`, threshold);
|
3766 | }
|
3767 | function getOptionsWithOpposites(options) {
|
3768 | const optionsWithOpposites = options.map((option) => [option.description ? option : null, option.oppositeDescription ? Object.assign(Object.assign({}, option), {}, {
|
3769 | name: `no-${option.name}`,
|
3770 | type: "boolean",
|
3771 | description: option.oppositeDescription
|
3772 | }) : null]);
|
3773 | return optionsWithOpposites.flat().filter(Boolean);
|
3774 | }
|
3775 | function createUsage2(context) {
|
3776 | const options = getOptionsWithOpposites(context.detailedOptions).filter((option) => !(option.type === "boolean" && option.oppositeDescription && !option.name.startsWith("no-")));
|
3777 | const groupedOptions = groupBy(options, (option) => option.category);
|
3778 | const firstCategories = constant.categoryOrder.slice(0, -1);
|
3779 | const lastCategories = constant.categoryOrder.slice(-1);
|
3780 | const restCategories = Object.keys(groupedOptions).filter((category) => !constant.categoryOrder.includes(category));
|
3781 | const allCategories = [...firstCategories, ...restCategories, ...lastCategories];
|
3782 | const optionsUsage = allCategories.map((category) => {
|
3783 | const categoryOptions = groupedOptions[category].map((option) => createOptionUsage(context, option, OPTION_USAGE_THRESHOLD)).join("\n");
|
3784 | return `${category} options:
|
3785 |
|
3786 | ${indent(categoryOptions, 2)}`;
|
3787 | });
|
3788 | return [constant.usageSummary, ...optionsUsage, ""].join("\n\n");
|
3789 | }
|
3790 | function createDetailedUsage2(context, flag) {
|
3791 | const option = getOptionsWithOpposites(context.detailedOptions).find((option2) => option2.name === flag || option2.alias === flag);
|
3792 | const header = createOptionUsageHeader(option);
|
3793 | const description = `
|
3794 |
|
3795 | ${indent(option.description, 2)}`;
|
3796 | const choices = option.type !== "choice" ? "" : `
|
3797 |
|
3798 | Valid options:
|
3799 |
|
3800 | ${createChoiceUsages(option.choices, CHOICE_USAGE_MARGIN, CHOICE_USAGE_INDENTATION).join("\n")}`;
|
3801 | const optionDefaultValue = getOptionDefaultValue(context, option.name);
|
3802 | const defaults = optionDefaultValue !== void 0 ? `
|
3803 |
|
3804 | Default: ${createDefaultValueDisplay(optionDefaultValue)}` : "";
|
3805 | const pluginDefaults = option.pluginDefaults && Object.keys(option.pluginDefaults).length > 0 ? `
|
3806 | Plugin defaults:${Object.entries(option.pluginDefaults).map(([key, value]) => `
|
3807 | * ${key}: ${createDefaultValueDisplay(value)}`)}` : "";
|
3808 | return `${header}${description}${choices}${defaults}${pluginDefaults}`;
|
3809 | }
|
3810 | module2.exports = {
|
3811 | createUsage: createUsage2,
|
3812 | createDetailedUsage: createDetailedUsage2
|
3813 | };
|
3814 | }
|
3815 | });
|
3816 | var require_array = __commonJS2({
|
3817 | "node_modules/fast-glob/out/utils/array.js"(exports2) {
|
3818 | "use strict";
|
3819 | Object.defineProperty(exports2, "__esModule", {
|
3820 | value: true
|
3821 | });
|
3822 | exports2.splitWhen = exports2.flatten = void 0;
|
3823 | function flatten(items) {
|
3824 | return items.reduce((collection, item) => [].concat(collection, item), []);
|
3825 | }
|
3826 | exports2.flatten = flatten;
|
3827 | function splitWhen(items, predicate) {
|
3828 | const result = [[]];
|
3829 | let groupIndex = 0;
|
3830 | for (const item of items) {
|
3831 | if (predicate(item)) {
|
3832 | groupIndex++;
|
3833 | result[groupIndex] = [];
|
3834 | } else {
|
3835 | result[groupIndex].push(item);
|
3836 | }
|
3837 | }
|
3838 | return result;
|
3839 | }
|
3840 | exports2.splitWhen = splitWhen;
|
3841 | }
|
3842 | });
|
3843 | var require_errno = __commonJS2({
|
3844 | "node_modules/fast-glob/out/utils/errno.js"(exports2) {
|
3845 | "use strict";
|
3846 | Object.defineProperty(exports2, "__esModule", {
|
3847 | value: true
|
3848 | });
|
3849 | exports2.isEnoentCodeError = void 0;
|
3850 | function isEnoentCodeError(error) {
|
3851 | return error.code === "ENOENT";
|
3852 | }
|
3853 | exports2.isEnoentCodeError = isEnoentCodeError;
|
3854 | }
|
3855 | });
|
3856 | var require_fs = __commonJS2({
|
3857 | "node_modules/fast-glob/out/utils/fs.js"(exports2) {
|
3858 | "use strict";
|
3859 | Object.defineProperty(exports2, "__esModule", {
|
3860 | value: true
|
3861 | });
|
3862 | exports2.createDirentFromStats = void 0;
|
3863 | var DirentFromStats = class {
|
3864 | constructor(name, stats) {
|
3865 | this.name = name;
|
3866 | this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
3867 | this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
3868 | this.isDirectory = stats.isDirectory.bind(stats);
|
3869 | this.isFIFO = stats.isFIFO.bind(stats);
|
3870 | this.isFile = stats.isFile.bind(stats);
|
3871 | this.isSocket = stats.isSocket.bind(stats);
|
3872 | this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
3873 | }
|
3874 | };
|
3875 | function createDirentFromStats(name, stats) {
|
3876 | return new DirentFromStats(name, stats);
|
3877 | }
|
3878 | exports2.createDirentFromStats = createDirentFromStats;
|
3879 | }
|
3880 | });
|
3881 | var require_path = __commonJS2({
|
3882 | "node_modules/fast-glob/out/utils/path.js"(exports2) {
|
3883 | "use strict";
|
3884 | Object.defineProperty(exports2, "__esModule", {
|
3885 | value: true
|
3886 | });
|
3887 | exports2.removeLeadingDotSegment = exports2.escape = exports2.makeAbsolute = exports2.unixify = void 0;
|
3888 | var path = require("path");
|
3889 | var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
3890 | var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
3891 | function unixify(filepath) {
|
3892 | return filepath.replace(/\\/g, "/");
|
3893 | }
|
3894 | exports2.unixify = unixify;
|
3895 | function makeAbsolute(cwd, filepath) {
|
3896 | return path.resolve(cwd, filepath);
|
3897 | }
|
3898 | exports2.makeAbsolute = makeAbsolute;
|
3899 | function escape(pattern) {
|
3900 | return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
|
3901 | }
|
3902 | exports2.escape = escape;
|
3903 | function removeLeadingDotSegment(entry) {
|
3904 | if (entry.charAt(0) === ".") {
|
3905 | const secondCharactery = entry.charAt(1);
|
3906 | if (secondCharactery === "/" || secondCharactery === "\\") {
|
3907 | return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
|
3908 | }
|
3909 | }
|
3910 | return entry;
|
3911 | }
|
3912 | exports2.removeLeadingDotSegment = removeLeadingDotSegment;
|
3913 | }
|
3914 | });
|
3915 | var require_is_extglob = __commonJS2({
|
3916 | "node_modules/is-extglob/index.js"(exports2, module2) {
|
3917 | module2.exports = function isExtglob(str) {
|
3918 | if (typeof str !== "string" || str === "") {
|
3919 | return false;
|
3920 | }
|
3921 | var match;
|
3922 | while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
|
3923 | if (match[2])
|
3924 | return true;
|
3925 | str = str.slice(match.index + match[0].length);
|
3926 | }
|
3927 | return false;
|
3928 | };
|
3929 | }
|
3930 | });
|
3931 | var require_is_glob = __commonJS2({
|
3932 | "node_modules/is-glob/index.js"(exports2, module2) {
|
3933 | var isExtglob = require_is_extglob();
|
3934 | var chars = {
|
3935 | "{": "}",
|
3936 | "(": ")",
|
3937 | "[": "]"
|
3938 | };
|
3939 | var strictCheck = function(str) {
|
3940 | if (str[0] === "!") {
|
3941 | return true;
|
3942 | }
|
3943 | var index = 0;
|
3944 | var pipeIndex = -2;
|
3945 | var closeSquareIndex = -2;
|
3946 | var closeCurlyIndex = -2;
|
3947 | var closeParenIndex = -2;
|
3948 | var backSlashIndex = -2;
|
3949 | while (index < str.length) {
|
3950 | if (str[index] === "*") {
|
3951 | return true;
|
3952 | }
|
3953 | if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
|
3954 | return true;
|
3955 | }
|
3956 | if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
|
3957 | if (closeSquareIndex < index) {
|
3958 | closeSquareIndex = str.indexOf("]", index);
|
3959 | }
|
3960 | if (closeSquareIndex > index) {
|
3961 | if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
|
3962 | return true;
|
3963 | }
|
3964 | backSlashIndex = str.indexOf("\\", index);
|
3965 | if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
|
3966 | return true;
|
3967 | }
|
3968 | }
|
3969 | }
|
3970 | if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
|
3971 | closeCurlyIndex = str.indexOf("}", index);
|
3972 | if (closeCurlyIndex > index) {
|
3973 | backSlashIndex = str.indexOf("\\", index);
|
3974 | if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
|
3975 | return true;
|
3976 | }
|
3977 | }
|
3978 | }
|
3979 | if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
|
3980 | closeParenIndex = str.indexOf(")", index);
|
3981 | if (closeParenIndex > index) {
|
3982 | backSlashIndex = str.indexOf("\\", index);
|
3983 | if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
|
3984 | return true;
|
3985 | }
|
3986 | }
|
3987 | }
|
3988 | if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
|
3989 | if (pipeIndex < index) {
|
3990 | pipeIndex = str.indexOf("|", index);
|
3991 | }
|
3992 | if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
|
3993 | closeParenIndex = str.indexOf(")", pipeIndex);
|
3994 | if (closeParenIndex > pipeIndex) {
|
3995 | backSlashIndex = str.indexOf("\\", pipeIndex);
|
3996 | if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
|
3997 | return true;
|
3998 | }
|
3999 | }
|
4000 | }
|
4001 | }
|
4002 | if (str[index] === "\\") {
|
4003 | var open = str[index + 1];
|
4004 | index += 2;
|
4005 | var close = chars[open];
|
4006 | if (close) {
|
4007 | var n = str.indexOf(close, index);
|
4008 | if (n !== -1) {
|
4009 | index = n + 1;
|
4010 | }
|
4011 | }
|
4012 | if (str[index] === "!") {
|
4013 | return true;
|
4014 | }
|
4015 | } else {
|
4016 | index++;
|
4017 | }
|
4018 | }
|
4019 | return false;
|
4020 | };
|
4021 | var relaxedCheck = function(str) {
|
4022 | if (str[0] === "!") {
|
4023 | return true;
|
4024 | }
|
4025 | var index = 0;
|
4026 | while (index < str.length) {
|
4027 | if (/[*?{}()[\]]/.test(str[index])) {
|
4028 | return true;
|
4029 | }
|
4030 | if (str[index] === "\\") {
|
4031 | var open = str[index + 1];
|
4032 | index += 2;
|
4033 | var close = chars[open];
|
4034 | if (close) {
|
4035 | var n = str.indexOf(close, index);
|
4036 | if (n !== -1) {
|
4037 | index = n + 1;
|
4038 | }
|
4039 | }
|
4040 | if (str[index] === "!") {
|
4041 | return true;
|
4042 | }
|
4043 | } else {
|
4044 | index++;
|
4045 | }
|
4046 | }
|
4047 | return false;
|
4048 | };
|
4049 | module2.exports = function isGlob(str, options) {
|
4050 | if (typeof str !== "string" || str === "") {
|
4051 | return false;
|
4052 | }
|
4053 | if (isExtglob(str)) {
|
4054 | return true;
|
4055 | }
|
4056 | var check = strictCheck;
|
4057 | if (options && options.strict === false) {
|
4058 | check = relaxedCheck;
|
4059 | }
|
4060 | return check(str);
|
4061 | };
|
4062 | }
|
4063 | });
|
4064 | var require_glob_parent = __commonJS2({
|
4065 | "node_modules/glob-parent/index.js"(exports2, module2) {
|
4066 | "use strict";
|
4067 | var isGlob = require_is_glob();
|
4068 | var pathPosixDirname = require("path").posix.dirname;
|
4069 | var isWin32 = require("os").platform() === "win32";
|
4070 | var slash = "/";
|
4071 | var backslash = /\\/g;
|
4072 | var enclosure = /[\{\[].*[\}\]]$/;
|
4073 | var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
4074 | var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
4075 | module2.exports = function globParent(str, opts) {
|
4076 | var options = Object.assign({
|
4077 | flipBackslashes: true
|
4078 | }, opts);
|
4079 | if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
4080 | str = str.replace(backslash, slash);
|
4081 | }
|
4082 | if (enclosure.test(str)) {
|
4083 | str += slash;
|
4084 | }
|
4085 | str += "a";
|
4086 | do {
|
4087 | str = pathPosixDirname(str);
|
4088 | } while (isGlob(str) || globby.test(str));
|
4089 | return str.replace(escaped, "$1");
|
4090 | };
|
4091 | }
|
4092 | });
|
4093 | var require_utils2 = __commonJS2({
|
4094 | "node_modules/braces/lib/utils.js"(exports2) {
|
4095 | "use strict";
|
4096 | exports2.isInteger = (num) => {
|
4097 | if (typeof num === "number") {
|
4098 | return Number.isInteger(num);
|
4099 | }
|
4100 | if (typeof num === "string" && num.trim() !== "") {
|
4101 | return Number.isInteger(Number(num));
|
4102 | }
|
4103 | return false;
|
4104 | };
|
4105 | exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
|
4106 | exports2.exceedsLimit = (min, max, step = 1, limit) => {
|
4107 | if (limit === false)
|
4108 | return false;
|
4109 | if (!exports2.isInteger(min) || !exports2.isInteger(max))
|
4110 | return false;
|
4111 | return (Number(max) - Number(min)) / Number(step) >= limit;
|
4112 | };
|
4113 | exports2.escapeNode = (block, n = 0, type) => {
|
4114 | let node = block.nodes[n];
|
4115 | if (!node)
|
4116 | return;
|
4117 | if (type && node.type === type || node.type === "open" || node.type === "close") {
|
4118 | if (node.escaped !== true) {
|
4119 | node.value = "\\" + node.value;
|
4120 | node.escaped = true;
|
4121 | }
|
4122 | }
|
4123 | };
|
4124 | exports2.encloseBrace = (node) => {
|
4125 | if (node.type !== "brace")
|
4126 | return false;
|
4127 | if (node.commas >> 0 + node.ranges >> 0 === 0) {
|
4128 | node.invalid = true;
|
4129 | return true;
|
4130 | }
|
4131 | return false;
|
4132 | };
|
4133 | exports2.isInvalidBrace = (block) => {
|
4134 | if (block.type !== "brace")
|
4135 | return false;
|
4136 | if (block.invalid === true || block.dollar)
|
4137 | return true;
|
4138 | if (block.commas >> 0 + block.ranges >> 0 === 0) {
|
4139 | block.invalid = true;
|
4140 | return true;
|
4141 | }
|
4142 | if (block.open !== true || block.close !== true) {
|
4143 | block.invalid = true;
|
4144 | return true;
|
4145 | }
|
4146 | return false;
|
4147 | };
|
4148 | exports2.isOpenOrClose = (node) => {
|
4149 | if (node.type === "open" || node.type === "close") {
|
4150 | return true;
|
4151 | }
|
4152 | return node.open === true || node.close === true;
|
4153 | };
|
4154 | exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
|
4155 | if (node.type === "text")
|
4156 | acc.push(node.value);
|
4157 | if (node.type === "range")
|
4158 | node.type = "text";
|
4159 | return acc;
|
4160 | }, []);
|
4161 | exports2.flatten = (...args) => {
|
4162 | const result = [];
|
4163 | const flat = (arr) => {
|
4164 | for (let i = 0; i < arr.length; i++) {
|
4165 | let ele = arr[i];
|
4166 | Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
|
4167 | }
|
4168 | return result;
|
4169 | };
|
4170 | flat(args);
|
4171 | return result;
|
4172 | };
|
4173 | }
|
4174 | });
|
4175 | var require_stringify = __commonJS2({
|
4176 | "node_modules/braces/lib/stringify.js"(exports2, module2) {
|
4177 | "use strict";
|
4178 | var utils = require_utils2();
|
4179 | module2.exports = (ast, options = {}) => {
|
4180 | let stringify2 = (node, parent = {}) => {
|
4181 | let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
4182 | let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
4183 | let output = "";
|
4184 | if (node.value) {
|
4185 | if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
4186 | return "\\" + node.value;
|
4187 | }
|
4188 | return node.value;
|
4189 | }
|
4190 | if (node.value) {
|
4191 | return node.value;
|
4192 | }
|
4193 | if (node.nodes) {
|
4194 | for (let child of node.nodes) {
|
4195 | output += stringify2(child);
|
4196 | }
|
4197 | }
|
4198 | return output;
|
4199 | };
|
4200 | return stringify2(ast);
|
4201 | };
|
4202 | }
|
4203 | });
|
4204 | var require_is_number = __commonJS2({
|
4205 | "node_modules/is-number/index.js"(exports2, module2) {
|
4206 | "use strict";
|
4207 | module2.exports = function(num) {
|
4208 | if (typeof num === "number") {
|
4209 | return num - num === 0;
|
4210 | }
|
4211 | if (typeof num === "string" && num.trim() !== "") {
|
4212 | return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
4213 | }
|
4214 | return false;
|
4215 | };
|
4216 | }
|
4217 | });
|
4218 | var require_to_regex_range = __commonJS2({
|
4219 | "node_modules/to-regex-range/index.js"(exports2, module2) {
|
4220 | "use strict";
|
4221 | var isNumber = require_is_number();
|
4222 | var toRegexRange = (min, max, options) => {
|
4223 | if (isNumber(min) === false) {
|
4224 | throw new TypeError("toRegexRange: expected the first argument to be a number");
|
4225 | }
|
4226 | if (max === void 0 || min === max) {
|
4227 | return String(min);
|
4228 | }
|
4229 | if (isNumber(max) === false) {
|
4230 | throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
4231 | }
|
4232 | let opts = Object.assign({
|
4233 | relaxZeros: true
|
4234 | }, options);
|
4235 | if (typeof opts.strictZeros === "boolean") {
|
4236 | opts.relaxZeros = opts.strictZeros === false;
|
4237 | }
|
4238 | let relax = String(opts.relaxZeros);
|
4239 | let shorthand = String(opts.shorthand);
|
4240 | let capture = String(opts.capture);
|
4241 | let wrap = String(opts.wrap);
|
4242 | let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
|
4243 | if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
4244 | return toRegexRange.cache[cacheKey].result;
|
4245 | }
|
4246 | let a = Math.min(min, max);
|
4247 | let b = Math.max(min, max);
|
4248 | if (Math.abs(a - b) === 1) {
|
4249 | let result = min + "|" + max;
|
4250 | if (opts.capture) {
|
4251 | return `(${result})`;
|
4252 | }
|
4253 | if (opts.wrap === false) {
|
4254 | return result;
|
4255 | }
|
4256 | return `(?:${result})`;
|
4257 | }
|
4258 | let isPadded = hasPadding(min) || hasPadding(max);
|
4259 | let state = {
|
4260 | min,
|
4261 | max,
|
4262 | a,
|
4263 | b
|
4264 | };
|
4265 | let positives = [];
|
4266 | let negatives = [];
|
4267 | if (isPadded) {
|
4268 | state.isPadded = isPadded;
|
4269 | state.maxLen = String(state.max).length;
|
4270 | }
|
4271 | if (a < 0) {
|
4272 | let newMin = b < 0 ? Math.abs(b) : 1;
|
4273 | negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
|
4274 | a = state.a = 0;
|
4275 | }
|
4276 | if (b >= 0) {
|
4277 | positives = splitToPatterns(a, b, state, opts);
|
4278 | }
|
4279 | state.negatives = negatives;
|
4280 | state.positives = positives;
|
4281 | state.result = collatePatterns(negatives, positives, opts);
|
4282 | if (opts.capture === true) {
|
4283 | state.result = `(${state.result})`;
|
4284 | } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
|
4285 | state.result = `(?:${state.result})`;
|
4286 | }
|
4287 | toRegexRange.cache[cacheKey] = state;
|
4288 | return state.result;
|
4289 | };
|
4290 | function collatePatterns(neg, pos, options) {
|
4291 | let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
|
4292 | let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
|
4293 | let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
|
4294 | let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
|
4295 | return subpatterns.join("|");
|
4296 | }
|
4297 | function splitToRanges(min, max) {
|
4298 | let nines = 1;
|
4299 | let zeros = 1;
|
4300 | let stop = countNines(min, nines);
|
4301 | let stops = new Set([max]);
|
4302 | while (min <= stop && stop <= max) {
|
4303 | stops.add(stop);
|
4304 | nines += 1;
|
4305 | stop = countNines(min, nines);
|
4306 | }
|
4307 | stop = countZeros(max + 1, zeros) - 1;
|
4308 | while (min < stop && stop <= max) {
|
4309 | stops.add(stop);
|
4310 | zeros += 1;
|
4311 | stop = countZeros(max + 1, zeros) - 1;
|
4312 | }
|
4313 | stops = [...stops];
|
4314 | stops.sort(compare);
|
4315 | return stops;
|
4316 | }
|
4317 | function rangeToPattern(start, stop, options) {
|
4318 | if (start === stop) {
|
4319 | return {
|
4320 | pattern: start,
|
4321 | count: [],
|
4322 | digits: 0
|
4323 | };
|
4324 | }
|
4325 | let zipped = zip(start, stop);
|
4326 | let digits = zipped.length;
|
4327 | let pattern = "";
|
4328 | let count = 0;
|
4329 | for (let i = 0; i < digits; i++) {
|
4330 | let [startDigit, stopDigit] = zipped[i];
|
4331 | if (startDigit === stopDigit) {
|
4332 | pattern += startDigit;
|
4333 | } else if (startDigit !== "0" || stopDigit !== "9") {
|
4334 | pattern += toCharacterClass(startDigit, stopDigit, options);
|
4335 | } else {
|
4336 | count++;
|
4337 | }
|
4338 | }
|
4339 | if (count) {
|
4340 | pattern += options.shorthand === true ? "\\d" : "[0-9]";
|
4341 | }
|
4342 | return {
|
4343 | pattern,
|
4344 | count: [count],
|
4345 | digits
|
4346 | };
|
4347 | }
|
4348 | function splitToPatterns(min, max, tok, options) {
|
4349 | let ranges = splitToRanges(min, max);
|
4350 | let tokens = [];
|
4351 | let start = min;
|
4352 | let prev;
|
4353 | for (let i = 0; i < ranges.length; i++) {
|
4354 | let max2 = ranges[i];
|
4355 | let obj = rangeToPattern(String(start), String(max2), options);
|
4356 | let zeros = "";
|
4357 | if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
4358 | if (prev.count.length > 1) {
|
4359 | prev.count.pop();
|
4360 | }
|
4361 | prev.count.push(obj.count[0]);
|
4362 | prev.string = prev.pattern + toQuantifier(prev.count);
|
4363 | start = max2 + 1;
|
4364 | continue;
|
4365 | }
|
4366 | if (tok.isPadded) {
|
4367 | zeros = padZeros(max2, tok, options);
|
4368 | }
|
4369 | obj.string = zeros + obj.pattern + toQuantifier(obj.count);
|
4370 | tokens.push(obj);
|
4371 | start = max2 + 1;
|
4372 | prev = obj;
|
4373 | }
|
4374 | return tokens;
|
4375 | }
|
4376 | function filterPatterns(arr, comparison, prefix, intersection, options) {
|
4377 | let result = [];
|
4378 | for (let ele of arr) {
|
4379 | let {
|
4380 | string
|
4381 | } = ele;
|
4382 | if (!intersection && !contains(comparison, "string", string)) {
|
4383 | result.push(prefix + string);
|
4384 | }
|
4385 | if (intersection && contains(comparison, "string", string)) {
|
4386 | result.push(prefix + string);
|
4387 | }
|
4388 | }
|
4389 | return result;
|
4390 | }
|
4391 | function zip(a, b) {
|
4392 | let arr = [];
|
4393 | for (let i = 0; i < a.length; i++)
|
4394 | arr.push([a[i], b[i]]);
|
4395 | return arr;
|
4396 | }
|
4397 | function compare(a, b) {
|
4398 | return a > b ? 1 : b > a ? -1 : 0;
|
4399 | }
|
4400 | function contains(arr, key, val) {
|
4401 | return arr.some((ele) => ele[key] === val);
|
4402 | }
|
4403 | function countNines(min, len) {
|
4404 | return Number(String(min).slice(0, -len) + "9".repeat(len));
|
4405 | }
|
4406 | function countZeros(integer, zeros) {
|
4407 | return integer - integer % Math.pow(10, zeros);
|
4408 | }
|
4409 | function toQuantifier(digits) {
|
4410 | let [start = 0, stop = ""] = digits;
|
4411 | if (stop || start > 1) {
|
4412 | return `{${start + (stop ? "," + stop : "")}}`;
|
4413 | }
|
4414 | return "";
|
4415 | }
|
4416 | function toCharacterClass(a, b, options) {
|
4417 | return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
|
4418 | }
|
4419 | function hasPadding(str) {
|
4420 | return /^-?(0+)\d/.test(str);
|
4421 | }
|
4422 | function padZeros(value, tok, options) {
|
4423 | if (!tok.isPadded) {
|
4424 | return value;
|
4425 | }
|
4426 | let diff = Math.abs(tok.maxLen - String(value).length);
|
4427 | let relax = options.relaxZeros !== false;
|
4428 | switch (diff) {
|
4429 | case 0:
|
4430 | return "";
|
4431 | case 1:
|
4432 | return relax ? "0?" : "0";
|
4433 | case 2:
|
4434 | return relax ? "0{0,2}" : "00";
|
4435 | default: {
|
4436 | return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
4437 | }
|
4438 | }
|
4439 | }
|
4440 | toRegexRange.cache = {};
|
4441 | toRegexRange.clearCache = () => toRegexRange.cache = {};
|
4442 | module2.exports = toRegexRange;
|
4443 | }
|
4444 | });
|
4445 | var require_fill_range = __commonJS2({
|
4446 | "node_modules/fill-range/index.js"(exports2, module2) {
|
4447 | "use strict";
|
4448 | var util = require("util");
|
4449 | var toRegexRange = require_to_regex_range();
|
4450 | var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
4451 | var transform = (toNumber) => {
|
4452 | return (value) => toNumber === true ? Number(value) : String(value);
|
4453 | };
|
4454 | var isValidValue = (value) => {
|
4455 | return typeof value === "number" || typeof value === "string" && value !== "";
|
4456 | };
|
4457 | var isNumber = (num) => Number.isInteger(+num);
|
4458 | var zeros = (input) => {
|
4459 | let value = `${input}`;
|
4460 | let index = -1;
|
4461 | if (value[0] === "-")
|
4462 | value = value.slice(1);
|
4463 | if (value === "0")
|
4464 | return false;
|
4465 | while (value[++index] === "0")
|
4466 | ;
|
4467 | return index > 0;
|
4468 | };
|
4469 | var stringify2 = (start, end, options) => {
|
4470 | if (typeof start === "string" || typeof end === "string") {
|
4471 | return true;
|
4472 | }
|
4473 | return options.stringify === true;
|
4474 | };
|
4475 | var pad = (input, maxLength, toNumber) => {
|
4476 | if (maxLength > 0) {
|
4477 | let dash = input[0] === "-" ? "-" : "";
|
4478 | if (dash)
|
4479 | input = input.slice(1);
|
4480 | input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
|
4481 | }
|
4482 | if (toNumber === false) {
|
4483 | return String(input);
|
4484 | }
|
4485 | return input;
|
4486 | };
|
4487 | var toMaxLen = (input, maxLength) => {
|
4488 | let negative = input[0] === "-" ? "-" : "";
|
4489 | if (negative) {
|
4490 | input = input.slice(1);
|
4491 | maxLength--;
|
4492 | }
|
4493 | while (input.length < maxLength)
|
4494 | input = "0" + input;
|
4495 | return negative ? "-" + input : input;
|
4496 | };
|
4497 | var toSequence = (parts, options) => {
|
4498 | parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
4499 | parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
4500 | let prefix = options.capture ? "" : "?:";
|
4501 | let positives = "";
|
4502 | let negatives = "";
|
4503 | let result;
|
4504 | if (parts.positives.length) {
|
4505 | positives = parts.positives.join("|");
|
4506 | }
|
4507 | if (parts.negatives.length) {
|
4508 | negatives = `-(${prefix}${parts.negatives.join("|")})`;
|
4509 | }
|
4510 | if (positives && negatives) {
|
4511 | result = `${positives}|${negatives}`;
|
4512 | } else {
|
4513 | result = positives || negatives;
|
4514 | }
|
4515 | if (options.wrap) {
|
4516 | return `(${prefix}${result})`;
|
4517 | }
|
4518 | return result;
|
4519 | };
|
4520 | var toRange = (a, b, isNumbers, options) => {
|
4521 | if (isNumbers) {
|
4522 | return toRegexRange(a, b, Object.assign({
|
4523 | wrap: false
|
4524 | }, options));
|
4525 | }
|
4526 | let start = String.fromCharCode(a);
|
4527 | if (a === b)
|
4528 | return start;
|
4529 | let stop = String.fromCharCode(b);
|
4530 | return `[${start}-${stop}]`;
|
4531 | };
|
4532 | var toRegex = (start, end, options) => {
|
4533 | if (Array.isArray(start)) {
|
4534 | let wrap = options.wrap === true;
|
4535 | let prefix = options.capture ? "" : "?:";
|
4536 | return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
|
4537 | }
|
4538 | return toRegexRange(start, end, options);
|
4539 | };
|
4540 | var rangeError = (...args) => {
|
4541 | return new RangeError("Invalid range arguments: " + util.inspect(...args));
|
4542 | };
|
4543 | var invalidRange = (start, end, options) => {
|
4544 | if (options.strictRanges === true)
|
4545 | throw rangeError([start, end]);
|
4546 | return [];
|
4547 | };
|
4548 | var invalidStep = (step, options) => {
|
4549 | if (options.strictRanges === true) {
|
4550 | throw new TypeError(`Expected step "${step}" to be a number`);
|
4551 | }
|
4552 | return [];
|
4553 | };
|
4554 | var fillNumbers = (start, end, step = 1, options = {}) => {
|
4555 | let a = Number(start);
|
4556 | let b = Number(end);
|
4557 | if (!Number.isInteger(a) || !Number.isInteger(b)) {
|
4558 | if (options.strictRanges === true)
|
4559 | throw rangeError([start, end]);
|
4560 | return [];
|
4561 | }
|
4562 | if (a === 0)
|
4563 | a = 0;
|
4564 | if (b === 0)
|
4565 | b = 0;
|
4566 | let descending = a > b;
|
4567 | let startString = String(start);
|
4568 | let endString = String(end);
|
4569 | let stepString = String(step);
|
4570 | step = Math.max(Math.abs(step), 1);
|
4571 | let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
4572 | let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
4573 | let toNumber = padded === false && stringify2(start, end, options) === false;
|
4574 | let format = options.transform || transform(toNumber);
|
4575 | if (options.toRegex && step === 1) {
|
4576 | return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
4577 | }
|
4578 | let parts = {
|
4579 | negatives: [],
|
4580 | positives: []
|
4581 | };
|
4582 | let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
4583 | let range = [];
|
4584 | let index = 0;
|
4585 | while (descending ? a >= b : a <= b) {
|
4586 | if (options.toRegex === true && step > 1) {
|
4587 | push(a);
|
4588 | } else {
|
4589 | range.push(pad(format(a, index), maxLen, toNumber));
|
4590 | }
|
4591 | a = descending ? a - step : a + step;
|
4592 | index++;
|
4593 | }
|
4594 | if (options.toRegex === true) {
|
4595 | return step > 1 ? toSequence(parts, options) : toRegex(range, null, Object.assign({
|
4596 | wrap: false
|
4597 | }, options));
|
4598 | }
|
4599 | return range;
|
4600 | };
|
4601 | var fillLetters = (start, end, step = 1, options = {}) => {
|
4602 | if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
4603 | return invalidRange(start, end, options);
|
4604 | }
|
4605 | let format = options.transform || ((val) => String.fromCharCode(val));
|
4606 | let a = `${start}`.charCodeAt(0);
|
4607 | let b = `${end}`.charCodeAt(0);
|
4608 | let descending = a > b;
|
4609 | let min = Math.min(a, b);
|
4610 | let max = Math.max(a, b);
|
4611 | if (options.toRegex && step === 1) {
|
4612 | return toRange(min, max, false, options);
|
4613 | }
|
4614 | let range = [];
|
4615 | let index = 0;
|
4616 | while (descending ? a >= b : a <= b) {
|
4617 | range.push(format(a, index));
|
4618 | a = descending ? a - step : a + step;
|
4619 | index++;
|
4620 | }
|
4621 | if (options.toRegex === true) {
|
4622 | return toRegex(range, null, {
|
4623 | wrap: false,
|
4624 | options
|
4625 | });
|
4626 | }
|
4627 | return range;
|
4628 | };
|
4629 | var fill = (start, end, step, options = {}) => {
|
4630 | if (end == null && isValidValue(start)) {
|
4631 | return [start];
|
4632 | }
|
4633 | if (!isValidValue(start) || !isValidValue(end)) {
|
4634 | return invalidRange(start, end, options);
|
4635 | }
|
4636 | if (typeof step === "function") {
|
4637 | return fill(start, end, 1, {
|
4638 | transform: step
|
4639 | });
|
4640 | }
|
4641 | if (isObject(step)) {
|
4642 | return fill(start, end, 0, step);
|
4643 | }
|
4644 | let opts = Object.assign({}, options);
|
4645 | if (opts.capture === true)
|
4646 | opts.wrap = true;
|
4647 | step = step || opts.step || 1;
|
4648 | if (!isNumber(step)) {
|
4649 | if (step != null && !isObject(step))
|
4650 | return invalidStep(step, opts);
|
4651 | return fill(start, end, 1, step);
|
4652 | }
|
4653 | if (isNumber(start) && isNumber(end)) {
|
4654 | return fillNumbers(start, end, step, opts);
|
4655 | }
|
4656 | return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
4657 | };
|
4658 | module2.exports = fill;
|
4659 | }
|
4660 | });
|
4661 | var require_compile = __commonJS2({
|
4662 | "node_modules/braces/lib/compile.js"(exports2, module2) {
|
4663 | "use strict";
|
4664 | var fill = require_fill_range();
|
4665 | var utils = require_utils2();
|
4666 | var compile = (ast, options = {}) => {
|
4667 | let walk = (node, parent = {}) => {
|
4668 | let invalidBlock = utils.isInvalidBrace(parent);
|
4669 | let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
4670 | let invalid = invalidBlock === true || invalidNode === true;
|
4671 | let prefix = options.escapeInvalid === true ? "\\" : "";
|
4672 | let output = "";
|
4673 | if (node.isOpen === true) {
|
4674 | return prefix + node.value;
|
4675 | }
|
4676 | if (node.isClose === true) {
|
4677 | return prefix + node.value;
|
4678 | }
|
4679 | if (node.type === "open") {
|
4680 | return invalid ? prefix + node.value : "(";
|
4681 | }
|
4682 | if (node.type === "close") {
|
4683 | return invalid ? prefix + node.value : ")";
|
4684 | }
|
4685 | if (node.type === "comma") {
|
4686 | return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
|
4687 | }
|
4688 | if (node.value) {
|
4689 | return node.value;
|
4690 | }
|
4691 | if (node.nodes && node.ranges > 0) {
|
4692 | let args = utils.reduce(node.nodes);
|
4693 | let range = fill(...args, Object.assign(Object.assign({}, options), {}, {
|
4694 | wrap: false,
|
4695 | toRegex: true
|
4696 | }));
|
4697 | if (range.length !== 0) {
|
4698 | return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
4699 | }
|
4700 | }
|
4701 | if (node.nodes) {
|
4702 | for (let child of node.nodes) {
|
4703 | output += walk(child, node);
|
4704 | }
|
4705 | }
|
4706 | return output;
|
4707 | };
|
4708 | return walk(ast);
|
4709 | };
|
4710 | module2.exports = compile;
|
4711 | }
|
4712 | });
|
4713 | var require_expand = __commonJS2({
|
4714 | "node_modules/braces/lib/expand.js"(exports2, module2) {
|
4715 | "use strict";
|
4716 | var fill = require_fill_range();
|
4717 | var stringify2 = require_stringify();
|
4718 | var utils = require_utils2();
|
4719 | var append = (queue = "", stash = "", enclose = false) => {
|
4720 | let result = [];
|
4721 | queue = [].concat(queue);
|
4722 | stash = [].concat(stash);
|
4723 | if (!stash.length)
|
4724 | return queue;
|
4725 | if (!queue.length) {
|
4726 | return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
4727 | }
|
4728 | for (let item of queue) {
|
4729 | if (Array.isArray(item)) {
|
4730 | for (let value of item) {
|
4731 | result.push(append(value, stash, enclose));
|
4732 | }
|
4733 | } else {
|
4734 | for (let ele of stash) {
|
4735 | if (enclose === true && typeof ele === "string")
|
4736 | ele = `{${ele}}`;
|
4737 | result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
4738 | }
|
4739 | }
|
4740 | }
|
4741 | return utils.flatten(result);
|
4742 | };
|
4743 | var expand = (ast, options = {}) => {
|
4744 | let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
4745 | let walk = (node, parent = {}) => {
|
4746 | node.queue = [];
|
4747 | let p = parent;
|
4748 | let q = parent.queue;
|
4749 | while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
4750 | p = p.parent;
|
4751 | q = p.queue;
|
4752 | }
|
4753 | if (node.invalid || node.dollar) {
|
4754 | q.push(append(q.pop(), stringify2(node, options)));
|
4755 | return;
|
4756 | }
|
4757 | if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
4758 | q.push(append(q.pop(), ["{}"]));
|
4759 | return;
|
4760 | }
|
4761 | if (node.nodes && node.ranges > 0) {
|
4762 | let args = utils.reduce(node.nodes);
|
4763 | if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
4764 | throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
4765 | }
|
4766 | let range = fill(...args, options);
|
4767 | if (range.length === 0) {
|
4768 | range = stringify2(node, options);
|
4769 | }
|
4770 | q.push(append(q.pop(), range));
|
4771 | node.nodes = [];
|
4772 | return;
|
4773 | }
|
4774 | let enclose = utils.encloseBrace(node);
|
4775 | let queue = node.queue;
|
4776 | let block = node;
|
4777 | while (block.type !== "brace" && block.type !== "root" && block.parent) {
|
4778 | block = block.parent;
|
4779 | queue = block.queue;
|
4780 | }
|
4781 | for (let i = 0; i < node.nodes.length; i++) {
|
4782 | let child = node.nodes[i];
|
4783 | if (child.type === "comma" && node.type === "brace") {
|
4784 | if (i === 1)
|
4785 | queue.push("");
|
4786 | queue.push("");
|
4787 | continue;
|
4788 | }
|
4789 | if (child.type === "close") {
|
4790 | q.push(append(q.pop(), queue, enclose));
|
4791 | continue;
|
4792 | }
|
4793 | if (child.value && child.type !== "open") {
|
4794 | queue.push(append(queue.pop(), child.value));
|
4795 | continue;
|
4796 | }
|
4797 | if (child.nodes) {
|
4798 | walk(child, node);
|
4799 | }
|
4800 | }
|
4801 | return queue;
|
4802 | };
|
4803 | return utils.flatten(walk(ast));
|
4804 | };
|
4805 | module2.exports = expand;
|
4806 | }
|
4807 | });
|
4808 | var require_constants = __commonJS2({
|
4809 | "node_modules/braces/lib/constants.js"(exports2, module2) {
|
4810 | "use strict";
|
4811 | module2.exports = {
|
4812 | MAX_LENGTH: 1024 * 64,
|
4813 | CHAR_0: "0",
|
4814 | CHAR_9: "9",
|
4815 | CHAR_UPPERCASE_A: "A",
|
4816 | CHAR_LOWERCASE_A: "a",
|
4817 | CHAR_UPPERCASE_Z: "Z",
|
4818 | CHAR_LOWERCASE_Z: "z",
|
4819 | CHAR_LEFT_PARENTHESES: "(",
|
4820 | CHAR_RIGHT_PARENTHESES: ")",
|
4821 | CHAR_ASTERISK: "*",
|
4822 | CHAR_AMPERSAND: "&",
|
4823 | CHAR_AT: "@",
|
4824 | CHAR_BACKSLASH: "\\",
|
4825 | CHAR_BACKTICK: "`",
|
4826 | CHAR_CARRIAGE_RETURN: "\r",
|
4827 | CHAR_CIRCUMFLEX_ACCENT: "^",
|
4828 | CHAR_COLON: ":",
|
4829 | CHAR_COMMA: ",",
|
4830 | CHAR_DOLLAR: "$",
|
4831 | CHAR_DOT: ".",
|
4832 | CHAR_DOUBLE_QUOTE: '"',
|
4833 | CHAR_EQUAL: "=",
|
4834 | CHAR_EXCLAMATION_MARK: "!",
|
4835 | CHAR_FORM_FEED: "\f",
|
4836 | CHAR_FORWARD_SLASH: "/",
|
4837 | CHAR_HASH: "#",
|
4838 | CHAR_HYPHEN_MINUS: "-",
|
4839 | CHAR_LEFT_ANGLE_BRACKET: "<",
|
4840 | CHAR_LEFT_CURLY_BRACE: "{",
|
4841 | CHAR_LEFT_SQUARE_BRACKET: "[",
|
4842 | CHAR_LINE_FEED: "\n",
|
4843 | CHAR_NO_BREAK_SPACE: "\xA0",
|
4844 | CHAR_PERCENT: "%",
|
4845 | CHAR_PLUS: "+",
|
4846 | CHAR_QUESTION_MARK: "?",
|
4847 | CHAR_RIGHT_ANGLE_BRACKET: ">",
|
4848 | CHAR_RIGHT_CURLY_BRACE: "}",
|
4849 | CHAR_RIGHT_SQUARE_BRACKET: "]",
|
4850 | CHAR_SEMICOLON: ";",
|
4851 | CHAR_SINGLE_QUOTE: "'",
|
4852 | CHAR_SPACE: " ",
|
4853 | CHAR_TAB: " ",
|
4854 | CHAR_UNDERSCORE: "_",
|
4855 | CHAR_VERTICAL_LINE: "|",
|
4856 | CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
|
4857 | };
|
4858 | }
|
4859 | });
|
4860 | var require_parse = __commonJS2({
|
4861 | "node_modules/braces/lib/parse.js"(exports2, module2) {
|
4862 | "use strict";
|
4863 | var stringify2 = require_stringify();
|
4864 | var {
|
4865 | MAX_LENGTH,
|
4866 | CHAR_BACKSLASH,
|
4867 | CHAR_BACKTICK,
|
4868 | CHAR_COMMA,
|
4869 | CHAR_DOT,
|
4870 | CHAR_LEFT_PARENTHESES,
|
4871 | CHAR_RIGHT_PARENTHESES,
|
4872 | CHAR_LEFT_CURLY_BRACE,
|
4873 | CHAR_RIGHT_CURLY_BRACE,
|
4874 | CHAR_LEFT_SQUARE_BRACKET,
|
4875 | CHAR_RIGHT_SQUARE_BRACKET,
|
4876 | CHAR_DOUBLE_QUOTE,
|
4877 | CHAR_SINGLE_QUOTE,
|
4878 | CHAR_NO_BREAK_SPACE,
|
4879 | CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
4880 | } = require_constants();
|
4881 | var parse = (input, options = {}) => {
|
4882 | if (typeof input !== "string") {
|
4883 | throw new TypeError("Expected a string");
|
4884 | }
|
4885 | let opts = options || {};
|
4886 | let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
4887 | if (input.length > max) {
|
4888 | throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
4889 | }
|
4890 | let ast = {
|
4891 | type: "root",
|
4892 | input,
|
4893 | nodes: []
|
4894 | };
|
4895 | let stack = [ast];
|
4896 | let block = ast;
|
4897 | let prev = ast;
|
4898 | let brackets = 0;
|
4899 | let length = input.length;
|
4900 | let index = 0;
|
4901 | let depth = 0;
|
4902 | let value;
|
4903 | let memo = {};
|
4904 | const advance = () => input[index++];
|
4905 | const push = (node) => {
|
4906 | if (node.type === "text" && prev.type === "dot") {
|
4907 | prev.type = "text";
|
4908 | }
|
4909 | if (prev && prev.type === "text" && node.type === "text") {
|
4910 | prev.value += node.value;
|
4911 | return;
|
4912 | }
|
4913 | block.nodes.push(node);
|
4914 | node.parent = block;
|
4915 | node.prev = prev;
|
4916 | prev = node;
|
4917 | return node;
|
4918 | };
|
4919 | push({
|
4920 | type: "bos"
|
4921 | });
|
4922 | while (index < length) {
|
4923 | block = stack[stack.length - 1];
|
4924 | value = advance();
|
4925 | if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
4926 | continue;
|
4927 | }
|
4928 | if (value === CHAR_BACKSLASH) {
|
4929 | push({
|
4930 | type: "text",
|
4931 | value: (options.keepEscaping ? value : "") + advance()
|
4932 | });
|
4933 | continue;
|
4934 | }
|
4935 | if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
4936 | push({
|
4937 | type: "text",
|
4938 | value: "\\" + value
|
4939 | });
|
4940 | continue;
|
4941 | }
|
4942 | if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
4943 | brackets++;
|
4944 | let closed = true;
|
4945 | let next;
|
4946 | while (index < length && (next = advance())) {
|
4947 | value += next;
|
4948 | if (next === CHAR_LEFT_SQUARE_BRACKET) {
|
4949 | brackets++;
|
4950 | continue;
|
4951 | }
|
4952 | if (next === CHAR_BACKSLASH) {
|
4953 | value += advance();
|
4954 | continue;
|
4955 | }
|
4956 | if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
4957 | brackets--;
|
4958 | if (brackets === 0) {
|
4959 | break;
|
4960 | }
|
4961 | }
|
4962 | }
|
4963 | push({
|
4964 | type: "text",
|
4965 | value
|
4966 | });
|
4967 | continue;
|
4968 | }
|
4969 | if (value === CHAR_LEFT_PARENTHESES) {
|
4970 | block = push({
|
4971 | type: "paren",
|
4972 | nodes: []
|
4973 | });
|
4974 | stack.push(block);
|
4975 | push({
|
4976 | type: "text",
|
4977 | value
|
4978 | });
|
4979 | continue;
|
4980 | }
|
4981 | if (value === CHAR_RIGHT_PARENTHESES) {
|
4982 | if (block.type !== "paren") {
|
4983 | push({
|
4984 | type: "text",
|
4985 | value
|
4986 | });
|
4987 | continue;
|
4988 | }
|
4989 | block = stack.pop();
|
4990 | push({
|
4991 | type: "text",
|
4992 | value
|
4993 | });
|
4994 | block = stack[stack.length - 1];
|
4995 | continue;
|
4996 | }
|
4997 | if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
4998 | let open = value;
|
4999 | let next;
|
5000 | if (options.keepQuotes !== true) {
|
5001 | value = "";
|
5002 | }
|
5003 | while (index < length && (next = advance())) {
|
5004 | if (next === CHAR_BACKSLASH) {
|
5005 | value += next + advance();
|
5006 | continue;
|
5007 | }
|
5008 | if (next === open) {
|
5009 | if (options.keepQuotes === true)
|
5010 | value += next;
|
5011 | break;
|
5012 | }
|
5013 | value += next;
|
5014 | }
|
5015 | push({
|
5016 | type: "text",
|
5017 | value
|
5018 | });
|
5019 | continue;
|
5020 | }
|
5021 | if (value === CHAR_LEFT_CURLY_BRACE) {
|
5022 | depth++;
|
5023 | let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
|
5024 | let brace = {
|
5025 | type: "brace",
|
5026 | open: true,
|
5027 | close: false,
|
5028 | dollar,
|
5029 | depth,
|
5030 | commas: 0,
|
5031 | ranges: 0,
|
5032 | nodes: []
|
5033 | };
|
5034 | block = push(brace);
|
5035 | stack.push(block);
|
5036 | push({
|
5037 | type: "open",
|
5038 | value
|
5039 | });
|
5040 | continue;
|
5041 | }
|
5042 | if (value === CHAR_RIGHT_CURLY_BRACE) {
|
5043 | if (block.type !== "brace") {
|
5044 | push({
|
5045 | type: "text",
|
5046 | value
|
5047 | });
|
5048 | continue;
|
5049 | }
|
5050 | let type = "close";
|
5051 | block = stack.pop();
|
5052 | block.close = true;
|
5053 | push({
|
5054 | type,
|
5055 | value
|
5056 | });
|
5057 | depth--;
|
5058 | block = stack[stack.length - 1];
|
5059 | continue;
|
5060 | }
|
5061 | if (value === CHAR_COMMA && depth > 0) {
|
5062 | if (block.ranges > 0) {
|
5063 | block.ranges = 0;
|
5064 | let open = block.nodes.shift();
|
5065 | block.nodes = [open, {
|
5066 | type: "text",
|
5067 | value: stringify2(block)
|
5068 | }];
|
5069 | }
|
5070 | push({
|
5071 | type: "comma",
|
5072 | value
|
5073 | });
|
5074 | block.commas++;
|
5075 | continue;
|
5076 | }
|
5077 | if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
5078 | let siblings = block.nodes;
|
5079 | if (depth === 0 || siblings.length === 0) {
|
5080 | push({
|
5081 | type: "text",
|
5082 | value
|
5083 | });
|
5084 | continue;
|
5085 | }
|
5086 | if (prev.type === "dot") {
|
5087 | block.range = [];
|
5088 | prev.value += value;
|
5089 | prev.type = "range";
|
5090 | if (block.nodes.length !== 3 && block.nodes.length !== 5) {
|
5091 | block.invalid = true;
|
5092 | block.ranges = 0;
|
5093 | prev.type = "text";
|
5094 | continue;
|
5095 | }
|
5096 | block.ranges++;
|
5097 | block.args = [];
|
5098 | continue;
|
5099 | }
|
5100 | if (prev.type === "range") {
|
5101 | siblings.pop();
|
5102 | let before = siblings[siblings.length - 1];
|
5103 | before.value += prev.value + value;
|
5104 | prev = before;
|
5105 | block.ranges--;
|
5106 | continue;
|
5107 | }
|
5108 | push({
|
5109 | type: "dot",
|
5110 | value
|
5111 | });
|
5112 | continue;
|
5113 | }
|
5114 | push({
|
5115 | type: "text",
|
5116 | value
|
5117 | });
|
5118 | }
|
5119 | do {
|
5120 | block = stack.pop();
|
5121 | if (block.type !== "root") {
|
5122 | block.nodes.forEach((node) => {
|
5123 | if (!node.nodes) {
|
5124 | if (node.type === "open")
|
5125 | node.isOpen = true;
|
5126 | if (node.type === "close")
|
5127 | node.isClose = true;
|
5128 | if (!node.nodes)
|
5129 | node.type = "text";
|
5130 | node.invalid = true;
|
5131 | }
|
5132 | });
|
5133 | let parent = stack[stack.length - 1];
|
5134 | let index2 = parent.nodes.indexOf(block);
|
5135 | parent.nodes.splice(index2, 1, ...block.nodes);
|
5136 | }
|
5137 | } while (stack.length > 0);
|
5138 | push({
|
5139 | type: "eos"
|
5140 | });
|
5141 | return ast;
|
5142 | };
|
5143 | module2.exports = parse;
|
5144 | }
|
5145 | });
|
5146 | var require_braces = __commonJS2({
|
5147 | "node_modules/braces/index.js"(exports2, module2) {
|
5148 | "use strict";
|
5149 | var stringify2 = require_stringify();
|
5150 | var compile = require_compile();
|
5151 | var expand = require_expand();
|
5152 | var parse = require_parse();
|
5153 | var braces = (input, options = {}) => {
|
5154 | let output = [];
|
5155 | if (Array.isArray(input)) {
|
5156 | for (let pattern of input) {
|
5157 | let result = braces.create(pattern, options);
|
5158 | if (Array.isArray(result)) {
|
5159 | output.push(...result);
|
5160 | } else {
|
5161 | output.push(result);
|
5162 | }
|
5163 | }
|
5164 | } else {
|
5165 | output = [].concat(braces.create(input, options));
|
5166 | }
|
5167 | if (options && options.expand === true && options.nodupes === true) {
|
5168 | output = [...new Set(output)];
|
5169 | }
|
5170 | return output;
|
5171 | };
|
5172 | braces.parse = (input, options = {}) => parse(input, options);
|
5173 | braces.stringify = (input, options = {}) => {
|
5174 | if (typeof input === "string") {
|
5175 | return stringify2(braces.parse(input, options), options);
|
5176 | }
|
5177 | return stringify2(input, options);
|
5178 | };
|
5179 | braces.compile = (input, options = {}) => {
|
5180 | if (typeof input === "string") {
|
5181 | input = braces.parse(input, options);
|
5182 | }
|
5183 | return compile(input, options);
|
5184 | };
|
5185 | braces.expand = (input, options = {}) => {
|
5186 | if (typeof input === "string") {
|
5187 | input = braces.parse(input, options);
|
5188 | }
|
5189 | let result = expand(input, options);
|
5190 | if (options.noempty === true) {
|
5191 | result = result.filter(Boolean);
|
5192 | }
|
5193 | if (options.nodupes === true) {
|
5194 | result = [...new Set(result)];
|
5195 | }
|
5196 | return result;
|
5197 | };
|
5198 | braces.create = (input, options = {}) => {
|
5199 | if (input === "" || input.length < 3) {
|
5200 | return [input];
|
5201 | }
|
5202 | return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
|
5203 | };
|
5204 | module2.exports = braces;
|
5205 | }
|
5206 | });
|
5207 | var require_constants2 = __commonJS2({
|
5208 | "node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
5209 | "use strict";
|
5210 | var path = require("path");
|
5211 | var WIN_SLASH = "\\\\/";
|
5212 | var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
5213 | var DOT_LITERAL = "\\.";
|
5214 | var PLUS_LITERAL = "\\+";
|
5215 | var QMARK_LITERAL = "\\?";
|
5216 | var SLASH_LITERAL = "\\/";
|
5217 | var ONE_CHAR = "(?=.)";
|
5218 | var QMARK = "[^/]";
|
5219 | var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
5220 | var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
5221 | var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
5222 | var NO_DOT = `(?!${DOT_LITERAL})`;
|
5223 | var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
5224 | var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
5225 | var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
5226 | var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
5227 | var STAR = `${QMARK}*?`;
|
5228 | var POSIX_CHARS = {
|
5229 | DOT_LITERAL,
|
5230 | PLUS_LITERAL,
|
5231 | QMARK_LITERAL,
|
5232 | SLASH_LITERAL,
|
5233 | ONE_CHAR,
|
5234 | QMARK,
|
5235 | END_ANCHOR,
|
5236 | DOTS_SLASH,
|
5237 | NO_DOT,
|
5238 | NO_DOTS,
|
5239 | NO_DOT_SLASH,
|
5240 | NO_DOTS_SLASH,
|
5241 | QMARK_NO_DOT,
|
5242 | STAR,
|
5243 | START_ANCHOR
|
5244 | };
|
5245 | var WINDOWS_CHARS = Object.assign(Object.assign({}, POSIX_CHARS), {}, {
|
5246 | SLASH_LITERAL: `[${WIN_SLASH}]`,
|
5247 | QMARK: WIN_NO_SLASH,
|
5248 | STAR: `${WIN_NO_SLASH}*?`,
|
5249 | DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
5250 | NO_DOT: `(?!${DOT_LITERAL})`,
|
5251 | NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
5252 | NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
5253 | NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
5254 | QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
5255 | START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
5256 | END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
5257 | });
|
5258 | var POSIX_REGEX_SOURCE = {
|
5259 | alnum: "a-zA-Z0-9",
|
5260 | alpha: "a-zA-Z",
|
5261 | ascii: "\\x00-\\x7F",
|
5262 | blank: " \\t",
|
5263 | cntrl: "\\x00-\\x1F\\x7F",
|
5264 | digit: "0-9",
|
5265 | graph: "\\x21-\\x7E",
|
5266 | lower: "a-z",
|
5267 | print: "\\x20-\\x7E ",
|
5268 | punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
5269 | space: " \\t\\r\\n\\v\\f",
|
5270 | upper: "A-Z",
|
5271 | word: "A-Za-z0-9_",
|
5272 | xdigit: "A-Fa-f0-9"
|
5273 | };
|
5274 | module2.exports = {
|
5275 | MAX_LENGTH: 1024 * 64,
|
5276 | POSIX_REGEX_SOURCE,
|
5277 | REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
5278 | REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
5279 | REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
5280 | REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
5281 | REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
5282 | REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
5283 | REPLACEMENTS: {
|
5284 | "***": "*",
|
5285 | "**/**": "**",
|
5286 | "**/**/**": "**"
|
5287 | },
|
5288 | CHAR_0: 48,
|
5289 | CHAR_9: 57,
|
5290 | CHAR_UPPERCASE_A: 65,
|
5291 | CHAR_LOWERCASE_A: 97,
|
5292 | CHAR_UPPERCASE_Z: 90,
|
5293 | CHAR_LOWERCASE_Z: 122,
|
5294 | CHAR_LEFT_PARENTHESES: 40,
|
5295 | CHAR_RIGHT_PARENTHESES: 41,
|
5296 | CHAR_ASTERISK: 42,
|
5297 | CHAR_AMPERSAND: 38,
|
5298 | CHAR_AT: 64,
|
5299 | CHAR_BACKWARD_SLASH: 92,
|
5300 | CHAR_CARRIAGE_RETURN: 13,
|
5301 | CHAR_CIRCUMFLEX_ACCENT: 94,
|
5302 | CHAR_COLON: 58,
|
5303 | CHAR_COMMA: 44,
|
5304 | CHAR_DOT: 46,
|
5305 | CHAR_DOUBLE_QUOTE: 34,
|
5306 | CHAR_EQUAL: 61,
|
5307 | CHAR_EXCLAMATION_MARK: 33,
|
5308 | CHAR_FORM_FEED: 12,
|
5309 | CHAR_FORWARD_SLASH: 47,
|
5310 | CHAR_GRAVE_ACCENT: 96,
|
5311 | CHAR_HASH: 35,
|
5312 | CHAR_HYPHEN_MINUS: 45,
|
5313 | CHAR_LEFT_ANGLE_BRACKET: 60,
|
5314 | CHAR_LEFT_CURLY_BRACE: 123,
|
5315 | CHAR_LEFT_SQUARE_BRACKET: 91,
|
5316 | CHAR_LINE_FEED: 10,
|
5317 | CHAR_NO_BREAK_SPACE: 160,
|
5318 | CHAR_PERCENT: 37,
|
5319 | CHAR_PLUS: 43,
|
5320 | CHAR_QUESTION_MARK: 63,
|
5321 | CHAR_RIGHT_ANGLE_BRACKET: 62,
|
5322 | CHAR_RIGHT_CURLY_BRACE: 125,
|
5323 | CHAR_RIGHT_SQUARE_BRACKET: 93,
|
5324 | CHAR_SEMICOLON: 59,
|
5325 | CHAR_SINGLE_QUOTE: 39,
|
5326 | CHAR_SPACE: 32,
|
5327 | CHAR_TAB: 9,
|
5328 | CHAR_UNDERSCORE: 95,
|
5329 | CHAR_VERTICAL_LINE: 124,
|
5330 | CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
5331 | SEP: path.sep,
|
5332 | extglobChars(chars) {
|
5333 | return {
|
5334 | "!": {
|
5335 | type: "negate",
|
5336 | open: "(?:(?!(?:",
|
5337 | close: `))${chars.STAR})`
|
5338 | },
|
5339 | "?": {
|
5340 | type: "qmark",
|
5341 | open: "(?:",
|
5342 | close: ")?"
|
5343 | },
|
5344 | "+": {
|
5345 | type: "plus",
|
5346 | open: "(?:",
|
5347 | close: ")+"
|
5348 | },
|
5349 | "*": {
|
5350 | type: "star",
|
5351 | open: "(?:",
|
5352 | close: ")*"
|
5353 | },
|
5354 | "@": {
|
5355 | type: "at",
|
5356 | open: "(?:",
|
5357 | close: ")"
|
5358 | }
|
5359 | };
|
5360 | },
|
5361 | globChars(win32) {
|
5362 | return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
5363 | }
|
5364 | };
|
5365 | }
|
5366 | });
|
5367 | var require_utils3 = __commonJS2({
|
5368 | "node_modules/picomatch/lib/utils.js"(exports2) {
|
5369 | "use strict";
|
5370 | var path = require("path");
|
5371 | var win32 = process.platform === "win32";
|
5372 | var {
|
5373 | REGEX_BACKSLASH,
|
5374 | REGEX_REMOVE_BACKSLASH,
|
5375 | REGEX_SPECIAL_CHARS,
|
5376 | REGEX_SPECIAL_CHARS_GLOBAL
|
5377 | } = require_constants2();
|
5378 | exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
5379 | exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
5380 | exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
|
5381 | exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
5382 | exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
5383 | exports2.removeBackslashes = (str) => {
|
5384 | return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
5385 | return match === "\\" ? "" : match;
|
5386 | });
|
5387 | };
|
5388 | exports2.supportsLookbehinds = () => {
|
5389 | const segs = process.version.slice(1).split(".").map(Number);
|
5390 | if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
|
5391 | return true;
|
5392 | }
|
5393 | return false;
|
5394 | };
|
5395 | exports2.isWindows = (options) => {
|
5396 | if (options && typeof options.windows === "boolean") {
|
5397 | return options.windows;
|
5398 | }
|
5399 | return win32 === true || path.sep === "\\";
|
5400 | };
|
5401 | exports2.escapeLast = (input, char, lastIdx) => {
|
5402 | const idx = input.lastIndexOf(char, lastIdx);
|
5403 | if (idx === -1)
|
5404 | return input;
|
5405 | if (input[idx - 1] === "\\")
|
5406 | return exports2.escapeLast(input, char, idx - 1);
|
5407 | return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
5408 | };
|
5409 | exports2.removePrefix = (input, state = {}) => {
|
5410 | let output = input;
|
5411 | if (output.startsWith("./")) {
|
5412 | output = output.slice(2);
|
5413 | state.prefix = "./";
|
5414 | }
|
5415 | return output;
|
5416 | };
|
5417 | exports2.wrapOutput = (input, state = {}, options = {}) => {
|
5418 | const prepend = options.contains ? "" : "^";
|
5419 | const append = options.contains ? "" : "$";
|
5420 | let output = `${prepend}(?:${input})${append}`;
|
5421 | if (state.negated === true) {
|
5422 | output = `(?:^(?!${output}).*$)`;
|
5423 | }
|
5424 | return output;
|
5425 | };
|
5426 | }
|
5427 | });
|
5428 | var require_scan = __commonJS2({
|
5429 | "node_modules/picomatch/lib/scan.js"(exports2, module2) {
|
5430 | "use strict";
|
5431 | var utils = require_utils3();
|
5432 | var {
|
5433 | CHAR_ASTERISK,
|
5434 | CHAR_AT,
|
5435 | CHAR_BACKWARD_SLASH,
|
5436 | CHAR_COMMA,
|
5437 | CHAR_DOT,
|
5438 | CHAR_EXCLAMATION_MARK,
|
5439 | CHAR_FORWARD_SLASH,
|
5440 | CHAR_LEFT_CURLY_BRACE,
|
5441 | CHAR_LEFT_PARENTHESES,
|
5442 | CHAR_LEFT_SQUARE_BRACKET,
|
5443 | CHAR_PLUS,
|
5444 | CHAR_QUESTION_MARK,
|
5445 | CHAR_RIGHT_CURLY_BRACE,
|
5446 | CHAR_RIGHT_PARENTHESES,
|
5447 | CHAR_RIGHT_SQUARE_BRACKET
|
5448 | } = require_constants2();
|
5449 | var isPathSeparator = (code) => {
|
5450 | return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
5451 | };
|
5452 | var depth = (token) => {
|
5453 | if (token.isPrefix !== true) {
|
5454 | token.depth = token.isGlobstar ? Infinity : 1;
|
5455 | }
|
5456 | };
|
5457 | var scan = (input, options) => {
|
5458 | const opts = options || {};
|
5459 | const length = input.length - 1;
|
5460 | const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
5461 | const slashes = [];
|
5462 | const tokens = [];
|
5463 | const parts = [];
|
5464 | let str = input;
|
5465 | let index = -1;
|
5466 | let start = 0;
|
5467 | let lastIndex = 0;
|
5468 | let isBrace = false;
|
5469 | let isBracket = false;
|
5470 | let isGlob = false;
|
5471 | let isExtglob = false;
|
5472 | let isGlobstar = false;
|
5473 | let braceEscaped = false;
|
5474 | let backslashes = false;
|
5475 | let negated = false;
|
5476 | let negatedExtglob = false;
|
5477 | let finished = false;
|
5478 | let braces = 0;
|
5479 | let prev;
|
5480 | let code;
|
5481 | let token = {
|
5482 | value: "",
|
5483 | depth: 0,
|
5484 | isGlob: false
|
5485 | };
|
5486 | const eos = () => index >= length;
|
5487 | const peek = () => str.charCodeAt(index + 1);
|
5488 | const advance = () => {
|
5489 | prev = code;
|
5490 | return str.charCodeAt(++index);
|
5491 | };
|
5492 | while (index < length) {
|
5493 | code = advance();
|
5494 | let next;
|
5495 | if (code === CHAR_BACKWARD_SLASH) {
|
5496 | backslashes = token.backslashes = true;
|
5497 | code = advance();
|
5498 | if (code === CHAR_LEFT_CURLY_BRACE) {
|
5499 | braceEscaped = true;
|
5500 | }
|
5501 | continue;
|
5502 | }
|
5503 | if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
5504 | braces++;
|
5505 | while (eos() !== true && (code = advance())) {
|
5506 | if (code === CHAR_BACKWARD_SLASH) {
|
5507 | backslashes = token.backslashes = true;
|
5508 | advance();
|
5509 | continue;
|
5510 | }
|
5511 | if (code === CHAR_LEFT_CURLY_BRACE) {
|
5512 | braces++;
|
5513 | continue;
|
5514 | }
|
5515 | if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
5516 | isBrace = token.isBrace = true;
|
5517 | isGlob = token.isGlob = true;
|
5518 | finished = true;
|
5519 | if (scanToEnd === true) {
|
5520 | continue;
|
5521 | }
|
5522 | break;
|
5523 | }
|
5524 | if (braceEscaped !== true && code === CHAR_COMMA) {
|
5525 | isBrace = token.isBrace = true;
|
5526 | isGlob = token.isGlob = true;
|
5527 | finished = true;
|
5528 | if (scanToEnd === true) {
|
5529 | continue;
|
5530 | }
|
5531 | break;
|
5532 | }
|
5533 | if (code === CHAR_RIGHT_CURLY_BRACE) {
|
5534 | braces--;
|
5535 | if (braces === 0) {
|
5536 | braceEscaped = false;
|
5537 | isBrace = token.isBrace = true;
|
5538 | finished = true;
|
5539 | break;
|
5540 | }
|
5541 | }
|
5542 | }
|
5543 | if (scanToEnd === true) {
|
5544 | continue;
|
5545 | }
|
5546 | break;
|
5547 | }
|
5548 | if (code === CHAR_FORWARD_SLASH) {
|
5549 | slashes.push(index);
|
5550 | tokens.push(token);
|
5551 | token = {
|
5552 | value: "",
|
5553 | depth: 0,
|
5554 | isGlob: false
|
5555 | };
|
5556 | if (finished === true)
|
5557 | continue;
|
5558 | if (prev === CHAR_DOT && index === start + 1) {
|
5559 | start += 2;
|
5560 | continue;
|
5561 | }
|
5562 | lastIndex = index + 1;
|
5563 | continue;
|
5564 | }
|
5565 | if (opts.noext !== true) {
|
5566 | const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
|
5567 | if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
5568 | isGlob = token.isGlob = true;
|
5569 | isExtglob = token.isExtglob = true;
|
5570 | finished = true;
|
5571 | if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
5572 | negatedExtglob = true;
|
5573 | }
|
5574 | if (scanToEnd === true) {
|
5575 | while (eos() !== true && (code = advance())) {
|
5576 | if (code === CHAR_BACKWARD_SLASH) {
|
5577 | backslashes = token.backslashes = true;
|
5578 | code = advance();
|
5579 | continue;
|
5580 | }
|
5581 | if (code === CHAR_RIGHT_PARENTHESES) {
|
5582 | isGlob = token.isGlob = true;
|
5583 | finished = true;
|
5584 | break;
|
5585 | }
|
5586 | }
|
5587 | continue;
|
5588 | }
|
5589 | break;
|
5590 | }
|
5591 | }
|
5592 | if (code === CHAR_ASTERISK) {
|
5593 | if (prev === CHAR_ASTERISK)
|
5594 | isGlobstar = token.isGlobstar = true;
|
5595 | isGlob = token.isGlob = true;
|
5596 | finished = true;
|
5597 | if (scanToEnd === true) {
|
5598 | continue;
|
5599 | }
|
5600 | break;
|
5601 | }
|
5602 | if (code === CHAR_QUESTION_MARK) {
|
5603 | isGlob = token.isGlob = true;
|
5604 | finished = true;
|
5605 | if (scanToEnd === true) {
|
5606 | continue;
|
5607 | }
|
5608 | break;
|
5609 | }
|
5610 | if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
5611 | while (eos() !== true && (next = advance())) {
|
5612 | if (next === CHAR_BACKWARD_SLASH) {
|
5613 | backslashes = token.backslashes = true;
|
5614 | advance();
|
5615 | continue;
|
5616 | }
|
5617 | if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
5618 | isBracket = token.isBracket = true;
|
5619 | isGlob = token.isGlob = true;
|
5620 | finished = true;
|
5621 | break;
|
5622 | }
|
5623 | }
|
5624 | if (scanToEnd === true) {
|
5625 | continue;
|
5626 | }
|
5627 | break;
|
5628 | }
|
5629 | if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
5630 | negated = token.negated = true;
|
5631 | start++;
|
5632 | continue;
|
5633 | }
|
5634 | if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
5635 | isGlob = token.isGlob = true;
|
5636 | if (scanToEnd === true) {
|
5637 | while (eos() !== true && (code = advance())) {
|
5638 | if (code === CHAR_LEFT_PARENTHESES) {
|
5639 | backslashes = token.backslashes = true;
|
5640 | code = advance();
|
5641 | continue;
|
5642 | }
|
5643 | if (code === CHAR_RIGHT_PARENTHESES) {
|
5644 | finished = true;
|
5645 | break;
|
5646 | }
|
5647 | }
|
5648 | continue;
|
5649 | }
|
5650 | break;
|
5651 | }
|
5652 | if (isGlob === true) {
|
5653 | finished = true;
|
5654 | if (scanToEnd === true) {
|
5655 | continue;
|
5656 | }
|
5657 | break;
|
5658 | }
|
5659 | }
|
5660 | if (opts.noext === true) {
|
5661 | isExtglob = false;
|
5662 | isGlob = false;
|
5663 | }
|
5664 | let base = str;
|
5665 | let prefix = "";
|
5666 | let glob = "";
|
5667 | if (start > 0) {
|
5668 | prefix = str.slice(0, start);
|
5669 | str = str.slice(start);
|
5670 | lastIndex -= start;
|
5671 | }
|
5672 | if (base && isGlob === true && lastIndex > 0) {
|
5673 | base = str.slice(0, lastIndex);
|
5674 | glob = str.slice(lastIndex);
|
5675 | } else if (isGlob === true) {
|
5676 | base = "";
|
5677 | glob = str;
|
5678 | } else {
|
5679 | base = str;
|
5680 | }
|
5681 | if (base && base !== "" && base !== "/" && base !== str) {
|
5682 | if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
5683 | base = base.slice(0, -1);
|
5684 | }
|
5685 | }
|
5686 | if (opts.unescape === true) {
|
5687 | if (glob)
|
5688 | glob = utils.removeBackslashes(glob);
|
5689 | if (base && backslashes === true) {
|
5690 | base = utils.removeBackslashes(base);
|
5691 | }
|
5692 | }
|
5693 | const state = {
|
5694 | prefix,
|
5695 | input,
|
5696 | start,
|
5697 | base,
|
5698 | glob,
|
5699 | isBrace,
|
5700 | isBracket,
|
5701 | isGlob,
|
5702 | isExtglob,
|
5703 | isGlobstar,
|
5704 | negated,
|
5705 | negatedExtglob
|
5706 | };
|
5707 | if (opts.tokens === true) {
|
5708 | state.maxDepth = 0;
|
5709 | if (!isPathSeparator(code)) {
|
5710 | tokens.push(token);
|
5711 | }
|
5712 | state.tokens = tokens;
|
5713 | }
|
5714 | if (opts.parts === true || opts.tokens === true) {
|
5715 | let prevIndex;
|
5716 | for (let idx = 0; idx < slashes.length; idx++) {
|
5717 | const n = prevIndex ? prevIndex + 1 : start;
|
5718 | const i = slashes[idx];
|
5719 | const value = input.slice(n, i);
|
5720 | if (opts.tokens) {
|
5721 | if (idx === 0 && start !== 0) {
|
5722 | tokens[idx].isPrefix = true;
|
5723 | tokens[idx].value = prefix;
|
5724 | } else {
|
5725 | tokens[idx].value = value;
|
5726 | }
|
5727 | depth(tokens[idx]);
|
5728 | state.maxDepth += tokens[idx].depth;
|
5729 | }
|
5730 | if (idx !== 0 || value !== "") {
|
5731 | parts.push(value);
|
5732 | }
|
5733 | prevIndex = i;
|
5734 | }
|
5735 | if (prevIndex && prevIndex + 1 < input.length) {
|
5736 | const value = input.slice(prevIndex + 1);
|
5737 | parts.push(value);
|
5738 | if (opts.tokens) {
|
5739 | tokens[tokens.length - 1].value = value;
|
5740 | depth(tokens[tokens.length - 1]);
|
5741 | state.maxDepth += tokens[tokens.length - 1].depth;
|
5742 | }
|
5743 | }
|
5744 | state.slashes = slashes;
|
5745 | state.parts = parts;
|
5746 | }
|
5747 | return state;
|
5748 | };
|
5749 | module2.exports = scan;
|
5750 | }
|
5751 | });
|
5752 | var require_parse2 = __commonJS2({
|
5753 | "node_modules/picomatch/lib/parse.js"(exports2, module2) {
|
5754 | "use strict";
|
5755 | var constants = require_constants2();
|
5756 | var utils = require_utils3();
|
5757 | var {
|
5758 | MAX_LENGTH,
|
5759 | POSIX_REGEX_SOURCE,
|
5760 | REGEX_NON_SPECIAL_CHARS,
|
5761 | REGEX_SPECIAL_CHARS_BACKREF,
|
5762 | REPLACEMENTS
|
5763 | } = constants;
|
5764 | var expandRange = (args, options) => {
|
5765 | if (typeof options.expandRange === "function") {
|
5766 | return options.expandRange(...args, options);
|
5767 | }
|
5768 | args.sort();
|
5769 | const value = `[${args.join("-")}]`;
|
5770 | try {
|
5771 | new RegExp(value);
|
5772 | } catch (ex) {
|
5773 | return args.map((v) => utils.escapeRegex(v)).join("..");
|
5774 | }
|
5775 | return value;
|
5776 | };
|
5777 | var syntaxError = (type, char) => {
|
5778 | return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
5779 | };
|
5780 | var parse = (input, options) => {
|
5781 | if (typeof input !== "string") {
|
5782 | throw new TypeError("Expected a string");
|
5783 | }
|
5784 | input = REPLACEMENTS[input] || input;
|
5785 | const opts = Object.assign({}, options);
|
5786 | const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
5787 | let len = input.length;
|
5788 | if (len > max) {
|
5789 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
5790 | }
|
5791 | const bos = {
|
5792 | type: "bos",
|
5793 | value: "",
|
5794 | output: opts.prepend || ""
|
5795 | };
|
5796 | const tokens = [bos];
|
5797 | const capture = opts.capture ? "" : "?:";
|
5798 | const win32 = utils.isWindows(options);
|
5799 | const PLATFORM_CHARS = constants.globChars(win32);
|
5800 | const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
5801 | const {
|
5802 | DOT_LITERAL,
|
5803 | PLUS_LITERAL,
|
5804 | SLASH_LITERAL,
|
5805 | ONE_CHAR,
|
5806 | DOTS_SLASH,
|
5807 | NO_DOT,
|
5808 | NO_DOT_SLASH,
|
5809 | NO_DOTS_SLASH,
|
5810 | QMARK,
|
5811 | QMARK_NO_DOT,
|
5812 | STAR,
|
5813 | START_ANCHOR
|
5814 | } = PLATFORM_CHARS;
|
5815 | const globstar = (opts2) => {
|
5816 | return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
5817 | };
|
5818 | const nodot = opts.dot ? "" : NO_DOT;
|
5819 | const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
5820 | let star = opts.bash === true ? globstar(opts) : STAR;
|
5821 | if (opts.capture) {
|
5822 | star = `(${star})`;
|
5823 | }
|
5824 | if (typeof opts.noext === "boolean") {
|
5825 | opts.noextglob = opts.noext;
|
5826 | }
|
5827 | const state = {
|
5828 | input,
|
5829 | index: -1,
|
5830 | start: 0,
|
5831 | dot: opts.dot === true,
|
5832 | consumed: "",
|
5833 | output: "",
|
5834 | prefix: "",
|
5835 | backtrack: false,
|
5836 | negated: false,
|
5837 | brackets: 0,
|
5838 | braces: 0,
|
5839 | parens: 0,
|
5840 | quotes: 0,
|
5841 | globstar: false,
|
5842 | tokens
|
5843 | };
|
5844 | input = utils.removePrefix(input, state);
|
5845 | len = input.length;
|
5846 | const extglobs = [];
|
5847 | const braces = [];
|
5848 | const stack = [];
|
5849 | let prev = bos;
|
5850 | let value;
|
5851 | const eos = () => state.index === len - 1;
|
5852 | const peek = state.peek = (n = 1) => input[state.index + n];
|
5853 | const advance = state.advance = () => input[++state.index] || "";
|
5854 | const remaining = () => input.slice(state.index + 1);
|
5855 | const consume = (value2 = "", num = 0) => {
|
5856 | state.consumed += value2;
|
5857 | state.index += num;
|
5858 | };
|
5859 | const append = (token) => {
|
5860 | state.output += token.output != null ? token.output : token.value;
|
5861 | consume(token.value);
|
5862 | };
|
5863 | const negate = () => {
|
5864 | let count = 1;
|
5865 | while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
5866 | advance();
|
5867 | state.start++;
|
5868 | count++;
|
5869 | }
|
5870 | if (count % 2 === 0) {
|
5871 | return false;
|
5872 | }
|
5873 | state.negated = true;
|
5874 | state.start++;
|
5875 | return true;
|
5876 | };
|
5877 | const increment = (type) => {
|
5878 | state[type]++;
|
5879 | stack.push(type);
|
5880 | };
|
5881 | const decrement = (type) => {
|
5882 | state[type]--;
|
5883 | stack.pop();
|
5884 | };
|
5885 | const push = (tok) => {
|
5886 | if (prev.type === "globstar") {
|
5887 | const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
5888 | const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
5889 | if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
5890 | state.output = state.output.slice(0, -prev.output.length);
|
5891 | prev.type = "star";
|
5892 | prev.value = "*";
|
5893 | prev.output = star;
|
5894 | state.output += prev.output;
|
5895 | }
|
5896 | }
|
5897 | if (extglobs.length && tok.type !== "paren") {
|
5898 | extglobs[extglobs.length - 1].inner += tok.value;
|
5899 | }
|
5900 | if (tok.value || tok.output)
|
5901 | append(tok);
|
5902 | if (prev && prev.type === "text" && tok.type === "text") {
|
5903 | prev.value += tok.value;
|
5904 | prev.output = (prev.output || "") + tok.value;
|
5905 | return;
|
5906 | }
|
5907 | tok.prev = prev;
|
5908 | tokens.push(tok);
|
5909 | prev = tok;
|
5910 | };
|
5911 | const extglobOpen = (type, value2) => {
|
5912 | const token = Object.assign(Object.assign({}, EXTGLOB_CHARS[value2]), {}, {
|
5913 | conditions: 1,
|
5914 | inner: ""
|
5915 | });
|
5916 | token.prev = prev;
|
5917 | token.parens = state.parens;
|
5918 | token.output = state.output;
|
5919 | const output = (opts.capture ? "(" : "") + token.open;
|
5920 | increment("parens");
|
5921 | push({
|
5922 | type,
|
5923 | value: value2,
|
5924 | output: state.output ? "" : ONE_CHAR
|
5925 | });
|
5926 | push({
|
5927 | type: "paren",
|
5928 | extglob: true,
|
5929 | value: advance(),
|
5930 | output
|
5931 | });
|
5932 | extglobs.push(token);
|
5933 | };
|
5934 | const extglobClose = (token) => {
|
5935 | let output = token.close + (opts.capture ? ")" : "");
|
5936 | let rest;
|
5937 | if (token.type === "negate") {
|
5938 | let extglobStar = star;
|
5939 | if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
5940 | extglobStar = globstar(opts);
|
5941 | }
|
5942 | if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
5943 | output = token.close = `)$))${extglobStar}`;
|
5944 | }
|
5945 | if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
5946 | const expression = parse(rest, Object.assign(Object.assign({}, options), {}, {
|
5947 | fastpaths: false
|
5948 | })).output;
|
5949 | output = token.close = `)${expression})${extglobStar})`;
|
5950 | }
|
5951 | if (token.prev.type === "bos") {
|
5952 | state.negatedExtglob = true;
|
5953 | }
|
5954 | }
|
5955 | push({
|
5956 | type: "paren",
|
5957 | extglob: true,
|
5958 | value,
|
5959 | output
|
5960 | });
|
5961 | decrement("parens");
|
5962 | };
|
5963 | if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
5964 | let backslashes = false;
|
5965 | let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
5966 | if (first === "\\") {
|
5967 | backslashes = true;
|
5968 | return m;
|
5969 | }
|
5970 | if (first === "?") {
|
5971 | if (esc) {
|
5972 | return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
5973 | }
|
5974 | if (index === 0) {
|
5975 | return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
5976 | }
|
5977 | return QMARK.repeat(chars.length);
|
5978 | }
|
5979 | if (first === ".") {
|
5980 | return DOT_LITERAL.repeat(chars.length);
|
5981 | }
|
5982 | if (first === "*") {
|
5983 | if (esc) {
|
5984 | return esc + first + (rest ? star : "");
|
5985 | }
|
5986 | return star;
|
5987 | }
|
5988 | return esc ? m : `\\${m}`;
|
5989 | });
|
5990 | if (backslashes === true) {
|
5991 | if (opts.unescape === true) {
|
5992 | output = output.replace(/\\/g, "");
|
5993 | } else {
|
5994 | output = output.replace(/\\+/g, (m) => {
|
5995 | return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
5996 | });
|
5997 | }
|
5998 | }
|
5999 | if (output === input && opts.contains === true) {
|
6000 | state.output = input;
|
6001 | return state;
|
6002 | }
|
6003 | state.output = utils.wrapOutput(output, state, options);
|
6004 | return state;
|
6005 | }
|
6006 | while (!eos()) {
|
6007 | value = advance();
|
6008 | if (value === "\0") {
|
6009 | continue;
|
6010 | }
|
6011 | if (value === "\\") {
|
6012 | const next = peek();
|
6013 | if (next === "/" && opts.bash !== true) {
|
6014 | continue;
|
6015 | }
|
6016 | if (next === "." || next === ";") {
|
6017 | continue;
|
6018 | }
|
6019 | if (!next) {
|
6020 | value += "\\";
|
6021 | push({
|
6022 | type: "text",
|
6023 | value
|
6024 | });
|
6025 | continue;
|
6026 | }
|
6027 | const match = /^\\+/.exec(remaining());
|
6028 | let slashes = 0;
|
6029 | if (match && match[0].length > 2) {
|
6030 | slashes = match[0].length;
|
6031 | state.index += slashes;
|
6032 | if (slashes % 2 !== 0) {
|
6033 | value += "\\";
|
6034 | }
|
6035 | }
|
6036 | if (opts.unescape === true) {
|
6037 | value = advance();
|
6038 | } else {
|
6039 | value += advance();
|
6040 | }
|
6041 | if (state.brackets === 0) {
|
6042 | push({
|
6043 | type: "text",
|
6044 | value
|
6045 | });
|
6046 | continue;
|
6047 | }
|
6048 | }
|
6049 | if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
6050 | if (opts.posix !== false && value === ":") {
|
6051 | const inner = prev.value.slice(1);
|
6052 | if (inner.includes("[")) {
|
6053 | prev.posix = true;
|
6054 | if (inner.includes(":")) {
|
6055 | const idx = prev.value.lastIndexOf("[");
|
6056 | const pre = prev.value.slice(0, idx);
|
6057 | const rest2 = prev.value.slice(idx + 2);
|
6058 | const posix = POSIX_REGEX_SOURCE[rest2];
|
6059 | if (posix) {
|
6060 | prev.value = pre + posix;
|
6061 | state.backtrack = true;
|
6062 | advance();
|
6063 | if (!bos.output && tokens.indexOf(prev) === 1) {
|
6064 | bos.output = ONE_CHAR;
|
6065 | }
|
6066 | continue;
|
6067 | }
|
6068 | }
|
6069 | }
|
6070 | }
|
6071 | if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
6072 | value = `\\${value}`;
|
6073 | }
|
6074 | if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
6075 | value = `\\${value}`;
|
6076 | }
|
6077 | if (opts.posix === true && value === "!" && prev.value === "[") {
|
6078 | value = "^";
|
6079 | }
|
6080 | prev.value += value;
|
6081 | append({
|
6082 | value
|
6083 | });
|
6084 | continue;
|
6085 | }
|
6086 | if (state.quotes === 1 && value !== '"') {
|
6087 | value = utils.escapeRegex(value);
|
6088 | prev.value += value;
|
6089 | append({
|
6090 | value
|
6091 | });
|
6092 | continue;
|
6093 | }
|
6094 | if (value === '"') {
|
6095 | state.quotes = state.quotes === 1 ? 0 : 1;
|
6096 | if (opts.keepQuotes === true) {
|
6097 | push({
|
6098 | type: "text",
|
6099 | value
|
6100 | });
|
6101 | }
|
6102 | continue;
|
6103 | }
|
6104 | if (value === "(") {
|
6105 | increment("parens");
|
6106 | push({
|
6107 | type: "paren",
|
6108 | value
|
6109 | });
|
6110 | continue;
|
6111 | }
|
6112 | if (value === ")") {
|
6113 | if (state.parens === 0 && opts.strictBrackets === true) {
|
6114 | throw new SyntaxError(syntaxError("opening", "("));
|
6115 | }
|
6116 | const extglob = extglobs[extglobs.length - 1];
|
6117 | if (extglob && state.parens === extglob.parens + 1) {
|
6118 | extglobClose(extglobs.pop());
|
6119 | continue;
|
6120 | }
|
6121 | push({
|
6122 | type: "paren",
|
6123 | value,
|
6124 | output: state.parens ? ")" : "\\)"
|
6125 | });
|
6126 | decrement("parens");
|
6127 | continue;
|
6128 | }
|
6129 | if (value === "[") {
|
6130 | if (opts.nobracket === true || !remaining().includes("]")) {
|
6131 | if (opts.nobracket !== true && opts.strictBrackets === true) {
|
6132 | throw new SyntaxError(syntaxError("closing", "]"));
|
6133 | }
|
6134 | value = `\\${value}`;
|
6135 | } else {
|
6136 | increment("brackets");
|
6137 | }
|
6138 | push({
|
6139 | type: "bracket",
|
6140 | value
|
6141 | });
|
6142 | continue;
|
6143 | }
|
6144 | if (value === "]") {
|
6145 | if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
6146 | push({
|
6147 | type: "text",
|
6148 | value,
|
6149 | output: `\\${value}`
|
6150 | });
|
6151 | continue;
|
6152 | }
|
6153 | if (state.brackets === 0) {
|
6154 | if (opts.strictBrackets === true) {
|
6155 | throw new SyntaxError(syntaxError("opening", "["));
|
6156 | }
|
6157 | push({
|
6158 | type: "text",
|
6159 | value,
|
6160 | output: `\\${value}`
|
6161 | });
|
6162 | continue;
|
6163 | }
|
6164 | decrement("brackets");
|
6165 | const prevValue = prev.value.slice(1);
|
6166 | if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
6167 | value = `/${value}`;
|
6168 | }
|
6169 | prev.value += value;
|
6170 | append({
|
6171 | value
|
6172 | });
|
6173 | if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
6174 | continue;
|
6175 | }
|
6176 | const escaped = utils.escapeRegex(prev.value);
|
6177 | state.output = state.output.slice(0, -prev.value.length);
|
6178 | if (opts.literalBrackets === true) {
|
6179 | state.output += escaped;
|
6180 | prev.value = escaped;
|
6181 | continue;
|
6182 | }
|
6183 | prev.value = `(${capture}${escaped}|${prev.value})`;
|
6184 | state.output += prev.value;
|
6185 | continue;
|
6186 | }
|
6187 | if (value === "{" && opts.nobrace !== true) {
|
6188 | increment("braces");
|
6189 | const open = {
|
6190 | type: "brace",
|
6191 | value,
|
6192 | output: "(",
|
6193 | outputIndex: state.output.length,
|
6194 | tokensIndex: state.tokens.length
|
6195 | };
|
6196 | braces.push(open);
|
6197 | push(open);
|
6198 | continue;
|
6199 | }
|
6200 | if (value === "}") {
|
6201 | const brace = braces[braces.length - 1];
|
6202 | if (opts.nobrace === true || !brace) {
|
6203 | push({
|
6204 | type: "text",
|
6205 | value,
|
6206 | output: value
|
6207 | });
|
6208 | continue;
|
6209 | }
|
6210 | let output = ")";
|
6211 | if (brace.dots === true) {
|
6212 | const arr = tokens.slice();
|
6213 | const range = [];
|
6214 | for (let i = arr.length - 1; i >= 0; i--) {
|
6215 | tokens.pop();
|
6216 | if (arr[i].type === "brace") {
|
6217 | break;
|
6218 | }
|
6219 | if (arr[i].type !== "dots") {
|
6220 | range.unshift(arr[i].value);
|
6221 | }
|
6222 | }
|
6223 | output = expandRange(range, opts);
|
6224 | state.backtrack = true;
|
6225 | }
|
6226 | if (brace.comma !== true && brace.dots !== true) {
|
6227 | const out = state.output.slice(0, brace.outputIndex);
|
6228 | const toks = state.tokens.slice(brace.tokensIndex);
|
6229 | brace.value = brace.output = "\\{";
|
6230 | value = output = "\\}";
|
6231 | state.output = out;
|
6232 | for (const t of toks) {
|
6233 | state.output += t.output || t.value;
|
6234 | }
|
6235 | }
|
6236 | push({
|
6237 | type: "brace",
|
6238 | value,
|
6239 | output
|
6240 | });
|
6241 | decrement("braces");
|
6242 | braces.pop();
|
6243 | continue;
|
6244 | }
|
6245 | if (value === "|") {
|
6246 | if (extglobs.length > 0) {
|
6247 | extglobs[extglobs.length - 1].conditions++;
|
6248 | }
|
6249 | push({
|
6250 | type: "text",
|
6251 | value
|
6252 | });
|
6253 | continue;
|
6254 | }
|
6255 | if (value === ",") {
|
6256 | let output = value;
|
6257 | const brace = braces[braces.length - 1];
|
6258 | if (brace && stack[stack.length - 1] === "braces") {
|
6259 | brace.comma = true;
|
6260 | output = "|";
|
6261 | }
|
6262 | push({
|
6263 | type: "comma",
|
6264 | value,
|
6265 | output
|
6266 | });
|
6267 | continue;
|
6268 | }
|
6269 | if (value === "/") {
|
6270 | if (prev.type === "dot" && state.index === state.start + 1) {
|
6271 | state.start = state.index + 1;
|
6272 | state.consumed = "";
|
6273 | state.output = "";
|
6274 | tokens.pop();
|
6275 | prev = bos;
|
6276 | continue;
|
6277 | }
|
6278 | push({
|
6279 | type: "slash",
|
6280 | value,
|
6281 | output: SLASH_LITERAL
|
6282 | });
|
6283 | continue;
|
6284 | }
|
6285 | if (value === ".") {
|
6286 | if (state.braces > 0 && prev.type === "dot") {
|
6287 | if (prev.value === ".")
|
6288 | prev.output = DOT_LITERAL;
|
6289 | const brace = braces[braces.length - 1];
|
6290 | prev.type = "dots";
|
6291 | prev.output += value;
|
6292 | prev.value += value;
|
6293 | brace.dots = true;
|
6294 | continue;
|
6295 | }
|
6296 | if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
6297 | push({
|
6298 | type: "text",
|
6299 | value,
|
6300 | output: DOT_LITERAL
|
6301 | });
|
6302 | continue;
|
6303 | }
|
6304 | push({
|
6305 | type: "dot",
|
6306 | value,
|
6307 | output: DOT_LITERAL
|
6308 | });
|
6309 | continue;
|
6310 | }
|
6311 | if (value === "?") {
|
6312 | const isGroup = prev && prev.value === "(";
|
6313 | if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
6314 | extglobOpen("qmark", value);
|
6315 | continue;
|
6316 | }
|
6317 | if (prev && prev.type === "paren") {
|
6318 | const next = peek();
|
6319 | let output = value;
|
6320 | if (next === "<" && !utils.supportsLookbehinds()) {
|
6321 | throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
6322 | }
|
6323 | if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
6324 | output = `\\${value}`;
|
6325 | }
|
6326 | push({
|
6327 | type: "text",
|
6328 | value,
|
6329 | output
|
6330 | });
|
6331 | continue;
|
6332 | }
|
6333 | if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
6334 | push({
|
6335 | type: "qmark",
|
6336 | value,
|
6337 | output: QMARK_NO_DOT
|
6338 | });
|
6339 | continue;
|
6340 | }
|
6341 | push({
|
6342 | type: "qmark",
|
6343 | value,
|
6344 | output: QMARK
|
6345 | });
|
6346 | continue;
|
6347 | }
|
6348 | if (value === "!") {
|
6349 | if (opts.noextglob !== true && peek() === "(") {
|
6350 | if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
6351 | extglobOpen("negate", value);
|
6352 | continue;
|
6353 | }
|
6354 | }
|
6355 | if (opts.nonegate !== true && state.index === 0) {
|
6356 | negate();
|
6357 | continue;
|
6358 | }
|
6359 | }
|
6360 | if (value === "+") {
|
6361 | if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
6362 | extglobOpen("plus", value);
|
6363 | continue;
|
6364 | }
|
6365 | if (prev && prev.value === "(" || opts.regex === false) {
|
6366 | push({
|
6367 | type: "plus",
|
6368 | value,
|
6369 | output: PLUS_LITERAL
|
6370 | });
|
6371 | continue;
|
6372 | }
|
6373 | if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
6374 | push({
|
6375 | type: "plus",
|
6376 | value
|
6377 | });
|
6378 | continue;
|
6379 | }
|
6380 | push({
|
6381 | type: "plus",
|
6382 | value: PLUS_LITERAL
|
6383 | });
|
6384 | continue;
|
6385 | }
|
6386 | if (value === "@") {
|
6387 | if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
6388 | push({
|
6389 | type: "at",
|
6390 | extglob: true,
|
6391 | value,
|
6392 | output: ""
|
6393 | });
|
6394 | continue;
|
6395 | }
|
6396 | push({
|
6397 | type: "text",
|
6398 | value
|
6399 | });
|
6400 | continue;
|
6401 | }
|
6402 | if (value !== "*") {
|
6403 | if (value === "$" || value === "^") {
|
6404 | value = `\\${value}`;
|
6405 | }
|
6406 | const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
6407 | if (match) {
|
6408 | value += match[0];
|
6409 | state.index += match[0].length;
|
6410 | }
|
6411 | push({
|
6412 | type: "text",
|
6413 | value
|
6414 | });
|
6415 | continue;
|
6416 | }
|
6417 | if (prev && (prev.type === "globstar" || prev.star === true)) {
|
6418 | prev.type = "star";
|
6419 | prev.star = true;
|
6420 | prev.value += value;
|
6421 | prev.output = star;
|
6422 | state.backtrack = true;
|
6423 | state.globstar = true;
|
6424 | consume(value);
|
6425 | continue;
|
6426 | }
|
6427 | let rest = remaining();
|
6428 | if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
6429 | extglobOpen("star", value);
|
6430 | continue;
|
6431 | }
|
6432 | if (prev.type === "star") {
|
6433 | if (opts.noglobstar === true) {
|
6434 | consume(value);
|
6435 | continue;
|
6436 | }
|
6437 | const prior = prev.prev;
|
6438 | const before = prior.prev;
|
6439 | const isStart = prior.type === "slash" || prior.type === "bos";
|
6440 | const afterStar = before && (before.type === "star" || before.type === "globstar");
|
6441 | if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
6442 | push({
|
6443 | type: "star",
|
6444 | value,
|
6445 | output: ""
|
6446 | });
|
6447 | continue;
|
6448 | }
|
6449 | const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
6450 | const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
6451 | if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
6452 | push({
|
6453 | type: "star",
|
6454 | value,
|
6455 | output: ""
|
6456 | });
|
6457 | continue;
|
6458 | }
|
6459 | while (rest.slice(0, 3) === "/**") {
|
6460 | const after = input[state.index + 4];
|
6461 | if (after && after !== "/") {
|
6462 | break;
|
6463 | }
|
6464 | rest = rest.slice(3);
|
6465 | consume("/**", 3);
|
6466 | }
|
6467 | if (prior.type === "bos" && eos()) {
|
6468 | prev.type = "globstar";
|
6469 | prev.value += value;
|
6470 | prev.output = globstar(opts);
|
6471 | state.output = prev.output;
|
6472 | state.globstar = true;
|
6473 | consume(value);
|
6474 | continue;
|
6475 | }
|
6476 | if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
6477 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
6478 | prior.output = `(?:${prior.output}`;
|
6479 | prev.type = "globstar";
|
6480 | prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
6481 | prev.value += value;
|
6482 | state.globstar = true;
|
6483 | state.output += prior.output + prev.output;
|
6484 | consume(value);
|
6485 | continue;
|
6486 | }
|
6487 | if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
6488 | const end = rest[1] !== void 0 ? "|$" : "";
|
6489 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
6490 | prior.output = `(?:${prior.output}`;
|
6491 | prev.type = "globstar";
|
6492 | prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
6493 | prev.value += value;
|
6494 | state.output += prior.output + prev.output;
|
6495 | state.globstar = true;
|
6496 | consume(value + advance());
|
6497 | push({
|
6498 | type: "slash",
|
6499 | value: "/",
|
6500 | output: ""
|
6501 | });
|
6502 | continue;
|
6503 | }
|
6504 | if (prior.type === "bos" && rest[0] === "/") {
|
6505 | prev.type = "globstar";
|
6506 | prev.value += value;
|
6507 | prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
6508 | state.output = prev.output;
|
6509 | state.globstar = true;
|
6510 | consume(value + advance());
|
6511 | push({
|
6512 | type: "slash",
|
6513 | value: "/",
|
6514 | output: ""
|
6515 | });
|
6516 | continue;
|
6517 | }
|
6518 | state.output = state.output.slice(0, -prev.output.length);
|
6519 | prev.type = "globstar";
|
6520 | prev.output = globstar(opts);
|
6521 | prev.value += value;
|
6522 | state.output += prev.output;
|
6523 | state.globstar = true;
|
6524 | consume(value);
|
6525 | continue;
|
6526 | }
|
6527 | const token = {
|
6528 | type: "star",
|
6529 | value,
|
6530 | output: star
|
6531 | };
|
6532 | if (opts.bash === true) {
|
6533 | token.output = ".*?";
|
6534 | if (prev.type === "bos" || prev.type === "slash") {
|
6535 | token.output = nodot + token.output;
|
6536 | }
|
6537 | push(token);
|
6538 | continue;
|
6539 | }
|
6540 | if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
6541 | token.output = value;
|
6542 | push(token);
|
6543 | continue;
|
6544 | }
|
6545 | if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
6546 | if (prev.type === "dot") {
|
6547 | state.output += NO_DOT_SLASH;
|
6548 | prev.output += NO_DOT_SLASH;
|
6549 | } else if (opts.dot === true) {
|
6550 | state.output += NO_DOTS_SLASH;
|
6551 | prev.output += NO_DOTS_SLASH;
|
6552 | } else {
|
6553 | state.output += nodot;
|
6554 | prev.output += nodot;
|
6555 | }
|
6556 | if (peek() !== "*") {
|
6557 | state.output += ONE_CHAR;
|
6558 | prev.output += ONE_CHAR;
|
6559 | }
|
6560 | }
|
6561 | push(token);
|
6562 | }
|
6563 | while (state.brackets > 0) {
|
6564 | if (opts.strictBrackets === true)
|
6565 | throw new SyntaxError(syntaxError("closing", "]"));
|
6566 | state.output = utils.escapeLast(state.output, "[");
|
6567 | decrement("brackets");
|
6568 | }
|
6569 | while (state.parens > 0) {
|
6570 | if (opts.strictBrackets === true)
|
6571 | throw new SyntaxError(syntaxError("closing", ")"));
|
6572 | state.output = utils.escapeLast(state.output, "(");
|
6573 | decrement("parens");
|
6574 | }
|
6575 | while (state.braces > 0) {
|
6576 | if (opts.strictBrackets === true)
|
6577 | throw new SyntaxError(syntaxError("closing", "}"));
|
6578 | state.output = utils.escapeLast(state.output, "{");
|
6579 | decrement("braces");
|
6580 | }
|
6581 | if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
6582 | push({
|
6583 | type: "maybe_slash",
|
6584 | value: "",
|
6585 | output: `${SLASH_LITERAL}?`
|
6586 | });
|
6587 | }
|
6588 | if (state.backtrack === true) {
|
6589 | state.output = "";
|
6590 | for (const token of state.tokens) {
|
6591 | state.output += token.output != null ? token.output : token.value;
|
6592 | if (token.suffix) {
|
6593 | state.output += token.suffix;
|
6594 | }
|
6595 | }
|
6596 | }
|
6597 | return state;
|
6598 | };
|
6599 | parse.fastpaths = (input, options) => {
|
6600 | const opts = Object.assign({}, options);
|
6601 | const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
6602 | const len = input.length;
|
6603 | if (len > max) {
|
6604 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
6605 | }
|
6606 | input = REPLACEMENTS[input] || input;
|
6607 | const win32 = utils.isWindows(options);
|
6608 | const {
|
6609 | DOT_LITERAL,
|
6610 | SLASH_LITERAL,
|
6611 | ONE_CHAR,
|
6612 | DOTS_SLASH,
|
6613 | NO_DOT,
|
6614 | NO_DOTS,
|
6615 | NO_DOTS_SLASH,
|
6616 | STAR,
|
6617 | START_ANCHOR
|
6618 | } = constants.globChars(win32);
|
6619 | const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
6620 | const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
6621 | const capture = opts.capture ? "" : "?:";
|
6622 | const state = {
|
6623 | negated: false,
|
6624 | prefix: ""
|
6625 | };
|
6626 | let star = opts.bash === true ? ".*?" : STAR;
|
6627 | if (opts.capture) {
|
6628 | star = `(${star})`;
|
6629 | }
|
6630 | const globstar = (opts2) => {
|
6631 | if (opts2.noglobstar === true)
|
6632 | return star;
|
6633 | return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
6634 | };
|
6635 | const create = (str) => {
|
6636 | switch (str) {
|
6637 | case "*":
|
6638 | return `${nodot}${ONE_CHAR}${star}`;
|
6639 | case ".*":
|
6640 | return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
6641 | case "*.*":
|
6642 | return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
6643 | case "*/*":
|
6644 | return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
6645 | case "**":
|
6646 | return nodot + globstar(opts);
|
6647 | case "**/*":
|
6648 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
6649 | case "**/*.*":
|
6650 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
6651 | case "**/.*":
|
6652 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
6653 | default: {
|
6654 | const match = /^(.*?)\.(\w+)$/.exec(str);
|
6655 | if (!match)
|
6656 | return;
|
6657 | const source2 = create(match[1]);
|
6658 | if (!source2)
|
6659 | return;
|
6660 | return source2 + DOT_LITERAL + match[2];
|
6661 | }
|
6662 | }
|
6663 | };
|
6664 | const output = utils.removePrefix(input, state);
|
6665 | let source = create(output);
|
6666 | if (source && opts.strictSlashes !== true) {
|
6667 | source += `${SLASH_LITERAL}?`;
|
6668 | }
|
6669 | return source;
|
6670 | };
|
6671 | module2.exports = parse;
|
6672 | }
|
6673 | });
|
6674 | var require_picomatch = __commonJS2({
|
6675 | "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
6676 | "use strict";
|
6677 | var path = require("path");
|
6678 | var scan = require_scan();
|
6679 | var parse = require_parse2();
|
6680 | var utils = require_utils3();
|
6681 | var constants = require_constants2();
|
6682 | var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
6683 | var picomatch = (glob, options, returnState = false) => {
|
6684 | if (Array.isArray(glob)) {
|
6685 | const fns = glob.map((input) => picomatch(input, options, returnState));
|
6686 | const arrayMatcher = (str) => {
|
6687 | for (const isMatch of fns) {
|
6688 | const state2 = isMatch(str);
|
6689 | if (state2)
|
6690 | return state2;
|
6691 | }
|
6692 | return false;
|
6693 | };
|
6694 | return arrayMatcher;
|
6695 | }
|
6696 | const isState = isObject(glob) && glob.tokens && glob.input;
|
6697 | if (glob === "" || typeof glob !== "string" && !isState) {
|
6698 | throw new TypeError("Expected pattern to be a non-empty string");
|
6699 | }
|
6700 | const opts = options || {};
|
6701 | const posix = utils.isWindows(options);
|
6702 | const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
6703 | const state = regex.state;
|
6704 | delete regex.state;
|
6705 | let isIgnored = () => false;
|
6706 | if (opts.ignore) {
|
6707 | const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
|
6708 | ignore: null,
|
6709 | onMatch: null,
|
6710 | onResult: null
|
6711 | });
|
6712 | isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
6713 | }
|
6714 | const matcher = (input, returnObject = false) => {
|
6715 | const {
|
6716 | isMatch,
|
6717 | match,
|
6718 | output
|
6719 | } = picomatch.test(input, regex, options, {
|
6720 | glob,
|
6721 | posix
|
6722 | });
|
6723 | const result = {
|
6724 | glob,
|
6725 | state,
|
6726 | regex,
|
6727 | posix,
|
6728 | input,
|
6729 | output,
|
6730 | match,
|
6731 | isMatch
|
6732 | };
|
6733 | if (typeof opts.onResult === "function") {
|
6734 | opts.onResult(result);
|
6735 | }
|
6736 | if (isMatch === false) {
|
6737 | result.isMatch = false;
|
6738 | return returnObject ? result : false;
|
6739 | }
|
6740 | if (isIgnored(input)) {
|
6741 | if (typeof opts.onIgnore === "function") {
|
6742 | opts.onIgnore(result);
|
6743 | }
|
6744 | result.isMatch = false;
|
6745 | return returnObject ? result : false;
|
6746 | }
|
6747 | if (typeof opts.onMatch === "function") {
|
6748 | opts.onMatch(result);
|
6749 | }
|
6750 | return returnObject ? result : true;
|
6751 | };
|
6752 | if (returnState) {
|
6753 | matcher.state = state;
|
6754 | }
|
6755 | return matcher;
|
6756 | };
|
6757 | picomatch.test = (input, regex, options, {
|
6758 | glob,
|
6759 | posix
|
6760 | } = {}) => {
|
6761 | if (typeof input !== "string") {
|
6762 | throw new TypeError("Expected input to be a string");
|
6763 | }
|
6764 | if (input === "") {
|
6765 | return {
|
6766 | isMatch: false,
|
6767 | output: ""
|
6768 | };
|
6769 | }
|
6770 | const opts = options || {};
|
6771 | const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
6772 | let match = input === glob;
|
6773 | let output = match && format ? format(input) : input;
|
6774 | if (match === false) {
|
6775 | output = format ? format(input) : input;
|
6776 | match = output === glob;
|
6777 | }
|
6778 | if (match === false || opts.capture === true) {
|
6779 | if (opts.matchBase === true || opts.basename === true) {
|
6780 | match = picomatch.matchBase(input, regex, options, posix);
|
6781 | } else {
|
6782 | match = regex.exec(output);
|
6783 | }
|
6784 | }
|
6785 | return {
|
6786 | isMatch: Boolean(match),
|
6787 | match,
|
6788 | output
|
6789 | };
|
6790 | };
|
6791 | picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
6792 | const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
6793 | return regex.test(path.basename(input));
|
6794 | };
|
6795 | picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
6796 | picomatch.parse = (pattern, options) => {
|
6797 | if (Array.isArray(pattern))
|
6798 | return pattern.map((p) => picomatch.parse(p, options));
|
6799 | return parse(pattern, Object.assign(Object.assign({}, options), {}, {
|
6800 | fastpaths: false
|
6801 | }));
|
6802 | };
|
6803 | picomatch.scan = (input, options) => scan(input, options);
|
6804 | picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
6805 | if (returnOutput === true) {
|
6806 | return state.output;
|
6807 | }
|
6808 | const opts = options || {};
|
6809 | const prepend = opts.contains ? "" : "^";
|
6810 | const append = opts.contains ? "" : "$";
|
6811 | let source = `${prepend}(?:${state.output})${append}`;
|
6812 | if (state && state.negated === true) {
|
6813 | source = `^(?!${source}).*$`;
|
6814 | }
|
6815 | const regex = picomatch.toRegex(source, options);
|
6816 | if (returnState === true) {
|
6817 | regex.state = state;
|
6818 | }
|
6819 | return regex;
|
6820 | };
|
6821 | picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
6822 | if (!input || typeof input !== "string") {
|
6823 | throw new TypeError("Expected a non-empty string");
|
6824 | }
|
6825 | let parsed = {
|
6826 | negated: false,
|
6827 | fastpaths: true
|
6828 | };
|
6829 | if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
6830 | parsed.output = parse.fastpaths(input, options);
|
6831 | }
|
6832 | if (!parsed.output) {
|
6833 | parsed = parse(input, options);
|
6834 | }
|
6835 | return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
6836 | };
|
6837 | picomatch.toRegex = (source, options) => {
|
6838 | try {
|
6839 | const opts = options || {};
|
6840 | return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
6841 | } catch (err) {
|
6842 | if (options && options.debug === true)
|
6843 | throw err;
|
6844 | return /$^/;
|
6845 | }
|
6846 | };
|
6847 | picomatch.constants = constants;
|
6848 | module2.exports = picomatch;
|
6849 | }
|
6850 | });
|
6851 | var require_picomatch2 = __commonJS2({
|
6852 | "node_modules/picomatch/index.js"(exports2, module2) {
|
6853 | "use strict";
|
6854 | module2.exports = require_picomatch();
|
6855 | }
|
6856 | });
|
6857 | var require_micromatch = __commonJS2({
|
6858 | "node_modules/micromatch/index.js"(exports2, module2) {
|
6859 | "use strict";
|
6860 | var util = require("util");
|
6861 | var braces = require_braces();
|
6862 | var picomatch = require_picomatch2();
|
6863 | var utils = require_utils3();
|
6864 | var isEmptyString = (val) => val === "" || val === "./";
|
6865 | var micromatch = (list, patterns, options) => {
|
6866 | patterns = [].concat(patterns);
|
6867 | list = [].concat(list);
|
6868 | let omit = new Set();
|
6869 | let keep = new Set();
|
6870 | let items = new Set();
|
6871 | let negatives = 0;
|
6872 | let onResult = (state) => {
|
6873 | items.add(state.output);
|
6874 | if (options && options.onResult) {
|
6875 | options.onResult(state);
|
6876 | }
|
6877 | };
|
6878 | for (let i = 0; i < patterns.length; i++) {
|
6879 | let isMatch = picomatch(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
|
6880 | onResult
|
6881 | }), true);
|
6882 | let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
6883 | if (negated)
|
6884 | negatives++;
|
6885 | for (let item of list) {
|
6886 | let matched = isMatch(item, true);
|
6887 | let match = negated ? !matched.isMatch : matched.isMatch;
|
6888 | if (!match)
|
6889 | continue;
|
6890 | if (negated) {
|
6891 | omit.add(matched.output);
|
6892 | } else {
|
6893 | omit.delete(matched.output);
|
6894 | keep.add(matched.output);
|
6895 | }
|
6896 | }
|
6897 | }
|
6898 | let result = negatives === patterns.length ? [...items] : [...keep];
|
6899 | let matches = result.filter((item) => !omit.has(item));
|
6900 | if (options && matches.length === 0) {
|
6901 | if (options.failglob === true) {
|
6902 | throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
6903 | }
|
6904 | if (options.nonull === true || options.nullglob === true) {
|
6905 | return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
6906 | }
|
6907 | }
|
6908 | return matches;
|
6909 | };
|
6910 | micromatch.match = micromatch;
|
6911 | micromatch.matcher = (pattern, options) => picomatch(pattern, options);
|
6912 | micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
6913 | micromatch.any = micromatch.isMatch;
|
6914 | micromatch.not = (list, patterns, options = {}) => {
|
6915 | patterns = [].concat(patterns).map(String);
|
6916 | let result = new Set();
|
6917 | let items = [];
|
6918 | let onResult = (state) => {
|
6919 | if (options.onResult)
|
6920 | options.onResult(state);
|
6921 | items.push(state.output);
|
6922 | };
|
6923 | let matches = new Set(micromatch(list, patterns, Object.assign(Object.assign({}, options), {}, {
|
6924 | onResult
|
6925 | })));
|
6926 | for (let item of items) {
|
6927 | if (!matches.has(item)) {
|
6928 | result.add(item);
|
6929 | }
|
6930 | }
|
6931 | return [...result];
|
6932 | };
|
6933 | micromatch.contains = (str, pattern, options) => {
|
6934 | if (typeof str !== "string") {
|
6935 | throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
6936 | }
|
6937 | if (Array.isArray(pattern)) {
|
6938 | return pattern.some((p) => micromatch.contains(str, p, options));
|
6939 | }
|
6940 | if (typeof pattern === "string") {
|
6941 | if (isEmptyString(str) || isEmptyString(pattern)) {
|
6942 | return false;
|
6943 | }
|
6944 | if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
|
6945 | return true;
|
6946 | }
|
6947 | }
|
6948 | return micromatch.isMatch(str, pattern, Object.assign(Object.assign({}, options), {}, {
|
6949 | contains: true
|
6950 | }));
|
6951 | };
|
6952 | micromatch.matchKeys = (obj, patterns, options) => {
|
6953 | if (!utils.isObject(obj)) {
|
6954 | throw new TypeError("Expected the first argument to be an object");
|
6955 | }
|
6956 | let keys = micromatch(Object.keys(obj), patterns, options);
|
6957 | let res = {};
|
6958 | for (let key of keys)
|
6959 | res[key] = obj[key];
|
6960 | return res;
|
6961 | };
|
6962 | micromatch.some = (list, patterns, options) => {
|
6963 | let items = [].concat(list);
|
6964 | for (let pattern of [].concat(patterns)) {
|
6965 | let isMatch = picomatch(String(pattern), options);
|
6966 | if (items.some((item) => isMatch(item))) {
|
6967 | return true;
|
6968 | }
|
6969 | }
|
6970 | return false;
|
6971 | };
|
6972 | micromatch.every = (list, patterns, options) => {
|
6973 | let items = [].concat(list);
|
6974 | for (let pattern of [].concat(patterns)) {
|
6975 | let isMatch = picomatch(String(pattern), options);
|
6976 | if (!items.every((item) => isMatch(item))) {
|
6977 | return false;
|
6978 | }
|
6979 | }
|
6980 | return true;
|
6981 | };
|
6982 | micromatch.all = (str, patterns, options) => {
|
6983 | if (typeof str !== "string") {
|
6984 | throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
6985 | }
|
6986 | return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
6987 | };
|
6988 | micromatch.capture = (glob, input, options) => {
|
6989 | let posix = utils.isWindows(options);
|
6990 | let regex = picomatch.makeRe(String(glob), Object.assign(Object.assign({}, options), {}, {
|
6991 | capture: true
|
6992 | }));
|
6993 | let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
6994 | if (match) {
|
6995 | return match.slice(1).map((v) => v === void 0 ? "" : v);
|
6996 | }
|
6997 | };
|
6998 | micromatch.makeRe = (...args) => picomatch.makeRe(...args);
|
6999 | micromatch.scan = (...args) => picomatch.scan(...args);
|
7000 | micromatch.parse = (patterns, options) => {
|
7001 | let res = [];
|
7002 | for (let pattern of [].concat(patterns || [])) {
|
7003 | for (let str of braces(String(pattern), options)) {
|
7004 | res.push(picomatch.parse(str, options));
|
7005 | }
|
7006 | }
|
7007 | return res;
|
7008 | };
|
7009 | micromatch.braces = (pattern, options) => {
|
7010 | if (typeof pattern !== "string")
|
7011 | throw new TypeError("Expected a string");
|
7012 | if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
|
7013 | return [pattern];
|
7014 | }
|
7015 | return braces(pattern, options);
|
7016 | };
|
7017 | micromatch.braceExpand = (pattern, options) => {
|
7018 | if (typeof pattern !== "string")
|
7019 | throw new TypeError("Expected a string");
|
7020 | return micromatch.braces(pattern, Object.assign(Object.assign({}, options), {}, {
|
7021 | expand: true
|
7022 | }));
|
7023 | };
|
7024 | module2.exports = micromatch;
|
7025 | }
|
7026 | });
|
7027 | var require_pattern = __commonJS2({
|
7028 | "node_modules/fast-glob/out/utils/pattern.js"(exports2) {
|
7029 | "use strict";
|
7030 | Object.defineProperty(exports2, "__esModule", {
|
7031 | value: true
|
7032 | });
|
7033 | exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
|
7034 | var path = require("path");
|
7035 | var globParent = require_glob_parent();
|
7036 | var micromatch = require_micromatch();
|
7037 | var GLOBSTAR = "**";
|
7038 | var ESCAPE_SYMBOL = "\\";
|
7039 | var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
|
7040 | var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
|
7041 | var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
|
7042 | var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
|
7043 | var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
|
7044 | function isStaticPattern(pattern, options = {}) {
|
7045 | return !isDynamicPattern(pattern, options);
|
7046 | }
|
7047 | exports2.isStaticPattern = isStaticPattern;
|
7048 | function isDynamicPattern(pattern, options = {}) {
|
7049 | if (pattern === "") {
|
7050 | return false;
|
7051 | }
|
7052 | if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
|
7053 | return true;
|
7054 | }
|
7055 | if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
|
7056 | return true;
|
7057 | }
|
7058 | if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
|
7059 | return true;
|
7060 | }
|
7061 | if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
|
7062 | return true;
|
7063 | }
|
7064 | return false;
|
7065 | }
|
7066 | exports2.isDynamicPattern = isDynamicPattern;
|
7067 | function hasBraceExpansion(pattern) {
|
7068 | const openingBraceIndex = pattern.indexOf("{");
|
7069 | if (openingBraceIndex === -1) {
|
7070 | return false;
|
7071 | }
|
7072 | const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
|
7073 | if (closingBraceIndex === -1) {
|
7074 | return false;
|
7075 | }
|
7076 | const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
|
7077 | return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
|
7078 | }
|
7079 | function convertToPositivePattern(pattern) {
|
7080 | return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
7081 | }
|
7082 | exports2.convertToPositivePattern = convertToPositivePattern;
|
7083 | function convertToNegativePattern(pattern) {
|
7084 | return "!" + pattern;
|
7085 | }
|
7086 | exports2.convertToNegativePattern = convertToNegativePattern;
|
7087 | function isNegativePattern(pattern) {
|
7088 | return pattern.startsWith("!") && pattern[1] !== "(";
|
7089 | }
|
7090 | exports2.isNegativePattern = isNegativePattern;
|
7091 | function isPositivePattern(pattern) {
|
7092 | return !isNegativePattern(pattern);
|
7093 | }
|
7094 | exports2.isPositivePattern = isPositivePattern;
|
7095 | function getNegativePatterns(patterns) {
|
7096 | return patterns.filter(isNegativePattern);
|
7097 | }
|
7098 | exports2.getNegativePatterns = getNegativePatterns;
|
7099 | function getPositivePatterns(patterns) {
|
7100 | return patterns.filter(isPositivePattern);
|
7101 | }
|
7102 | exports2.getPositivePatterns = getPositivePatterns;
|
7103 | function getPatternsInsideCurrentDirectory(patterns) {
|
7104 | return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
|
7105 | }
|
7106 | exports2.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
|
7107 | function getPatternsOutsideCurrentDirectory(patterns) {
|
7108 | return patterns.filter(isPatternRelatedToParentDirectory);
|
7109 | }
|
7110 | exports2.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
|
7111 | function isPatternRelatedToParentDirectory(pattern) {
|
7112 | return pattern.startsWith("..") || pattern.startsWith("./..");
|
7113 | }
|
7114 | exports2.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
|
7115 | function getBaseDirectory(pattern) {
|
7116 | return globParent(pattern, {
|
7117 | flipBackslashes: false
|
7118 | });
|
7119 | }
|
7120 | exports2.getBaseDirectory = getBaseDirectory;
|
7121 | function hasGlobStar(pattern) {
|
7122 | return pattern.includes(GLOBSTAR);
|
7123 | }
|
7124 | exports2.hasGlobStar = hasGlobStar;
|
7125 | function endsWithSlashGlobStar(pattern) {
|
7126 | return pattern.endsWith("/" + GLOBSTAR);
|
7127 | }
|
7128 | exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
7129 | function isAffectDepthOfReadingPattern(pattern) {
|
7130 | const basename = path.basename(pattern);
|
7131 | return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
7132 | }
|
7133 | exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
7134 | function expandPatternsWithBraceExpansion(patterns) {
|
7135 | return patterns.reduce((collection, pattern) => {
|
7136 | return collection.concat(expandBraceExpansion(pattern));
|
7137 | }, []);
|
7138 | }
|
7139 | exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
7140 | function expandBraceExpansion(pattern) {
|
7141 | return micromatch.braces(pattern, {
|
7142 | expand: true,
|
7143 | nodupes: true
|
7144 | });
|
7145 | }
|
7146 | exports2.expandBraceExpansion = expandBraceExpansion;
|
7147 | function getPatternParts(pattern, options) {
|
7148 | let {
|
7149 | parts
|
7150 | } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), {
|
7151 | parts: true
|
7152 | }));
|
7153 | if (parts.length === 0) {
|
7154 | parts = [pattern];
|
7155 | }
|
7156 | if (parts[0].startsWith("/")) {
|
7157 | parts[0] = parts[0].slice(1);
|
7158 | parts.unshift("");
|
7159 | }
|
7160 | return parts;
|
7161 | }
|
7162 | exports2.getPatternParts = getPatternParts;
|
7163 | function makeRe(pattern, options) {
|
7164 | return micromatch.makeRe(pattern, options);
|
7165 | }
|
7166 | exports2.makeRe = makeRe;
|
7167 | function convertPatternsToRe(patterns, options) {
|
7168 | return patterns.map((pattern) => makeRe(pattern, options));
|
7169 | }
|
7170 | exports2.convertPatternsToRe = convertPatternsToRe;
|
7171 | function matchAny(entry, patternsRe) {
|
7172 | return patternsRe.some((patternRe) => patternRe.test(entry));
|
7173 | }
|
7174 | exports2.matchAny = matchAny;
|
7175 | }
|
7176 | });
|
7177 | var require_merge2 = __commonJS2({
|
7178 | "node_modules/merge2/index.js"(exports2, module2) {
|
7179 | "use strict";
|
7180 | var Stream = require("stream");
|
7181 | var PassThrough = Stream.PassThrough;
|
7182 | var slice = Array.prototype.slice;
|
7183 | module2.exports = merge2;
|
7184 | function merge2() {
|
7185 | const streamsQueue = [];
|
7186 | const args = slice.call(arguments);
|
7187 | let merging = false;
|
7188 | let options = args[args.length - 1];
|
7189 | if (options && !Array.isArray(options) && options.pipe == null) {
|
7190 | args.pop();
|
7191 | } else {
|
7192 | options = {};
|
7193 | }
|
7194 | const doEnd = options.end !== false;
|
7195 | const doPipeError = options.pipeError === true;
|
7196 | if (options.objectMode == null) {
|
7197 | options.objectMode = true;
|
7198 | }
|
7199 | if (options.highWaterMark == null) {
|
7200 | options.highWaterMark = 64 * 1024;
|
7201 | }
|
7202 | const mergedStream = PassThrough(options);
|
7203 | function addStream() {
|
7204 | for (let i = 0, len = arguments.length; i < len; i++) {
|
7205 | streamsQueue.push(pauseStreams(arguments[i], options));
|
7206 | }
|
7207 | mergeStream();
|
7208 | return this;
|
7209 | }
|
7210 | function mergeStream() {
|
7211 | if (merging) {
|
7212 | return;
|
7213 | }
|
7214 | merging = true;
|
7215 | let streams = streamsQueue.shift();
|
7216 | if (!streams) {
|
7217 | process.nextTick(endStream);
|
7218 | return;
|
7219 | }
|
7220 | if (!Array.isArray(streams)) {
|
7221 | streams = [streams];
|
7222 | }
|
7223 | let pipesCount = streams.length + 1;
|
7224 | function next() {
|
7225 | if (--pipesCount > 0) {
|
7226 | return;
|
7227 | }
|
7228 | merging = false;
|
7229 | mergeStream();
|
7230 | }
|
7231 | function pipe(stream) {
|
7232 | function onend() {
|
7233 | stream.removeListener("merge2UnpipeEnd", onend);
|
7234 | stream.removeListener("end", onend);
|
7235 | if (doPipeError) {
|
7236 | stream.removeListener("error", onerror);
|
7237 | }
|
7238 | next();
|
7239 | }
|
7240 | function onerror(err) {
|
7241 | mergedStream.emit("error", err);
|
7242 | }
|
7243 | if (stream._readableState.endEmitted) {
|
7244 | return next();
|
7245 | }
|
7246 | stream.on("merge2UnpipeEnd", onend);
|
7247 | stream.on("end", onend);
|
7248 | if (doPipeError) {
|
7249 | stream.on("error", onerror);
|
7250 | }
|
7251 | stream.pipe(mergedStream, {
|
7252 | end: false
|
7253 | });
|
7254 | stream.resume();
|
7255 | }
|
7256 | for (let i = 0; i < streams.length; i++) {
|
7257 | pipe(streams[i]);
|
7258 | }
|
7259 | next();
|
7260 | }
|
7261 | function endStream() {
|
7262 | merging = false;
|
7263 | mergedStream.emit("queueDrain");
|
7264 | if (doEnd) {
|
7265 | mergedStream.end();
|
7266 | }
|
7267 | }
|
7268 | mergedStream.setMaxListeners(0);
|
7269 | mergedStream.add = addStream;
|
7270 | mergedStream.on("unpipe", function(stream) {
|
7271 | stream.emit("merge2UnpipeEnd");
|
7272 | });
|
7273 | if (args.length) {
|
7274 | addStream.apply(null, args);
|
7275 | }
|
7276 | return mergedStream;
|
7277 | }
|
7278 | function pauseStreams(streams, options) {
|
7279 | if (!Array.isArray(streams)) {
|
7280 | if (!streams._readableState && streams.pipe) {
|
7281 | streams = streams.pipe(PassThrough(options));
|
7282 | }
|
7283 | if (!streams._readableState || !streams.pause || !streams.pipe) {
|
7284 | throw new Error("Only readable stream can be merged.");
|
7285 | }
|
7286 | streams.pause();
|
7287 | } else {
|
7288 | for (let i = 0, len = streams.length; i < len; i++) {
|
7289 | streams[i] = pauseStreams(streams[i], options);
|
7290 | }
|
7291 | }
|
7292 | return streams;
|
7293 | }
|
7294 | }
|
7295 | });
|
7296 | var require_stream = __commonJS2({
|
7297 | "node_modules/fast-glob/out/utils/stream.js"(exports2) {
|
7298 | "use strict";
|
7299 | Object.defineProperty(exports2, "__esModule", {
|
7300 | value: true
|
7301 | });
|
7302 | exports2.merge = void 0;
|
7303 | var merge2 = require_merge2();
|
7304 | function merge(streams) {
|
7305 | const mergedStream = merge2(streams);
|
7306 | streams.forEach((stream) => {
|
7307 | stream.once("error", (error) => mergedStream.emit("error", error));
|
7308 | });
|
7309 | mergedStream.once("close", () => propagateCloseEventToSources(streams));
|
7310 | mergedStream.once("end", () => propagateCloseEventToSources(streams));
|
7311 | return mergedStream;
|
7312 | }
|
7313 | exports2.merge = merge;
|
7314 | function propagateCloseEventToSources(streams) {
|
7315 | streams.forEach((stream) => stream.emit("close"));
|
7316 | }
|
7317 | }
|
7318 | });
|
7319 | var require_string = __commonJS2({
|
7320 | "node_modules/fast-glob/out/utils/string.js"(exports2) {
|
7321 | "use strict";
|
7322 | Object.defineProperty(exports2, "__esModule", {
|
7323 | value: true
|
7324 | });
|
7325 | exports2.isEmpty = exports2.isString = void 0;
|
7326 | function isString(input) {
|
7327 | return typeof input === "string";
|
7328 | }
|
7329 | exports2.isString = isString;
|
7330 | function isEmpty(input) {
|
7331 | return input === "";
|
7332 | }
|
7333 | exports2.isEmpty = isEmpty;
|
7334 | }
|
7335 | });
|
7336 | var require_utils4 = __commonJS2({
|
7337 | "node_modules/fast-glob/out/utils/index.js"(exports2) {
|
7338 | "use strict";
|
7339 | Object.defineProperty(exports2, "__esModule", {
|
7340 | value: true
|
7341 | });
|
7342 | exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
|
7343 | var array2 = require_array();
|
7344 | exports2.array = array2;
|
7345 | var errno = require_errno();
|
7346 | exports2.errno = errno;
|
7347 | var fs = require_fs();
|
7348 | exports2.fs = fs;
|
7349 | var path = require_path();
|
7350 | exports2.path = path;
|
7351 | var pattern = require_pattern();
|
7352 | exports2.pattern = pattern;
|
7353 | var stream = require_stream();
|
7354 | exports2.stream = stream;
|
7355 | var string = require_string();
|
7356 | exports2.string = string;
|
7357 | }
|
7358 | });
|
7359 | var require_tasks = __commonJS2({
|
7360 | "node_modules/fast-glob/out/managers/tasks.js"(exports2) {
|
7361 | "use strict";
|
7362 | Object.defineProperty(exports2, "__esModule", {
|
7363 | value: true
|
7364 | });
|
7365 | exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
|
7366 | var utils = require_utils4();
|
7367 | function generate(patterns, settings) {
|
7368 | const positivePatterns = getPositivePatterns(patterns);
|
7369 | const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
7370 | const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
|
7371 | const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
|
7372 | const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
|
7373 | const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
|
7374 | return staticTasks.concat(dynamicTasks);
|
7375 | }
|
7376 | exports2.generate = generate;
|
7377 | function convertPatternsToTasks(positive, negative, dynamic) {
|
7378 | const tasks = [];
|
7379 | const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
|
7380 | const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
|
7381 | const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
|
7382 | const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
|
7383 | tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
|
7384 | if ("." in insideCurrentDirectoryGroup) {
|
7385 | tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
|
7386 | } else {
|
7387 | tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
|
7388 | }
|
7389 | return tasks;
|
7390 | }
|
7391 | exports2.convertPatternsToTasks = convertPatternsToTasks;
|
7392 | function getPositivePatterns(patterns) {
|
7393 | return utils.pattern.getPositivePatterns(patterns);
|
7394 | }
|
7395 | exports2.getPositivePatterns = getPositivePatterns;
|
7396 | function getNegativePatternsAsPositive(patterns, ignore) {
|
7397 | const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
|
7398 | const positive = negative.map(utils.pattern.convertToPositivePattern);
|
7399 | return positive;
|
7400 | }
|
7401 | exports2.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
7402 | function groupPatternsByBaseDirectory(patterns) {
|
7403 | const group = {};
|
7404 | return patterns.reduce((collection, pattern) => {
|
7405 | const base = utils.pattern.getBaseDirectory(pattern);
|
7406 | if (base in collection) {
|
7407 | collection[base].push(pattern);
|
7408 | } else {
|
7409 | collection[base] = [pattern];
|
7410 | }
|
7411 | return collection;
|
7412 | }, group);
|
7413 | }
|
7414 | exports2.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
7415 | function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
7416 | return Object.keys(positive).map((base) => {
|
7417 | return convertPatternGroupToTask(base, positive[base], negative, dynamic);
|
7418 | });
|
7419 | }
|
7420 | exports2.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
7421 | function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
7422 | return {
|
7423 | dynamic,
|
7424 | positive,
|
7425 | negative,
|
7426 | base,
|
7427 | patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
|
7428 | };
|
7429 | }
|
7430 | exports2.convertPatternGroupToTask = convertPatternGroupToTask;
|
7431 | }
|
7432 | });
|
7433 | var require_patterns = __commonJS2({
|
7434 | "node_modules/fast-glob/out/managers/patterns.js"(exports2) {
|
7435 | "use strict";
|
7436 | Object.defineProperty(exports2, "__esModule", {
|
7437 | value: true
|
7438 | });
|
7439 | exports2.removeDuplicateSlashes = exports2.transform = void 0;
|
7440 | var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
|
7441 | function transform(patterns) {
|
7442 | return patterns.map((pattern) => removeDuplicateSlashes(pattern));
|
7443 | }
|
7444 | exports2.transform = transform;
|
7445 | function removeDuplicateSlashes(pattern) {
|
7446 | return pattern.replace(DOUBLE_SLASH_RE, "/");
|
7447 | }
|
7448 | exports2.removeDuplicateSlashes = removeDuplicateSlashes;
|
7449 | }
|
7450 | });
|
7451 | var require_async = __commonJS2({
|
7452 | "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports2) {
|
7453 | "use strict";
|
7454 | Object.defineProperty(exports2, "__esModule", {
|
7455 | value: true
|
7456 | });
|
7457 | exports2.read = void 0;
|
7458 | function read(path, settings, callback) {
|
7459 | settings.fs.lstat(path, (lstatError, lstat) => {
|
7460 | if (lstatError !== null) {
|
7461 | callFailureCallback(callback, lstatError);
|
7462 | return;
|
7463 | }
|
7464 | if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
7465 | callSuccessCallback(callback, lstat);
|
7466 | return;
|
7467 | }
|
7468 | settings.fs.stat(path, (statError, stat) => {
|
7469 | if (statError !== null) {
|
7470 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
7471 | callFailureCallback(callback, statError);
|
7472 | return;
|
7473 | }
|
7474 | callSuccessCallback(callback, lstat);
|
7475 | return;
|
7476 | }
|
7477 | if (settings.markSymbolicLink) {
|
7478 | stat.isSymbolicLink = () => true;
|
7479 | }
|
7480 | callSuccessCallback(callback, stat);
|
7481 | });
|
7482 | });
|
7483 | }
|
7484 | exports2.read = read;
|
7485 | function callFailureCallback(callback, error) {
|
7486 | callback(error);
|
7487 | }
|
7488 | function callSuccessCallback(callback, result) {
|
7489 | callback(null, result);
|
7490 | }
|
7491 | }
|
7492 | });
|
7493 | var require_sync = __commonJS2({
|
7494 | "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports2) {
|
7495 | "use strict";
|
7496 | Object.defineProperty(exports2, "__esModule", {
|
7497 | value: true
|
7498 | });
|
7499 | exports2.read = void 0;
|
7500 | function read(path, settings) {
|
7501 | const lstat = settings.fs.lstatSync(path);
|
7502 | if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
7503 | return lstat;
|
7504 | }
|
7505 | try {
|
7506 | const stat = settings.fs.statSync(path);
|
7507 | if (settings.markSymbolicLink) {
|
7508 | stat.isSymbolicLink = () => true;
|
7509 | }
|
7510 | return stat;
|
7511 | } catch (error) {
|
7512 | if (!settings.throwErrorOnBrokenSymbolicLink) {
|
7513 | return lstat;
|
7514 | }
|
7515 | throw error;
|
7516 | }
|
7517 | }
|
7518 | exports2.read = read;
|
7519 | }
|
7520 | });
|
7521 | var require_fs2 = __commonJS2({
|
7522 | "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports2) {
|
7523 | "use strict";
|
7524 | Object.defineProperty(exports2, "__esModule", {
|
7525 | value: true
|
7526 | });
|
7527 | exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
7528 | var fs = require("fs");
|
7529 | exports2.FILE_SYSTEM_ADAPTER = {
|
7530 | lstat: fs.lstat,
|
7531 | stat: fs.stat,
|
7532 | lstatSync: fs.lstatSync,
|
7533 | statSync: fs.statSync
|
7534 | };
|
7535 | function createFileSystemAdapter(fsMethods) {
|
7536 | if (fsMethods === void 0) {
|
7537 | return exports2.FILE_SYSTEM_ADAPTER;
|
7538 | }
|
7539 | return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
|
7540 | }
|
7541 | exports2.createFileSystemAdapter = createFileSystemAdapter;
|
7542 | }
|
7543 | });
|
7544 | var require_settings = __commonJS2({
|
7545 | "node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
|
7546 | "use strict";
|
7547 | Object.defineProperty(exports2, "__esModule", {
|
7548 | value: true
|
7549 | });
|
7550 | var fs = require_fs2();
|
7551 | var Settings = class {
|
7552 | constructor(_options = {}) {
|
7553 | this._options = _options;
|
7554 | this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
7555 | this.fs = fs.createFileSystemAdapter(this._options.fs);
|
7556 | this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
7557 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
7558 | }
|
7559 | _getValue(option, value) {
|
7560 | return option !== null && option !== void 0 ? option : value;
|
7561 | }
|
7562 | };
|
7563 | exports2.default = Settings;
|
7564 | }
|
7565 | });
|
7566 | var require_out = __commonJS2({
|
7567 | "node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
|
7568 | "use strict";
|
7569 | Object.defineProperty(exports2, "__esModule", {
|
7570 | value: true
|
7571 | });
|
7572 | exports2.statSync = exports2.stat = exports2.Settings = void 0;
|
7573 | var async = require_async();
|
7574 | var sync = require_sync();
|
7575 | var settings_1 = require_settings();
|
7576 | exports2.Settings = settings_1.default;
|
7577 | function stat(path, optionsOrSettingsOrCallback, callback) {
|
7578 | if (typeof optionsOrSettingsOrCallback === "function") {
|
7579 | async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
7580 | return;
|
7581 | }
|
7582 | async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
7583 | }
|
7584 | exports2.stat = stat;
|
7585 | function statSync(path, optionsOrSettings) {
|
7586 | const settings = getSettings(optionsOrSettings);
|
7587 | return sync.read(path, settings);
|
7588 | }
|
7589 | exports2.statSync = statSync;
|
7590 | function getSettings(settingsOrOptions = {}) {
|
7591 | if (settingsOrOptions instanceof settings_1.default) {
|
7592 | return settingsOrOptions;
|
7593 | }
|
7594 | return new settings_1.default(settingsOrOptions);
|
7595 | }
|
7596 | }
|
7597 | });
|
7598 | var require_queue_microtask = __commonJS2({
|
7599 | "node_modules/queue-microtask/index.js"(exports2, module2) {
|
7600 | var promise;
|
7601 | module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
|
7602 | throw err;
|
7603 | }, 0));
|
7604 | }
|
7605 | });
|
7606 | var require_run_parallel = __commonJS2({
|
7607 | "node_modules/run-parallel/index.js"(exports2, module2) {
|
7608 | module2.exports = runParallel;
|
7609 | var queueMicrotask2 = require_queue_microtask();
|
7610 | function runParallel(tasks, cb) {
|
7611 | let results, pending, keys;
|
7612 | let isSync = true;
|
7613 | if (Array.isArray(tasks)) {
|
7614 | results = [];
|
7615 | pending = tasks.length;
|
7616 | } else {
|
7617 | keys = Object.keys(tasks);
|
7618 | results = {};
|
7619 | pending = keys.length;
|
7620 | }
|
7621 | function done(err) {
|
7622 | function end() {
|
7623 | if (cb)
|
7624 | cb(err, results);
|
7625 | cb = null;
|
7626 | }
|
7627 | if (isSync)
|
7628 | queueMicrotask2(end);
|
7629 | else
|
7630 | end();
|
7631 | }
|
7632 | function each(i, err, result) {
|
7633 | results[i] = result;
|
7634 | if (--pending === 0 || err) {
|
7635 | done(err);
|
7636 | }
|
7637 | }
|
7638 | if (!pending) {
|
7639 | done(null);
|
7640 | } else if (keys) {
|
7641 | keys.forEach(function(key) {
|
7642 | tasks[key](function(err, result) {
|
7643 | each(key, err, result);
|
7644 | });
|
7645 | });
|
7646 | } else {
|
7647 | tasks.forEach(function(task, i) {
|
7648 | task(function(err, result) {
|
7649 | each(i, err, result);
|
7650 | });
|
7651 | });
|
7652 | }
|
7653 | isSync = false;
|
7654 | }
|
7655 | }
|
7656 | });
|
7657 | var require_constants3 = __commonJS2({
|
7658 | "node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
|
7659 | "use strict";
|
7660 | Object.defineProperty(exports2, "__esModule", {
|
7661 | value: true
|
7662 | });
|
7663 | exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
|
7664 | var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
|
7665 | if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
|
7666 | throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
|
7667 | }
|
7668 | var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
|
7669 | var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
|
7670 | var SUPPORTED_MAJOR_VERSION = 10;
|
7671 | var SUPPORTED_MINOR_VERSION = 10;
|
7672 | var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
|
7673 | var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
|
7674 | exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
|
7675 | }
|
7676 | });
|
7677 | var require_fs3 = __commonJS2({
|
7678 | "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports2) {
|
7679 | "use strict";
|
7680 | Object.defineProperty(exports2, "__esModule", {
|
7681 | value: true
|
7682 | });
|
7683 | exports2.createDirentFromStats = void 0;
|
7684 | var DirentFromStats = class {
|
7685 | constructor(name, stats) {
|
7686 | this.name = name;
|
7687 | this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
7688 | this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
7689 | this.isDirectory = stats.isDirectory.bind(stats);
|
7690 | this.isFIFO = stats.isFIFO.bind(stats);
|
7691 | this.isFile = stats.isFile.bind(stats);
|
7692 | this.isSocket = stats.isSocket.bind(stats);
|
7693 | this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
7694 | }
|
7695 | };
|
7696 | function createDirentFromStats(name, stats) {
|
7697 | return new DirentFromStats(name, stats);
|
7698 | }
|
7699 | exports2.createDirentFromStats = createDirentFromStats;
|
7700 | }
|
7701 | });
|
7702 | var require_utils5 = __commonJS2({
|
7703 | "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports2) {
|
7704 | "use strict";
|
7705 | Object.defineProperty(exports2, "__esModule", {
|
7706 | value: true
|
7707 | });
|
7708 | exports2.fs = void 0;
|
7709 | var fs = require_fs3();
|
7710 | exports2.fs = fs;
|
7711 | }
|
7712 | });
|
7713 | var require_common = __commonJS2({
|
7714 | "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports2) {
|
7715 | "use strict";
|
7716 | Object.defineProperty(exports2, "__esModule", {
|
7717 | value: true
|
7718 | });
|
7719 | exports2.joinPathSegments = void 0;
|
7720 | function joinPathSegments(a, b, separator) {
|
7721 | if (a.endsWith(separator)) {
|
7722 | return a + b;
|
7723 | }
|
7724 | return a + separator + b;
|
7725 | }
|
7726 | exports2.joinPathSegments = joinPathSegments;
|
7727 | }
|
7728 | });
|
7729 | var require_async2 = __commonJS2({
|
7730 | "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
|
7731 | "use strict";
|
7732 | Object.defineProperty(exports2, "__esModule", {
|
7733 | value: true
|
7734 | });
|
7735 | exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
|
7736 | var fsStat = require_out();
|
7737 | var rpl = require_run_parallel();
|
7738 | var constants_1 = require_constants3();
|
7739 | var utils = require_utils5();
|
7740 | var common = require_common();
|
7741 | function read(directory, settings, callback) {
|
7742 | if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
7743 | readdirWithFileTypes(directory, settings, callback);
|
7744 | return;
|
7745 | }
|
7746 | readdir(directory, settings, callback);
|
7747 | }
|
7748 | exports2.read = read;
|
7749 | function readdirWithFileTypes(directory, settings, callback) {
|
7750 | settings.fs.readdir(directory, {
|
7751 | withFileTypes: true
|
7752 | }, (readdirError, dirents) => {
|
7753 | if (readdirError !== null) {
|
7754 | callFailureCallback(callback, readdirError);
|
7755 | return;
|
7756 | }
|
7757 | const entries = dirents.map((dirent) => ({
|
7758 | dirent,
|
7759 | name: dirent.name,
|
7760 | path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
7761 | }));
|
7762 | if (!settings.followSymbolicLinks) {
|
7763 | callSuccessCallback(callback, entries);
|
7764 | return;
|
7765 | }
|
7766 | const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
|
7767 | rpl(tasks, (rplError, rplEntries) => {
|
7768 | if (rplError !== null) {
|
7769 | callFailureCallback(callback, rplError);
|
7770 | return;
|
7771 | }
|
7772 | callSuccessCallback(callback, rplEntries);
|
7773 | });
|
7774 | });
|
7775 | }
|
7776 | exports2.readdirWithFileTypes = readdirWithFileTypes;
|
7777 | function makeRplTaskEntry(entry, settings) {
|
7778 | return (done) => {
|
7779 | if (!entry.dirent.isSymbolicLink()) {
|
7780 | done(null, entry);
|
7781 | return;
|
7782 | }
|
7783 | settings.fs.stat(entry.path, (statError, stats) => {
|
7784 | if (statError !== null) {
|
7785 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
7786 | done(statError);
|
7787 | return;
|
7788 | }
|
7789 | done(null, entry);
|
7790 | return;
|
7791 | }
|
7792 | entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
7793 | done(null, entry);
|
7794 | });
|
7795 | };
|
7796 | }
|
7797 | function readdir(directory, settings, callback) {
|
7798 | settings.fs.readdir(directory, (readdirError, names) => {
|
7799 | if (readdirError !== null) {
|
7800 | callFailureCallback(callback, readdirError);
|
7801 | return;
|
7802 | }
|
7803 | const tasks = names.map((name) => {
|
7804 | const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
7805 | return (done) => {
|
7806 | fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
|
7807 | if (error !== null) {
|
7808 | done(error);
|
7809 | return;
|
7810 | }
|
7811 | const entry = {
|
7812 | name,
|
7813 | path,
|
7814 | dirent: utils.fs.createDirentFromStats(name, stats)
|
7815 | };
|
7816 | if (settings.stats) {
|
7817 | entry.stats = stats;
|
7818 | }
|
7819 | done(null, entry);
|
7820 | });
|
7821 | };
|
7822 | });
|
7823 | rpl(tasks, (rplError, entries) => {
|
7824 | if (rplError !== null) {
|
7825 | callFailureCallback(callback, rplError);
|
7826 | return;
|
7827 | }
|
7828 | callSuccessCallback(callback, entries);
|
7829 | });
|
7830 | });
|
7831 | }
|
7832 | exports2.readdir = readdir;
|
7833 | function callFailureCallback(callback, error) {
|
7834 | callback(error);
|
7835 | }
|
7836 | function callSuccessCallback(callback, result) {
|
7837 | callback(null, result);
|
7838 | }
|
7839 | }
|
7840 | });
|
7841 | var require_sync2 = __commonJS2({
|
7842 | "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
|
7843 | "use strict";
|
7844 | Object.defineProperty(exports2, "__esModule", {
|
7845 | value: true
|
7846 | });
|
7847 | exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
|
7848 | var fsStat = require_out();
|
7849 | var constants_1 = require_constants3();
|
7850 | var utils = require_utils5();
|
7851 | var common = require_common();
|
7852 | function read(directory, settings) {
|
7853 | if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
7854 | return readdirWithFileTypes(directory, settings);
|
7855 | }
|
7856 | return readdir(directory, settings);
|
7857 | }
|
7858 | exports2.read = read;
|
7859 | function readdirWithFileTypes(directory, settings) {
|
7860 | const dirents = settings.fs.readdirSync(directory, {
|
7861 | withFileTypes: true
|
7862 | });
|
7863 | return dirents.map((dirent) => {
|
7864 | const entry = {
|
7865 | dirent,
|
7866 | name: dirent.name,
|
7867 | path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
7868 | };
|
7869 | if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
|
7870 | try {
|
7871 | const stats = settings.fs.statSync(entry.path);
|
7872 | entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
7873 | } catch (error) {
|
7874 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
7875 | throw error;
|
7876 | }
|
7877 | }
|
7878 | }
|
7879 | return entry;
|
7880 | });
|
7881 | }
|
7882 | exports2.readdirWithFileTypes = readdirWithFileTypes;
|
7883 | function readdir(directory, settings) {
|
7884 | const names = settings.fs.readdirSync(directory);
|
7885 | return names.map((name) => {
|
7886 | const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
7887 | const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
|
7888 | const entry = {
|
7889 | name,
|
7890 | path: entryPath,
|
7891 | dirent: utils.fs.createDirentFromStats(name, stats)
|
7892 | };
|
7893 | if (settings.stats) {
|
7894 | entry.stats = stats;
|
7895 | }
|
7896 | return entry;
|
7897 | });
|
7898 | }
|
7899 | exports2.readdir = readdir;
|
7900 | }
|
7901 | });
|
7902 | var require_fs4 = __commonJS2({
|
7903 | "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports2) {
|
7904 | "use strict";
|
7905 | Object.defineProperty(exports2, "__esModule", {
|
7906 | value: true
|
7907 | });
|
7908 | exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
7909 | var fs = require("fs");
|
7910 | exports2.FILE_SYSTEM_ADAPTER = {
|
7911 | lstat: fs.lstat,
|
7912 | stat: fs.stat,
|
7913 | lstatSync: fs.lstatSync,
|
7914 | statSync: fs.statSync,
|
7915 | readdir: fs.readdir,
|
7916 | readdirSync: fs.readdirSync
|
7917 | };
|
7918 | function createFileSystemAdapter(fsMethods) {
|
7919 | if (fsMethods === void 0) {
|
7920 | return exports2.FILE_SYSTEM_ADAPTER;
|
7921 | }
|
7922 | return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
|
7923 | }
|
7924 | exports2.createFileSystemAdapter = createFileSystemAdapter;
|
7925 | }
|
7926 | });
|
7927 | var require_settings2 = __commonJS2({
|
7928 | "node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
|
7929 | "use strict";
|
7930 | Object.defineProperty(exports2, "__esModule", {
|
7931 | value: true
|
7932 | });
|
7933 | var path = require("path");
|
7934 | var fsStat = require_out();
|
7935 | var fs = require_fs4();
|
7936 | var Settings = class {
|
7937 | constructor(_options = {}) {
|
7938 | this._options = _options;
|
7939 | this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
7940 | this.fs = fs.createFileSystemAdapter(this._options.fs);
|
7941 | this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
7942 | this.stats = this._getValue(this._options.stats, false);
|
7943 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
7944 | this.fsStatSettings = new fsStat.Settings({
|
7945 | followSymbolicLink: this.followSymbolicLinks,
|
7946 | fs: this.fs,
|
7947 | throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
|
7948 | });
|
7949 | }
|
7950 | _getValue(option, value) {
|
7951 | return option !== null && option !== void 0 ? option : value;
|
7952 | }
|
7953 | };
|
7954 | exports2.default = Settings;
|
7955 | }
|
7956 | });
|
7957 | var require_out2 = __commonJS2({
|
7958 | "node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
|
7959 | "use strict";
|
7960 | Object.defineProperty(exports2, "__esModule", {
|
7961 | value: true
|
7962 | });
|
7963 | exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
|
7964 | var async = require_async2();
|
7965 | var sync = require_sync2();
|
7966 | var settings_1 = require_settings2();
|
7967 | exports2.Settings = settings_1.default;
|
7968 | function scandir(path, optionsOrSettingsOrCallback, callback) {
|
7969 | if (typeof optionsOrSettingsOrCallback === "function") {
|
7970 | async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
7971 | return;
|
7972 | }
|
7973 | async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
7974 | }
|
7975 | exports2.scandir = scandir;
|
7976 | function scandirSync(path, optionsOrSettings) {
|
7977 | const settings = getSettings(optionsOrSettings);
|
7978 | return sync.read(path, settings);
|
7979 | }
|
7980 | exports2.scandirSync = scandirSync;
|
7981 | function getSettings(settingsOrOptions = {}) {
|
7982 | if (settingsOrOptions instanceof settings_1.default) {
|
7983 | return settingsOrOptions;
|
7984 | }
|
7985 | return new settings_1.default(settingsOrOptions);
|
7986 | }
|
7987 | }
|
7988 | });
|
7989 | var require_reusify = __commonJS2({
|
7990 | "node_modules/reusify/reusify.js"(exports2, module2) {
|
7991 | "use strict";
|
7992 | function reusify(Constructor) {
|
7993 | var head = new Constructor();
|
7994 | var tail = head;
|
7995 | function get() {
|
7996 | var current = head;
|
7997 | if (current.next) {
|
7998 | head = current.next;
|
7999 | } else {
|
8000 | head = new Constructor();
|
8001 | tail = head;
|
8002 | }
|
8003 | current.next = null;
|
8004 | return current;
|
8005 | }
|
8006 | function release(obj) {
|
8007 | tail.next = obj;
|
8008 | tail = obj;
|
8009 | }
|
8010 | return {
|
8011 | get,
|
8012 | release
|
8013 | };
|
8014 | }
|
8015 | module2.exports = reusify;
|
8016 | }
|
8017 | });
|
8018 | var require_queue = __commonJS2({
|
8019 | "node_modules/fastq/queue.js"(exports2, module2) {
|
8020 | "use strict";
|
8021 | var reusify = require_reusify();
|
8022 | function fastqueue(context, worker, concurrency) {
|
8023 | if (typeof context === "function") {
|
8024 | concurrency = worker;
|
8025 | worker = context;
|
8026 | context = null;
|
8027 | }
|
8028 | if (concurrency < 1) {
|
8029 | throw new Error("fastqueue concurrency must be greater than 1");
|
8030 | }
|
8031 | var cache = reusify(Task);
|
8032 | var queueHead = null;
|
8033 | var queueTail = null;
|
8034 | var _running = 0;
|
8035 | var errorHandler = null;
|
8036 | var self2 = {
|
8037 | push,
|
8038 | drain: noop,
|
8039 | saturated: noop,
|
8040 | pause,
|
8041 | paused: false,
|
8042 | concurrency,
|
8043 | running,
|
8044 | resume,
|
8045 | idle,
|
8046 | length,
|
8047 | getQueue,
|
8048 | unshift,
|
8049 | empty: noop,
|
8050 | kill,
|
8051 | killAndDrain,
|
8052 | error
|
8053 | };
|
8054 | return self2;
|
8055 | function running() {
|
8056 | return _running;
|
8057 | }
|
8058 | function pause() {
|
8059 | self2.paused = true;
|
8060 | }
|
8061 | function length() {
|
8062 | var current = queueHead;
|
8063 | var counter = 0;
|
8064 | while (current) {
|
8065 | current = current.next;
|
8066 | counter++;
|
8067 | }
|
8068 | return counter;
|
8069 | }
|
8070 | function getQueue() {
|
8071 | var current = queueHead;
|
8072 | var tasks = [];
|
8073 | while (current) {
|
8074 | tasks.push(current.value);
|
8075 | current = current.next;
|
8076 | }
|
8077 | return tasks;
|
8078 | }
|
8079 | function resume() {
|
8080 | if (!self2.paused)
|
8081 | return;
|
8082 | self2.paused = false;
|
8083 | for (var i = 0; i < self2.concurrency; i++) {
|
8084 | _running++;
|
8085 | release();
|
8086 | }
|
8087 | }
|
8088 | function idle() {
|
8089 | return _running === 0 && self2.length() === 0;
|
8090 | }
|
8091 | function push(value, done) {
|
8092 | var current = cache.get();
|
8093 | current.context = context;
|
8094 | current.release = release;
|
8095 | current.value = value;
|
8096 | current.callback = done || noop;
|
8097 | current.errorHandler = errorHandler;
|
8098 | if (_running === self2.concurrency || self2.paused) {
|
8099 | if (queueTail) {
|
8100 | queueTail.next = current;
|
8101 | queueTail = current;
|
8102 | } else {
|
8103 | queueHead = current;
|
8104 | queueTail = current;
|
8105 | self2.saturated();
|
8106 | }
|
8107 | } else {
|
8108 | _running++;
|
8109 | worker.call(context, current.value, current.worked);
|
8110 | }
|
8111 | }
|
8112 | function unshift(value, done) {
|
8113 | var current = cache.get();
|
8114 | current.context = context;
|
8115 | current.release = release;
|
8116 | current.value = value;
|
8117 | current.callback = done || noop;
|
8118 | if (_running === self2.concurrency || self2.paused) {
|
8119 | if (queueHead) {
|
8120 | current.next = queueHead;
|
8121 | queueHead = current;
|
8122 | } else {
|
8123 | queueHead = current;
|
8124 | queueTail = current;
|
8125 | self2.saturated();
|
8126 | }
|
8127 | } else {
|
8128 | _running++;
|
8129 | worker.call(context, current.value, current.worked);
|
8130 | }
|
8131 | }
|
8132 | function release(holder) {
|
8133 | if (holder) {
|
8134 | cache.release(holder);
|
8135 | }
|
8136 | var next = queueHead;
|
8137 | if (next) {
|
8138 | if (!self2.paused) {
|
8139 | if (queueTail === queueHead) {
|
8140 | queueTail = null;
|
8141 | }
|
8142 | queueHead = next.next;
|
8143 | next.next = null;
|
8144 | worker.call(context, next.value, next.worked);
|
8145 | if (queueTail === null) {
|
8146 | self2.empty();
|
8147 | }
|
8148 | } else {
|
8149 | _running--;
|
8150 | }
|
8151 | } else if (--_running === 0) {
|
8152 | self2.drain();
|
8153 | }
|
8154 | }
|
8155 | function kill() {
|
8156 | queueHead = null;
|
8157 | queueTail = null;
|
8158 | self2.drain = noop;
|
8159 | }
|
8160 | function killAndDrain() {
|
8161 | queueHead = null;
|
8162 | queueTail = null;
|
8163 | self2.drain();
|
8164 | self2.drain = noop;
|
8165 | }
|
8166 | function error(handler) {
|
8167 | errorHandler = handler;
|
8168 | }
|
8169 | }
|
8170 | function noop() {
|
8171 | }
|
8172 | function Task() {
|
8173 | this.value = null;
|
8174 | this.callback = noop;
|
8175 | this.next = null;
|
8176 | this.release = noop;
|
8177 | this.context = null;
|
8178 | this.errorHandler = null;
|
8179 | var self2 = this;
|
8180 | this.worked = function worked(err, result) {
|
8181 | var callback = self2.callback;
|
8182 | var errorHandler = self2.errorHandler;
|
8183 | var val = self2.value;
|
8184 | self2.value = null;
|
8185 | self2.callback = noop;
|
8186 | if (self2.errorHandler) {
|
8187 | errorHandler(err, val);
|
8188 | }
|
8189 | callback.call(self2.context, err, result);
|
8190 | self2.release(self2);
|
8191 | };
|
8192 | }
|
8193 | function queueAsPromised(context, worker, concurrency) {
|
8194 | if (typeof context === "function") {
|
8195 | concurrency = worker;
|
8196 | worker = context;
|
8197 | context = null;
|
8198 | }
|
8199 | function asyncWrapper(arg, cb) {
|
8200 | worker.call(this, arg).then(function(res) {
|
8201 | cb(null, res);
|
8202 | }, cb);
|
8203 | }
|
8204 | var queue = fastqueue(context, asyncWrapper, concurrency);
|
8205 | var pushCb = queue.push;
|
8206 | var unshiftCb = queue.unshift;
|
8207 | queue.push = push;
|
8208 | queue.unshift = unshift;
|
8209 | queue.drained = drained;
|
8210 | return queue;
|
8211 | function push(value) {
|
8212 | var p = new Promise(function(resolve, reject) {
|
8213 | pushCb(value, function(err, result) {
|
8214 | if (err) {
|
8215 | reject(err);
|
8216 | return;
|
8217 | }
|
8218 | resolve(result);
|
8219 | });
|
8220 | });
|
8221 | p.catch(noop);
|
8222 | return p;
|
8223 | }
|
8224 | function unshift(value) {
|
8225 | var p = new Promise(function(resolve, reject) {
|
8226 | unshiftCb(value, function(err, result) {
|
8227 | if (err) {
|
8228 | reject(err);
|
8229 | return;
|
8230 | }
|
8231 | resolve(result);
|
8232 | });
|
8233 | });
|
8234 | p.catch(noop);
|
8235 | return p;
|
8236 | }
|
8237 | function drained() {
|
8238 | var previousDrain = queue.drain;
|
8239 | var p = new Promise(function(resolve) {
|
8240 | queue.drain = function() {
|
8241 | previousDrain();
|
8242 | resolve();
|
8243 | };
|
8244 | });
|
8245 | return p;
|
8246 | }
|
8247 | }
|
8248 | module2.exports = fastqueue;
|
8249 | module2.exports.promise = queueAsPromised;
|
8250 | }
|
8251 | });
|
8252 | var require_common2 = __commonJS2({
|
8253 | "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
|
8254 | "use strict";
|
8255 | Object.defineProperty(exports2, "__esModule", {
|
8256 | value: true
|
8257 | });
|
8258 | exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
|
8259 | function isFatalError(settings, error) {
|
8260 | if (settings.errorFilter === null) {
|
8261 | return true;
|
8262 | }
|
8263 | return !settings.errorFilter(error);
|
8264 | }
|
8265 | exports2.isFatalError = isFatalError;
|
8266 | function isAppliedFilter(filter, value) {
|
8267 | return filter === null || filter(value);
|
8268 | }
|
8269 | exports2.isAppliedFilter = isAppliedFilter;
|
8270 | function replacePathSegmentSeparator(filepath, separator) {
|
8271 | return filepath.split(/[/\\]/).join(separator);
|
8272 | }
|
8273 | exports2.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
8274 | function joinPathSegments(a, b, separator) {
|
8275 | if (a === "") {
|
8276 | return b;
|
8277 | }
|
8278 | if (a.endsWith(separator)) {
|
8279 | return a + b;
|
8280 | }
|
8281 | return a + separator + b;
|
8282 | }
|
8283 | exports2.joinPathSegments = joinPathSegments;
|
8284 | }
|
8285 | });
|
8286 | var require_reader = __commonJS2({
|
8287 | "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports2) {
|
8288 | "use strict";
|
8289 | Object.defineProperty(exports2, "__esModule", {
|
8290 | value: true
|
8291 | });
|
8292 | var common = require_common2();
|
8293 | var Reader = class {
|
8294 | constructor(_root, _settings) {
|
8295 | this._root = _root;
|
8296 | this._settings = _settings;
|
8297 | this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
|
8298 | }
|
8299 | };
|
8300 | exports2.default = Reader;
|
8301 | }
|
8302 | });
|
8303 | var require_async3 = __commonJS2({
|
8304 | "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports2) {
|
8305 | "use strict";
|
8306 | Object.defineProperty(exports2, "__esModule", {
|
8307 | value: true
|
8308 | });
|
8309 | var events_1 = require("events");
|
8310 | var fsScandir = require_out2();
|
8311 | var fastq = require_queue();
|
8312 | var common = require_common2();
|
8313 | var reader_1 = require_reader();
|
8314 | var AsyncReader = class extends reader_1.default {
|
8315 | constructor(_root, _settings) {
|
8316 | super(_root, _settings);
|
8317 | this._settings = _settings;
|
8318 | this._scandir = fsScandir.scandir;
|
8319 | this._emitter = new events_1.EventEmitter();
|
8320 | this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
|
8321 | this._isFatalError = false;
|
8322 | this._isDestroyed = false;
|
8323 | this._queue.drain = () => {
|
8324 | if (!this._isFatalError) {
|
8325 | this._emitter.emit("end");
|
8326 | }
|
8327 | };
|
8328 | }
|
8329 | read() {
|
8330 | this._isFatalError = false;
|
8331 | this._isDestroyed = false;
|
8332 | setImmediate(() => {
|
8333 | this._pushToQueue(this._root, this._settings.basePath);
|
8334 | });
|
8335 | return this._emitter;
|
8336 | }
|
8337 | get isDestroyed() {
|
8338 | return this._isDestroyed;
|
8339 | }
|
8340 | destroy() {
|
8341 | if (this._isDestroyed) {
|
8342 | throw new Error("The reader is already destroyed");
|
8343 | }
|
8344 | this._isDestroyed = true;
|
8345 | this._queue.killAndDrain();
|
8346 | }
|
8347 | onEntry(callback) {
|
8348 | this._emitter.on("entry", callback);
|
8349 | }
|
8350 | onError(callback) {
|
8351 | this._emitter.once("error", callback);
|
8352 | }
|
8353 | onEnd(callback) {
|
8354 | this._emitter.once("end", callback);
|
8355 | }
|
8356 | _pushToQueue(directory, base) {
|
8357 | const queueItem = {
|
8358 | directory,
|
8359 | base
|
8360 | };
|
8361 | this._queue.push(queueItem, (error) => {
|
8362 | if (error !== null) {
|
8363 | this._handleError(error);
|
8364 | }
|
8365 | });
|
8366 | }
|
8367 | _worker(item, done) {
|
8368 | this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
|
8369 | if (error !== null) {
|
8370 | done(error, void 0);
|
8371 | return;
|
8372 | }
|
8373 | for (const entry of entries) {
|
8374 | this._handleEntry(entry, item.base);
|
8375 | }
|
8376 | done(null, void 0);
|
8377 | });
|
8378 | }
|
8379 | _handleError(error) {
|
8380 | if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
|
8381 | return;
|
8382 | }
|
8383 | this._isFatalError = true;
|
8384 | this._isDestroyed = true;
|
8385 | this._emitter.emit("error", error);
|
8386 | }
|
8387 | _handleEntry(entry, base) {
|
8388 | if (this._isDestroyed || this._isFatalError) {
|
8389 | return;
|
8390 | }
|
8391 | const fullpath = entry.path;
|
8392 | if (base !== void 0) {
|
8393 | entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
8394 | }
|
8395 | if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
8396 | this._emitEntry(entry);
|
8397 | }
|
8398 | if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
8399 | this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
|
8400 | }
|
8401 | }
|
8402 | _emitEntry(entry) {
|
8403 | this._emitter.emit("entry", entry);
|
8404 | }
|
8405 | };
|
8406 | exports2.default = AsyncReader;
|
8407 | }
|
8408 | });
|
8409 | var require_async4 = __commonJS2({
|
8410 | "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports2) {
|
8411 | "use strict";
|
8412 | Object.defineProperty(exports2, "__esModule", {
|
8413 | value: true
|
8414 | });
|
8415 | var async_1 = require_async3();
|
8416 | var AsyncProvider = class {
|
8417 | constructor(_root, _settings) {
|
8418 | this._root = _root;
|
8419 | this._settings = _settings;
|
8420 | this._reader = new async_1.default(this._root, this._settings);
|
8421 | this._storage = [];
|
8422 | }
|
8423 | read(callback) {
|
8424 | this._reader.onError((error) => {
|
8425 | callFailureCallback(callback, error);
|
8426 | });
|
8427 | this._reader.onEntry((entry) => {
|
8428 | this._storage.push(entry);
|
8429 | });
|
8430 | this._reader.onEnd(() => {
|
8431 | callSuccessCallback(callback, this._storage);
|
8432 | });
|
8433 | this._reader.read();
|
8434 | }
|
8435 | };
|
8436 | exports2.default = AsyncProvider;
|
8437 | function callFailureCallback(callback, error) {
|
8438 | callback(error);
|
8439 | }
|
8440 | function callSuccessCallback(callback, entries) {
|
8441 | callback(null, entries);
|
8442 | }
|
8443 | }
|
8444 | });
|
8445 | var require_stream2 = __commonJS2({
|
8446 | "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports2) {
|
8447 | "use strict";
|
8448 | Object.defineProperty(exports2, "__esModule", {
|
8449 | value: true
|
8450 | });
|
8451 | var stream_1 = require("stream");
|
8452 | var async_1 = require_async3();
|
8453 | var StreamProvider = class {
|
8454 | constructor(_root, _settings) {
|
8455 | this._root = _root;
|
8456 | this._settings = _settings;
|
8457 | this._reader = new async_1.default(this._root, this._settings);
|
8458 | this._stream = new stream_1.Readable({
|
8459 | objectMode: true,
|
8460 | read: () => {
|
8461 | },
|
8462 | destroy: () => {
|
8463 | if (!this._reader.isDestroyed) {
|
8464 | this._reader.destroy();
|
8465 | }
|
8466 | }
|
8467 | });
|
8468 | }
|
8469 | read() {
|
8470 | this._reader.onError((error) => {
|
8471 | this._stream.emit("error", error);
|
8472 | });
|
8473 | this._reader.onEntry((entry) => {
|
8474 | this._stream.push(entry);
|
8475 | });
|
8476 | this._reader.onEnd(() => {
|
8477 | this._stream.push(null);
|
8478 | });
|
8479 | this._reader.read();
|
8480 | return this._stream;
|
8481 | }
|
8482 | };
|
8483 | exports2.default = StreamProvider;
|
8484 | }
|
8485 | });
|
8486 | var require_sync3 = __commonJS2({
|
8487 | "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports2) {
|
8488 | "use strict";
|
8489 | Object.defineProperty(exports2, "__esModule", {
|
8490 | value: true
|
8491 | });
|
8492 | var fsScandir = require_out2();
|
8493 | var common = require_common2();
|
8494 | var reader_1 = require_reader();
|
8495 | var SyncReader = class extends reader_1.default {
|
8496 | constructor() {
|
8497 | super(...arguments);
|
8498 | this._scandir = fsScandir.scandirSync;
|
8499 | this._storage = [];
|
8500 | this._queue = new Set();
|
8501 | }
|
8502 | read() {
|
8503 | this._pushToQueue(this._root, this._settings.basePath);
|
8504 | this._handleQueue();
|
8505 | return this._storage;
|
8506 | }
|
8507 | _pushToQueue(directory, base) {
|
8508 | this._queue.add({
|
8509 | directory,
|
8510 | base
|
8511 | });
|
8512 | }
|
8513 | _handleQueue() {
|
8514 | for (const item of this._queue.values()) {
|
8515 | this._handleDirectory(item.directory, item.base);
|
8516 | }
|
8517 | }
|
8518 | _handleDirectory(directory, base) {
|
8519 | try {
|
8520 | const entries = this._scandir(directory, this._settings.fsScandirSettings);
|
8521 | for (const entry of entries) {
|
8522 | this._handleEntry(entry, base);
|
8523 | }
|
8524 | } catch (error) {
|
8525 | this._handleError(error);
|
8526 | }
|
8527 | }
|
8528 | _handleError(error) {
|
8529 | if (!common.isFatalError(this._settings, error)) {
|
8530 | return;
|
8531 | }
|
8532 | throw error;
|
8533 | }
|
8534 | _handleEntry(entry, base) {
|
8535 | const fullpath = entry.path;
|
8536 | if (base !== void 0) {
|
8537 | entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
8538 | }
|
8539 | if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
8540 | this._pushToStorage(entry);
|
8541 | }
|
8542 | if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
8543 | this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
|
8544 | }
|
8545 | }
|
8546 | _pushToStorage(entry) {
|
8547 | this._storage.push(entry);
|
8548 | }
|
8549 | };
|
8550 | exports2.default = SyncReader;
|
8551 | }
|
8552 | });
|
8553 | var require_sync4 = __commonJS2({
|
8554 | "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports2) {
|
8555 | "use strict";
|
8556 | Object.defineProperty(exports2, "__esModule", {
|
8557 | value: true
|
8558 | });
|
8559 | var sync_1 = require_sync3();
|
8560 | var SyncProvider = class {
|
8561 | constructor(_root, _settings) {
|
8562 | this._root = _root;
|
8563 | this._settings = _settings;
|
8564 | this._reader = new sync_1.default(this._root, this._settings);
|
8565 | }
|
8566 | read() {
|
8567 | return this._reader.read();
|
8568 | }
|
8569 | };
|
8570 | exports2.default = SyncProvider;
|
8571 | }
|
8572 | });
|
8573 | var require_settings3 = __commonJS2({
|
8574 | "node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
|
8575 | "use strict";
|
8576 | Object.defineProperty(exports2, "__esModule", {
|
8577 | value: true
|
8578 | });
|
8579 | var path = require("path");
|
8580 | var fsScandir = require_out2();
|
8581 | var Settings = class {
|
8582 | constructor(_options = {}) {
|
8583 | this._options = _options;
|
8584 | this.basePath = this._getValue(this._options.basePath, void 0);
|
8585 | this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
|
8586 | this.deepFilter = this._getValue(this._options.deepFilter, null);
|
8587 | this.entryFilter = this._getValue(this._options.entryFilter, null);
|
8588 | this.errorFilter = this._getValue(this._options.errorFilter, null);
|
8589 | this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
8590 | this.fsScandirSettings = new fsScandir.Settings({
|
8591 | followSymbolicLinks: this._options.followSymbolicLinks,
|
8592 | fs: this._options.fs,
|
8593 | pathSegmentSeparator: this._options.pathSegmentSeparator,
|
8594 | stats: this._options.stats,
|
8595 | throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
|
8596 | });
|
8597 | }
|
8598 | _getValue(option, value) {
|
8599 | return option !== null && option !== void 0 ? option : value;
|
8600 | }
|
8601 | };
|
8602 | exports2.default = Settings;
|
8603 | }
|
8604 | });
|
8605 | var require_out3 = __commonJS2({
|
8606 | "node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
|
8607 | "use strict";
|
8608 | Object.defineProperty(exports2, "__esModule", {
|
8609 | value: true
|
8610 | });
|
8611 | exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
|
8612 | var async_1 = require_async4();
|
8613 | var stream_1 = require_stream2();
|
8614 | var sync_1 = require_sync4();
|
8615 | var settings_1 = require_settings3();
|
8616 | exports2.Settings = settings_1.default;
|
8617 | function walk(directory, optionsOrSettingsOrCallback, callback) {
|
8618 | if (typeof optionsOrSettingsOrCallback === "function") {
|
8619 | new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
|
8620 | return;
|
8621 | }
|
8622 | new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
|
8623 | }
|
8624 | exports2.walk = walk;
|
8625 | function walkSync(directory, optionsOrSettings) {
|
8626 | const settings = getSettings(optionsOrSettings);
|
8627 | const provider = new sync_1.default(directory, settings);
|
8628 | return provider.read();
|
8629 | }
|
8630 | exports2.walkSync = walkSync;
|
8631 | function walkStream(directory, optionsOrSettings) {
|
8632 | const settings = getSettings(optionsOrSettings);
|
8633 | const provider = new stream_1.default(directory, settings);
|
8634 | return provider.read();
|
8635 | }
|
8636 | exports2.walkStream = walkStream;
|
8637 | function getSettings(settingsOrOptions = {}) {
|
8638 | if (settingsOrOptions instanceof settings_1.default) {
|
8639 | return settingsOrOptions;
|
8640 | }
|
8641 | return new settings_1.default(settingsOrOptions);
|
8642 | }
|
8643 | }
|
8644 | });
|
8645 | var require_reader2 = __commonJS2({
|
8646 | "node_modules/fast-glob/out/readers/reader.js"(exports2) {
|
8647 | "use strict";
|
8648 | Object.defineProperty(exports2, "__esModule", {
|
8649 | value: true
|
8650 | });
|
8651 | var path = require("path");
|
8652 | var fsStat = require_out();
|
8653 | var utils = require_utils4();
|
8654 | var Reader = class {
|
8655 | constructor(_settings) {
|
8656 | this._settings = _settings;
|
8657 | this._fsStatSettings = new fsStat.Settings({
|
8658 | followSymbolicLink: this._settings.followSymbolicLinks,
|
8659 | fs: this._settings.fs,
|
8660 | throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
8661 | });
|
8662 | }
|
8663 | _getFullEntryPath(filepath) {
|
8664 | return path.resolve(this._settings.cwd, filepath);
|
8665 | }
|
8666 | _makeEntry(stats, pattern) {
|
8667 | const entry = {
|
8668 | name: pattern,
|
8669 | path: pattern,
|
8670 | dirent: utils.fs.createDirentFromStats(pattern, stats)
|
8671 | };
|
8672 | if (this._settings.stats) {
|
8673 | entry.stats = stats;
|
8674 | }
|
8675 | return entry;
|
8676 | }
|
8677 | _isFatalError(error) {
|
8678 | return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
8679 | }
|
8680 | };
|
8681 | exports2.default = Reader;
|
8682 | }
|
8683 | });
|
8684 | var require_stream3 = __commonJS2({
|
8685 | "node_modules/fast-glob/out/readers/stream.js"(exports2) {
|
8686 | "use strict";
|
8687 | Object.defineProperty(exports2, "__esModule", {
|
8688 | value: true
|
8689 | });
|
8690 | var stream_1 = require("stream");
|
8691 | var fsStat = require_out();
|
8692 | var fsWalk = require_out3();
|
8693 | var reader_1 = require_reader2();
|
8694 | var ReaderStream = class extends reader_1.default {
|
8695 | constructor() {
|
8696 | super(...arguments);
|
8697 | this._walkStream = fsWalk.walkStream;
|
8698 | this._stat = fsStat.stat;
|
8699 | }
|
8700 | dynamic(root, options) {
|
8701 | return this._walkStream(root, options);
|
8702 | }
|
8703 | static(patterns, options) {
|
8704 | const filepaths = patterns.map(this._getFullEntryPath, this);
|
8705 | const stream = new stream_1.PassThrough({
|
8706 | objectMode: true
|
8707 | });
|
8708 | stream._write = (index, _enc, done) => {
|
8709 | return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
|
8710 | if (entry !== null && options.entryFilter(entry)) {
|
8711 | stream.push(entry);
|
8712 | }
|
8713 | if (index === filepaths.length - 1) {
|
8714 | stream.end();
|
8715 | }
|
8716 | done();
|
8717 | }).catch(done);
|
8718 | };
|
8719 | for (let i = 0; i < filepaths.length; i++) {
|
8720 | stream.write(i);
|
8721 | }
|
8722 | return stream;
|
8723 | }
|
8724 | _getEntry(filepath, pattern, options) {
|
8725 | return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
|
8726 | if (options.errorFilter(error)) {
|
8727 | return null;
|
8728 | }
|
8729 | throw error;
|
8730 | });
|
8731 | }
|
8732 | _getStat(filepath) {
|
8733 | return new Promise((resolve, reject) => {
|
8734 | this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
8735 | return error === null ? resolve(stats) : reject(error);
|
8736 | });
|
8737 | });
|
8738 | }
|
8739 | };
|
8740 | exports2.default = ReaderStream;
|
8741 | }
|
8742 | });
|
8743 | var require_async5 = __commonJS2({
|
8744 | "node_modules/fast-glob/out/readers/async.js"(exports2) {
|
8745 | "use strict";
|
8746 | Object.defineProperty(exports2, "__esModule", {
|
8747 | value: true
|
8748 | });
|
8749 | var fsWalk = require_out3();
|
8750 | var reader_1 = require_reader2();
|
8751 | var stream_1 = require_stream3();
|
8752 | var ReaderAsync = class extends reader_1.default {
|
8753 | constructor() {
|
8754 | super(...arguments);
|
8755 | this._walkAsync = fsWalk.walk;
|
8756 | this._readerStream = new stream_1.default(this._settings);
|
8757 | }
|
8758 | dynamic(root, options) {
|
8759 | return new Promise((resolve, reject) => {
|
8760 | this._walkAsync(root, options, (error, entries) => {
|
8761 | if (error === null) {
|
8762 | resolve(entries);
|
8763 | } else {
|
8764 | reject(error);
|
8765 | }
|
8766 | });
|
8767 | });
|
8768 | }
|
8769 | async static(patterns, options) {
|
8770 | const entries = [];
|
8771 | const stream = this._readerStream.static(patterns, options);
|
8772 | return new Promise((resolve, reject) => {
|
8773 | stream.once("error", reject);
|
8774 | stream.on("data", (entry) => entries.push(entry));
|
8775 | stream.once("end", () => resolve(entries));
|
8776 | });
|
8777 | }
|
8778 | };
|
8779 | exports2.default = ReaderAsync;
|
8780 | }
|
8781 | });
|
8782 | var require_matcher = __commonJS2({
|
8783 | "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
|
8784 | "use strict";
|
8785 | Object.defineProperty(exports2, "__esModule", {
|
8786 | value: true
|
8787 | });
|
8788 | var utils = require_utils4();
|
8789 | var Matcher = class {
|
8790 | constructor(_patterns, _settings, _micromatchOptions) {
|
8791 | this._patterns = _patterns;
|
8792 | this._settings = _settings;
|
8793 | this._micromatchOptions = _micromatchOptions;
|
8794 | this._storage = [];
|
8795 | this._fillStorage();
|
8796 | }
|
8797 | _fillStorage() {
|
8798 | const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
8799 | for (const pattern of patterns) {
|
8800 | const segments = this._getPatternSegments(pattern);
|
8801 | const sections = this._splitSegmentsIntoSections(segments);
|
8802 | this._storage.push({
|
8803 | complete: sections.length <= 1,
|
8804 | pattern,
|
8805 | segments,
|
8806 | sections
|
8807 | });
|
8808 | }
|
8809 | }
|
8810 | _getPatternSegments(pattern) {
|
8811 | const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
|
8812 | return parts.map((part) => {
|
8813 | const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
|
8814 | if (!dynamic) {
|
8815 | return {
|
8816 | dynamic: false,
|
8817 | pattern: part
|
8818 | };
|
8819 | }
|
8820 | return {
|
8821 | dynamic: true,
|
8822 | pattern: part,
|
8823 | patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
|
8824 | };
|
8825 | });
|
8826 | }
|
8827 | _splitSegmentsIntoSections(segments) {
|
8828 | return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
|
8829 | }
|
8830 | };
|
8831 | exports2.default = Matcher;
|
8832 | }
|
8833 | });
|
8834 | var require_partial = __commonJS2({
|
8835 | "node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
|
8836 | "use strict";
|
8837 | Object.defineProperty(exports2, "__esModule", {
|
8838 | value: true
|
8839 | });
|
8840 | var matcher_1 = require_matcher();
|
8841 | var PartialMatcher = class extends matcher_1.default {
|
8842 | match(filepath) {
|
8843 | const parts = filepath.split("/");
|
8844 | const levels = parts.length;
|
8845 | const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
8846 | for (const pattern of patterns) {
|
8847 | const section = pattern.sections[0];
|
8848 | if (!pattern.complete && levels > section.length) {
|
8849 | return true;
|
8850 | }
|
8851 | const match = parts.every((part, index) => {
|
8852 | const segment = pattern.segments[index];
|
8853 | if (segment.dynamic && segment.patternRe.test(part)) {
|
8854 | return true;
|
8855 | }
|
8856 | if (!segment.dynamic && segment.pattern === part) {
|
8857 | return true;
|
8858 | }
|
8859 | return false;
|
8860 | });
|
8861 | if (match) {
|
8862 | return true;
|
8863 | }
|
8864 | }
|
8865 | return false;
|
8866 | }
|
8867 | };
|
8868 | exports2.default = PartialMatcher;
|
8869 | }
|
8870 | });
|
8871 | var require_deep = __commonJS2({
|
8872 | "node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
|
8873 | "use strict";
|
8874 | Object.defineProperty(exports2, "__esModule", {
|
8875 | value: true
|
8876 | });
|
8877 | var utils = require_utils4();
|
8878 | var partial_1 = require_partial();
|
8879 | var DeepFilter = class {
|
8880 | constructor(_settings, _micromatchOptions) {
|
8881 | this._settings = _settings;
|
8882 | this._micromatchOptions = _micromatchOptions;
|
8883 | }
|
8884 | getFilter(basePath, positive, negative) {
|
8885 | const matcher = this._getMatcher(positive);
|
8886 | const negativeRe = this._getNegativePatternsRe(negative);
|
8887 | return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
8888 | }
|
8889 | _getMatcher(patterns) {
|
8890 | return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
8891 | }
|
8892 | _getNegativePatternsRe(patterns) {
|
8893 | const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
|
8894 | return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
8895 | }
|
8896 | _filter(basePath, entry, matcher, negativeRe) {
|
8897 | if (this._isSkippedByDeep(basePath, entry.path)) {
|
8898 | return false;
|
8899 | }
|
8900 | if (this._isSkippedSymbolicLink(entry)) {
|
8901 | return false;
|
8902 | }
|
8903 | const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
8904 | if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
8905 | return false;
|
8906 | }
|
8907 | return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
8908 | }
|
8909 | _isSkippedByDeep(basePath, entryPath) {
|
8910 | if (this._settings.deep === Infinity) {
|
8911 | return false;
|
8912 | }
|
8913 | return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
8914 | }
|
8915 | _getEntryLevel(basePath, entryPath) {
|
8916 | const entryPathDepth = entryPath.split("/").length;
|
8917 | if (basePath === "") {
|
8918 | return entryPathDepth;
|
8919 | }
|
8920 | const basePathDepth = basePath.split("/").length;
|
8921 | return entryPathDepth - basePathDepth;
|
8922 | }
|
8923 | _isSkippedSymbolicLink(entry) {
|
8924 | return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
8925 | }
|
8926 | _isSkippedByPositivePatterns(entryPath, matcher) {
|
8927 | return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
8928 | }
|
8929 | _isSkippedByNegativePatterns(entryPath, patternsRe) {
|
8930 | return !utils.pattern.matchAny(entryPath, patternsRe);
|
8931 | }
|
8932 | };
|
8933 | exports2.default = DeepFilter;
|
8934 | }
|
8935 | });
|
8936 | var require_entry = __commonJS2({
|
8937 | "node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
|
8938 | "use strict";
|
8939 | Object.defineProperty(exports2, "__esModule", {
|
8940 | value: true
|
8941 | });
|
8942 | var utils = require_utils4();
|
8943 | var EntryFilter = class {
|
8944 | constructor(_settings, _micromatchOptions) {
|
8945 | this._settings = _settings;
|
8946 | this._micromatchOptions = _micromatchOptions;
|
8947 | this.index = new Map();
|
8948 | }
|
8949 | getFilter(positive, negative) {
|
8950 | const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
8951 | const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
8952 | return (entry) => this._filter(entry, positiveRe, negativeRe);
|
8953 | }
|
8954 | _filter(entry, positiveRe, negativeRe) {
|
8955 | if (this._settings.unique && this._isDuplicateEntry(entry)) {
|
8956 | return false;
|
8957 | }
|
8958 | if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
8959 | return false;
|
8960 | }
|
8961 | if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
|
8962 | return false;
|
8963 | }
|
8964 | const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
8965 | const isDirectory = entry.dirent.isDirectory();
|
8966 | const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory);
|
8967 | if (this._settings.unique && isMatched) {
|
8968 | this._createIndexRecord(entry);
|
8969 | }
|
8970 | return isMatched;
|
8971 | }
|
8972 | _isDuplicateEntry(entry) {
|
8973 | return this.index.has(entry.path);
|
8974 | }
|
8975 | _createIndexRecord(entry) {
|
8976 | this.index.set(entry.path, void 0);
|
8977 | }
|
8978 | _onlyFileFilter(entry) {
|
8979 | return this._settings.onlyFiles && !entry.dirent.isFile();
|
8980 | }
|
8981 | _onlyDirectoryFilter(entry) {
|
8982 | return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
8983 | }
|
8984 | _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
|
8985 | if (!this._settings.absolute) {
|
8986 | return false;
|
8987 | }
|
8988 | const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
|
8989 | return utils.pattern.matchAny(fullpath, patternsRe);
|
8990 | }
|
8991 | _isMatchToPatterns(entryPath, patternsRe, isDirectory) {
|
8992 | const filepath = utils.path.removeLeadingDotSegment(entryPath);
|
8993 | const isMatched = utils.pattern.matchAny(filepath, patternsRe);
|
8994 | if (!isMatched && isDirectory) {
|
8995 | return utils.pattern.matchAny(filepath + "/", patternsRe);
|
8996 | }
|
8997 | return isMatched;
|
8998 | }
|
8999 | };
|
9000 | exports2.default = EntryFilter;
|
9001 | }
|
9002 | });
|
9003 | var require_error = __commonJS2({
|
9004 | "node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
|
9005 | "use strict";
|
9006 | Object.defineProperty(exports2, "__esModule", {
|
9007 | value: true
|
9008 | });
|
9009 | var utils = require_utils4();
|
9010 | var ErrorFilter = class {
|
9011 | constructor(_settings) {
|
9012 | this._settings = _settings;
|
9013 | }
|
9014 | getFilter() {
|
9015 | return (error) => this._isNonFatalError(error);
|
9016 | }
|
9017 | _isNonFatalError(error) {
|
9018 | return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
9019 | }
|
9020 | };
|
9021 | exports2.default = ErrorFilter;
|
9022 | }
|
9023 | });
|
9024 | var require_entry2 = __commonJS2({
|
9025 | "node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
|
9026 | "use strict";
|
9027 | Object.defineProperty(exports2, "__esModule", {
|
9028 | value: true
|
9029 | });
|
9030 | var utils = require_utils4();
|
9031 | var EntryTransformer = class {
|
9032 | constructor(_settings) {
|
9033 | this._settings = _settings;
|
9034 | }
|
9035 | getTransformer() {
|
9036 | return (entry) => this._transform(entry);
|
9037 | }
|
9038 | _transform(entry) {
|
9039 | let filepath = entry.path;
|
9040 | if (this._settings.absolute) {
|
9041 | filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
|
9042 | filepath = utils.path.unixify(filepath);
|
9043 | }
|
9044 | if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
9045 | filepath += "/";
|
9046 | }
|
9047 | if (!this._settings.objectMode) {
|
9048 | return filepath;
|
9049 | }
|
9050 | return Object.assign(Object.assign({}, entry), {
|
9051 | path: filepath
|
9052 | });
|
9053 | }
|
9054 | };
|
9055 | exports2.default = EntryTransformer;
|
9056 | }
|
9057 | });
|
9058 | var require_provider = __commonJS2({
|
9059 | "node_modules/fast-glob/out/providers/provider.js"(exports2) {
|
9060 | "use strict";
|
9061 | Object.defineProperty(exports2, "__esModule", {
|
9062 | value: true
|
9063 | });
|
9064 | var path = require("path");
|
9065 | var deep_1 = require_deep();
|
9066 | var entry_1 = require_entry();
|
9067 | var error_1 = require_error();
|
9068 | var entry_2 = require_entry2();
|
9069 | var Provider = class {
|
9070 | constructor(_settings) {
|
9071 | this._settings = _settings;
|
9072 | this.errorFilter = new error_1.default(this._settings);
|
9073 | this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
|
9074 | this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
|
9075 | this.entryTransformer = new entry_2.default(this._settings);
|
9076 | }
|
9077 | _getRootDirectory(task) {
|
9078 | return path.resolve(this._settings.cwd, task.base);
|
9079 | }
|
9080 | _getReaderOptions(task) {
|
9081 | const basePath = task.base === "." ? "" : task.base;
|
9082 | return {
|
9083 | basePath,
|
9084 | pathSegmentSeparator: "/",
|
9085 | concurrency: this._settings.concurrency,
|
9086 | deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
9087 | entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
9088 | errorFilter: this.errorFilter.getFilter(),
|
9089 | followSymbolicLinks: this._settings.followSymbolicLinks,
|
9090 | fs: this._settings.fs,
|
9091 | stats: this._settings.stats,
|
9092 | throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
9093 | transform: this.entryTransformer.getTransformer()
|
9094 | };
|
9095 | }
|
9096 | _getMicromatchOptions() {
|
9097 | return {
|
9098 | dot: this._settings.dot,
|
9099 | matchBase: this._settings.baseNameMatch,
|
9100 | nobrace: !this._settings.braceExpansion,
|
9101 | nocase: !this._settings.caseSensitiveMatch,
|
9102 | noext: !this._settings.extglob,
|
9103 | noglobstar: !this._settings.globstar,
|
9104 | posix: true,
|
9105 | strictSlashes: false
|
9106 | };
|
9107 | }
|
9108 | };
|
9109 | exports2.default = Provider;
|
9110 | }
|
9111 | });
|
9112 | var require_async6 = __commonJS2({
|
9113 | "node_modules/fast-glob/out/providers/async.js"(exports2) {
|
9114 | "use strict";
|
9115 | Object.defineProperty(exports2, "__esModule", {
|
9116 | value: true
|
9117 | });
|
9118 | var async_1 = require_async5();
|
9119 | var provider_1 = require_provider();
|
9120 | var ProviderAsync = class extends provider_1.default {
|
9121 | constructor() {
|
9122 | super(...arguments);
|
9123 | this._reader = new async_1.default(this._settings);
|
9124 | }
|
9125 | async read(task) {
|
9126 | const root = this._getRootDirectory(task);
|
9127 | const options = this._getReaderOptions(task);
|
9128 | const entries = await this.api(root, task, options);
|
9129 | return entries.map((entry) => options.transform(entry));
|
9130 | }
|
9131 | api(root, task, options) {
|
9132 | if (task.dynamic) {
|
9133 | return this._reader.dynamic(root, options);
|
9134 | }
|
9135 | return this._reader.static(task.patterns, options);
|
9136 | }
|
9137 | };
|
9138 | exports2.default = ProviderAsync;
|
9139 | }
|
9140 | });
|
9141 | var require_stream4 = __commonJS2({
|
9142 | "node_modules/fast-glob/out/providers/stream.js"(exports2) {
|
9143 | "use strict";
|
9144 | Object.defineProperty(exports2, "__esModule", {
|
9145 | value: true
|
9146 | });
|
9147 | var stream_1 = require("stream");
|
9148 | var stream_2 = require_stream3();
|
9149 | var provider_1 = require_provider();
|
9150 | var ProviderStream = class extends provider_1.default {
|
9151 | constructor() {
|
9152 | super(...arguments);
|
9153 | this._reader = new stream_2.default(this._settings);
|
9154 | }
|
9155 | read(task) {
|
9156 | const root = this._getRootDirectory(task);
|
9157 | const options = this._getReaderOptions(task);
|
9158 | const source = this.api(root, task, options);
|
9159 | const destination = new stream_1.Readable({
|
9160 | objectMode: true,
|
9161 | read: () => {
|
9162 | }
|
9163 | });
|
9164 | source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end"));
|
9165 | destination.once("close", () => source.destroy());
|
9166 | return destination;
|
9167 | }
|
9168 | api(root, task, options) {
|
9169 | if (task.dynamic) {
|
9170 | return this._reader.dynamic(root, options);
|
9171 | }
|
9172 | return this._reader.static(task.patterns, options);
|
9173 | }
|
9174 | };
|
9175 | exports2.default = ProviderStream;
|
9176 | }
|
9177 | });
|
9178 | var require_sync5 = __commonJS2({
|
9179 | "node_modules/fast-glob/out/readers/sync.js"(exports2) {
|
9180 | "use strict";
|
9181 | Object.defineProperty(exports2, "__esModule", {
|
9182 | value: true
|
9183 | });
|
9184 | var fsStat = require_out();
|
9185 | var fsWalk = require_out3();
|
9186 | var reader_1 = require_reader2();
|
9187 | var ReaderSync = class extends reader_1.default {
|
9188 | constructor() {
|
9189 | super(...arguments);
|
9190 | this._walkSync = fsWalk.walkSync;
|
9191 | this._statSync = fsStat.statSync;
|
9192 | }
|
9193 | dynamic(root, options) {
|
9194 | return this._walkSync(root, options);
|
9195 | }
|
9196 | static(patterns, options) {
|
9197 | const entries = [];
|
9198 | for (const pattern of patterns) {
|
9199 | const filepath = this._getFullEntryPath(pattern);
|
9200 | const entry = this._getEntry(filepath, pattern, options);
|
9201 | if (entry === null || !options.entryFilter(entry)) {
|
9202 | continue;
|
9203 | }
|
9204 | entries.push(entry);
|
9205 | }
|
9206 | return entries;
|
9207 | }
|
9208 | _getEntry(filepath, pattern, options) {
|
9209 | try {
|
9210 | const stats = this._getStat(filepath);
|
9211 | return this._makeEntry(stats, pattern);
|
9212 | } catch (error) {
|
9213 | if (options.errorFilter(error)) {
|
9214 | return null;
|
9215 | }
|
9216 | throw error;
|
9217 | }
|
9218 | }
|
9219 | _getStat(filepath) {
|
9220 | return this._statSync(filepath, this._fsStatSettings);
|
9221 | }
|
9222 | };
|
9223 | exports2.default = ReaderSync;
|
9224 | }
|
9225 | });
|
9226 | var require_sync6 = __commonJS2({
|
9227 | "node_modules/fast-glob/out/providers/sync.js"(exports2) {
|
9228 | "use strict";
|
9229 | Object.defineProperty(exports2, "__esModule", {
|
9230 | value: true
|
9231 | });
|
9232 | var sync_1 = require_sync5();
|
9233 | var provider_1 = require_provider();
|
9234 | var ProviderSync = class extends provider_1.default {
|
9235 | constructor() {
|
9236 | super(...arguments);
|
9237 | this._reader = new sync_1.default(this._settings);
|
9238 | }
|
9239 | read(task) {
|
9240 | const root = this._getRootDirectory(task);
|
9241 | const options = this._getReaderOptions(task);
|
9242 | const entries = this.api(root, task, options);
|
9243 | return entries.map(options.transform);
|
9244 | }
|
9245 | api(root, task, options) {
|
9246 | if (task.dynamic) {
|
9247 | return this._reader.dynamic(root, options);
|
9248 | }
|
9249 | return this._reader.static(task.patterns, options);
|
9250 | }
|
9251 | };
|
9252 | exports2.default = ProviderSync;
|
9253 | }
|
9254 | });
|
9255 | var require_settings4 = __commonJS2({
|
9256 | "node_modules/fast-glob/out/settings.js"(exports2) {
|
9257 | "use strict";
|
9258 | Object.defineProperty(exports2, "__esModule", {
|
9259 | value: true
|
9260 | });
|
9261 | exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
9262 | var fs = require("fs");
|
9263 | var os2 = require("os");
|
9264 | var CPU_COUNT = Math.max(os2.cpus().length, 1);
|
9265 | exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
9266 | lstat: fs.lstat,
|
9267 | lstatSync: fs.lstatSync,
|
9268 | stat: fs.stat,
|
9269 | statSync: fs.statSync,
|
9270 | readdir: fs.readdir,
|
9271 | readdirSync: fs.readdirSync
|
9272 | };
|
9273 | var Settings = class {
|
9274 | constructor(_options = {}) {
|
9275 | this._options = _options;
|
9276 | this.absolute = this._getValue(this._options.absolute, false);
|
9277 | this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
|
9278 | this.braceExpansion = this._getValue(this._options.braceExpansion, true);
|
9279 | this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
|
9280 | this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
|
9281 | this.cwd = this._getValue(this._options.cwd, process.cwd());
|
9282 | this.deep = this._getValue(this._options.deep, Infinity);
|
9283 | this.dot = this._getValue(this._options.dot, false);
|
9284 | this.extglob = this._getValue(this._options.extglob, true);
|
9285 | this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
|
9286 | this.fs = this._getFileSystemMethods(this._options.fs);
|
9287 | this.globstar = this._getValue(this._options.globstar, true);
|
9288 | this.ignore = this._getValue(this._options.ignore, []);
|
9289 | this.markDirectories = this._getValue(this._options.markDirectories, false);
|
9290 | this.objectMode = this._getValue(this._options.objectMode, false);
|
9291 | this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
|
9292 | this.onlyFiles = this._getValue(this._options.onlyFiles, true);
|
9293 | this.stats = this._getValue(this._options.stats, false);
|
9294 | this.suppressErrors = this._getValue(this._options.suppressErrors, false);
|
9295 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
|
9296 | this.unique = this._getValue(this._options.unique, true);
|
9297 | if (this.onlyDirectories) {
|
9298 | this.onlyFiles = false;
|
9299 | }
|
9300 | if (this.stats) {
|
9301 | this.objectMode = true;
|
9302 | }
|
9303 | }
|
9304 | _getValue(option, value) {
|
9305 | return option === void 0 ? value : option;
|
9306 | }
|
9307 | _getFileSystemMethods(methods = {}) {
|
9308 | return Object.assign(Object.assign({}, exports2.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
9309 | }
|
9310 | };
|
9311 | exports2.default = Settings;
|
9312 | }
|
9313 | });
|
9314 | var require_out4 = __commonJS2({
|
9315 | "node_modules/fast-glob/out/index.js"(exports2, module2) {
|
9316 | "use strict";
|
9317 | var taskManager = require_tasks();
|
9318 | var patternManager = require_patterns();
|
9319 | var async_1 = require_async6();
|
9320 | var stream_1 = require_stream4();
|
9321 | var sync_1 = require_sync6();
|
9322 | var settings_1 = require_settings4();
|
9323 | var utils = require_utils4();
|
9324 | async function FastGlob(source, options) {
|
9325 | assertPatternsInput(source);
|
9326 | const works = getWorks(source, async_1.default, options);
|
9327 | const result = await Promise.all(works);
|
9328 | return utils.array.flatten(result);
|
9329 | }
|
9330 | (function(FastGlob2) {
|
9331 | function sync(source, options) {
|
9332 | assertPatternsInput(source);
|
9333 | const works = getWorks(source, sync_1.default, options);
|
9334 | return utils.array.flatten(works);
|
9335 | }
|
9336 | FastGlob2.sync = sync;
|
9337 | function stream(source, options) {
|
9338 | assertPatternsInput(source);
|
9339 | const works = getWorks(source, stream_1.default, options);
|
9340 | return utils.stream.merge(works);
|
9341 | }
|
9342 | FastGlob2.stream = stream;
|
9343 | function generateTasks(source, options) {
|
9344 | assertPatternsInput(source);
|
9345 | const patterns = patternManager.transform([].concat(source));
|
9346 | const settings = new settings_1.default(options);
|
9347 | return taskManager.generate(patterns, settings);
|
9348 | }
|
9349 | FastGlob2.generateTasks = generateTasks;
|
9350 | function isDynamicPattern(source, options) {
|
9351 | assertPatternsInput(source);
|
9352 | const settings = new settings_1.default(options);
|
9353 | return utils.pattern.isDynamicPattern(source, settings);
|
9354 | }
|
9355 | FastGlob2.isDynamicPattern = isDynamicPattern;
|
9356 | function escapePath(source) {
|
9357 | assertPatternsInput(source);
|
9358 | return utils.path.escape(source);
|
9359 | }
|
9360 | FastGlob2.escapePath = escapePath;
|
9361 | })(FastGlob || (FastGlob = {}));
|
9362 | function getWorks(source, _Provider, options) {
|
9363 | const patterns = patternManager.transform([].concat(source));
|
9364 | const settings = new settings_1.default(options);
|
9365 | const tasks = taskManager.generate(patterns, settings);
|
9366 | const provider = new _Provider(settings);
|
9367 | return tasks.map(provider.read, provider);
|
9368 | }
|
9369 | function assertPatternsInput(input) {
|
9370 | const source = [].concat(input);
|
9371 | const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
|
9372 | if (!isValidSource) {
|
9373 | throw new TypeError("Patterns must be a string (non empty) or an array of strings");
|
9374 | }
|
9375 | }
|
9376 | module2.exports = FastGlob;
|
9377 | }
|
9378 | });
|
9379 | var require_expand_patterns = __commonJS2({
|
9380 | "src/cli/expand-patterns.js"(exports2, module2) {
|
9381 | "use strict";
|
9382 | var path = require("path");
|
9383 | var fastGlob = require_out4();
|
9384 | var {
|
9385 | statSafe
|
9386 | } = require_utils();
|
9387 | async function* expandPatterns(context) {
|
9388 | const cwd = process.cwd();
|
9389 | const seen = new Set();
|
9390 | let noResults = true;
|
9391 | for await (const pathOrError of expandPatternsInternal(context)) {
|
9392 | noResults = false;
|
9393 | if (typeof pathOrError !== "string") {
|
9394 | yield pathOrError;
|
9395 | continue;
|
9396 | }
|
9397 | const relativePath = path.relative(cwd, pathOrError);
|
9398 | if (seen.has(relativePath)) {
|
9399 | continue;
|
9400 | }
|
9401 | seen.add(relativePath);
|
9402 | yield relativePath;
|
9403 | }
|
9404 | if (noResults && context.argv.errorOnUnmatchedPattern !== false) {
|
9405 | yield {
|
9406 | error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`
|
9407 | };
|
9408 | }
|
9409 | }
|
9410 | async function* expandPatternsInternal(context) {
|
9411 | const silentlyIgnoredDirs = [".git", ".sl", ".svn", ".hg"];
|
9412 | if (context.argv.withNodeModules !== true) {
|
9413 | silentlyIgnoredDirs.push("node_modules");
|
9414 | }
|
9415 | const globOptions = {
|
9416 | dot: true,
|
9417 | ignore: silentlyIgnoredDirs.map((dir) => "**/" + dir)
|
9418 | };
|
9419 | let supportedFilesGlob;
|
9420 | const cwd = process.cwd();
|
9421 | const entries = [];
|
9422 | for (const pattern of context.filePatterns) {
|
9423 | const absolutePath = path.resolve(cwd, pattern);
|
9424 | if (containsIgnoredPathSegment(absolutePath, cwd, silentlyIgnoredDirs)) {
|
9425 | continue;
|
9426 | }
|
9427 | const stat = await statSafe(absolutePath);
|
9428 | if (stat) {
|
9429 | if (stat.isFile()) {
|
9430 | entries.push({
|
9431 | type: "file",
|
9432 | glob: escapePathForGlob(fixWindowsSlashes(pattern)),
|
9433 | input: pattern
|
9434 | });
|
9435 | } else if (stat.isDirectory()) {
|
9436 | const relativePath = path.relative(cwd, absolutePath) || ".";
|
9437 | entries.push({
|
9438 | type: "dir",
|
9439 | glob: escapePathForGlob(fixWindowsSlashes(relativePath)) + "/" + getSupportedFilesGlob(),
|
9440 | input: pattern
|
9441 | });
|
9442 | }
|
9443 | } else if (pattern[0] === "!") {
|
9444 | globOptions.ignore.push(fixWindowsSlashes(pattern.slice(1)));
|
9445 | } else {
|
9446 | entries.push({
|
9447 | type: "glob",
|
9448 | glob: fixWindowsSlashes(pattern),
|
9449 | input: pattern
|
9450 | });
|
9451 | }
|
9452 | }
|
9453 | for (const {
|
9454 | type,
|
9455 | glob,
|
9456 | input
|
9457 | } of entries) {
|
9458 | let result;
|
9459 | try {
|
9460 | result = await fastGlob(glob, globOptions);
|
9461 | } catch ({
|
9462 | message
|
9463 | }) {
|
9464 | yield {
|
9465 | error: `${errorMessages.globError[type]}: ${input}
|
9466 | ${message}`
|
9467 | };
|
9468 | continue;
|
9469 | }
|
9470 | if (result.length === 0) {
|
9471 | if (context.argv.errorOnUnmatchedPattern !== false) {
|
9472 | yield {
|
9473 | error: `${errorMessages.emptyResults[type]}: "${input}".`
|
9474 | };
|
9475 | }
|
9476 | } else {
|
9477 | yield* sortPaths(result);
|
9478 | }
|
9479 | }
|
9480 | function getSupportedFilesGlob() {
|
9481 | if (!supportedFilesGlob) {
|
9482 | const extensions = context.languages.flatMap((lang) => lang.extensions || []);
|
9483 | const filenames = context.languages.flatMap((lang) => lang.filenames || []);
|
9484 | supportedFilesGlob = `**/{${[...extensions.map((ext) => "*" + (ext[0] === "." ? ext : "." + ext)), ...filenames]}}`;
|
9485 | }
|
9486 | return supportedFilesGlob;
|
9487 | }
|
9488 | }
|
9489 | var errorMessages = {
|
9490 | globError: {
|
9491 | file: "Unable to resolve file",
|
9492 | dir: "Unable to expand directory",
|
9493 | glob: "Unable to expand glob pattern"
|
9494 | },
|
9495 | emptyResults: {
|
9496 | file: "Explicitly specified file was ignored due to negative glob patterns",
|
9497 | dir: "No supported files were found in the directory",
|
9498 | glob: "No files matching the pattern were found"
|
9499 | }
|
9500 | };
|
9501 | function containsIgnoredPathSegment(absolutePath, cwd, ignoredDirectories) {
|
9502 | return path.relative(cwd, absolutePath).split(path.sep).some((dir) => ignoredDirectories.includes(dir));
|
9503 | }
|
9504 | function sortPaths(paths) {
|
9505 | return paths.sort((a, b) => a.localeCompare(b));
|
9506 | }
|
9507 | function escapePathForGlob(path2) {
|
9508 | return fastGlob.escapePath(path2.replace(/\\/g, "\0")).replace(/\\!/g, "@(!)").replace(/\0/g, "@(\\\\)");
|
9509 | }
|
9510 | var isWindows = path.sep === "\\";
|
9511 | function fixWindowsSlashes(pattern) {
|
9512 | return isWindows ? pattern.replace(/\\/g, "/") : pattern;
|
9513 | }
|
9514 | module2.exports = {
|
9515 | expandPatterns,
|
9516 | fixWindowsSlashes
|
9517 | };
|
9518 | }
|
9519 | });
|
9520 | var require_get_options_for_file = __commonJS2({
|
9521 | "src/cli/options/get-options-for-file.js"(exports2, module2) {
|
9522 | "use strict";
|
9523 | var dashify = require_dashify();
|
9524 | var prettier2 = require("./index.js");
|
9525 | var {
|
9526 | optionsNormalizer
|
9527 | } = require_prettier_internal();
|
9528 | var minimist = require_minimist2();
|
9529 | var createMinimistOptions = require_create_minimist_options();
|
9530 | var normalizeCliOptions = require_normalize_cli_options();
|
9531 | function getOptions(argv, detailedOptions) {
|
9532 | return Object.fromEntries(detailedOptions.filter(({
|
9533 | forwardToApi
|
9534 | }) => forwardToApi).map(({
|
9535 | forwardToApi,
|
9536 | name
|
9537 | }) => [forwardToApi, argv[name]]));
|
9538 | }
|
9539 | function cliifyOptions(object, apiDetailedOptionMap) {
|
9540 | return Object.fromEntries(Object.entries(object || {}).map(([key, value]) => {
|
9541 | const apiOption = apiDetailedOptionMap[key];
|
9542 | const cliKey = apiOption ? apiOption.name : key;
|
9543 | return [dashify(cliKey), value];
|
9544 | }));
|
9545 | }
|
9546 | function createApiDetailedOptionMap(detailedOptions) {
|
9547 | return Object.fromEntries(detailedOptions.filter((option) => option.forwardToApi && option.forwardToApi !== option.name).map((option) => [option.forwardToApi, option]));
|
9548 | }
|
9549 | function parseArgsToOptions(context, overrideDefaults) {
|
9550 | const minimistOptions = createMinimistOptions(context.detailedOptions);
|
9551 | const apiDetailedOptionMap = createApiDetailedOptionMap(context.detailedOptions);
|
9552 | return getOptions(normalizeCliOptions(minimist(context.rawArguments, {
|
9553 | string: minimistOptions.string,
|
9554 | boolean: minimistOptions.boolean,
|
9555 | default: cliifyOptions(overrideDefaults, apiDetailedOptionMap)
|
9556 | }), context.detailedOptions, {
|
9557 | logger: false
|
9558 | }), context.detailedOptions);
|
9559 | }
|
9560 | async function getOptionsOrDie(context, filePath) {
|
9561 | try {
|
9562 | if (context.argv.config === false) {
|
9563 | context.logger.debug("'--no-config' option found, skip loading config file.");
|
9564 | return null;
|
9565 | }
|
9566 | context.logger.debug(context.argv.config ? `load config file from '${context.argv.config}'` : `resolve config from '${filePath}'`);
|
9567 | const options = await prettier2.resolveConfig(filePath, {
|
9568 | editorconfig: context.argv.editorconfig,
|
9569 | config: context.argv.config
|
9570 | });
|
9571 | context.logger.debug("loaded options `" + JSON.stringify(options) + "`");
|
9572 | return options;
|
9573 | } catch (error) {
|
9574 | context.logger.error(`Invalid configuration file \`${filePath}\`: ` + error.message);
|
9575 | process.exit(2);
|
9576 | }
|
9577 | }
|
9578 | function applyConfigPrecedence(context, options) {
|
9579 | try {
|
9580 | switch (context.argv.configPrecedence) {
|
9581 | case "cli-override":
|
9582 | return parseArgsToOptions(context, options);
|
9583 | case "file-override":
|
9584 | return Object.assign(Object.assign({}, parseArgsToOptions(context)), options);
|
9585 | case "prefer-file":
|
9586 | return options || parseArgsToOptions(context);
|
9587 | }
|
9588 | } catch (error) {
|
9589 | context.logger.error(error.toString());
|
9590 | process.exit(2);
|
9591 | }
|
9592 | }
|
9593 | async function getOptionsForFile(context, filepath) {
|
9594 | const options = await getOptionsOrDie(context, filepath);
|
9595 | const hasPlugins = options && options.plugins;
|
9596 | if (hasPlugins) {
|
9597 | context.pushContextPlugins(options.plugins);
|
9598 | }
|
9599 | const appliedOptions = Object.assign({
|
9600 | filepath
|
9601 | }, applyConfigPrecedence(context, options && optionsNormalizer.normalizeApiOptions(options, context.supportOptions, {
|
9602 | logger: context.logger
|
9603 | })));
|
9604 | context.logger.debug(`applied config-precedence (${context.argv.configPrecedence}): ${JSON.stringify(appliedOptions)}`);
|
9605 | if (hasPlugins) {
|
9606 | context.popContextPlugins();
|
9607 | }
|
9608 | return appliedOptions;
|
9609 | }
|
9610 | module2.exports = getOptionsForFile;
|
9611 | }
|
9612 | });
|
9613 | var require_is_tty = __commonJS2({
|
9614 | "src/cli/is-tty.js"(exports2, module2) {
|
9615 | "use strict";
|
9616 | var {
|
9617 | isCI
|
9618 | } = require("./third-party.js");
|
9619 | module2.exports = function isTTY() {
|
9620 | return process.stdout.isTTY && !isCI();
|
9621 | };
|
9622 | }
|
9623 | });
|
9624 | var require_commondir = __commonJS2({
|
9625 | "node_modules/commondir/index.js"(exports2, module2) {
|
9626 | var path = require("path");
|
9627 | module2.exports = function(basedir, relfiles) {
|
9628 | if (relfiles) {
|
9629 | var files = relfiles.map(function(r) {
|
9630 | return path.resolve(basedir, r);
|
9631 | });
|
9632 | } else {
|
9633 | var files = basedir;
|
9634 | }
|
9635 | var res = files.slice(1).reduce(function(ps, file) {
|
9636 | if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
|
9637 | throw new Error("relative path without a basedir");
|
9638 | }
|
9639 | var xs = file.split(/\/+|\\+/);
|
9640 | for (var i = 0; ps[i] === xs[i] && i < Math.min(ps.length, xs.length); i++)
|
9641 | ;
|
9642 | return ps.slice(0, i);
|
9643 | }, files[0].split(/\/+|\\+/));
|
9644 | return res.length > 1 ? res.join("/") : "/";
|
9645 | };
|
9646 | }
|
9647 | });
|
9648 | var require_p_try = __commonJS2({
|
9649 | "node_modules/p-try/index.js"(exports2, module2) {
|
9650 | "use strict";
|
9651 | var pTry = (fn, ...arguments_) => new Promise((resolve) => {
|
9652 | resolve(fn(...arguments_));
|
9653 | });
|
9654 | module2.exports = pTry;
|
9655 | module2.exports.default = pTry;
|
9656 | }
|
9657 | });
|
9658 | var require_p_limit = __commonJS2({
|
9659 | "node_modules/pkg-dir/node_modules/p-limit/index.js"(exports2, module2) {
|
9660 | "use strict";
|
9661 | var pTry = require_p_try();
|
9662 | var pLimit = (concurrency) => {
|
9663 | if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
9664 | return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
|
9665 | }
|
9666 | const queue = [];
|
9667 | let activeCount = 0;
|
9668 | const next = () => {
|
9669 | activeCount--;
|
9670 | if (queue.length > 0) {
|
9671 | queue.shift()();
|
9672 | }
|
9673 | };
|
9674 | const run2 = (fn, resolve, ...args) => {
|
9675 | activeCount++;
|
9676 | const result = pTry(fn, ...args);
|
9677 | resolve(result);
|
9678 | result.then(next, next);
|
9679 | };
|
9680 | const enqueue = (fn, resolve, ...args) => {
|
9681 | if (activeCount < concurrency) {
|
9682 | run2(fn, resolve, ...args);
|
9683 | } else {
|
9684 | queue.push(run2.bind(null, fn, resolve, ...args));
|
9685 | }
|
9686 | };
|
9687 | const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
|
9688 | Object.defineProperties(generator, {
|
9689 | activeCount: {
|
9690 | get: () => activeCount
|
9691 | },
|
9692 | pendingCount: {
|
9693 | get: () => queue.length
|
9694 | },
|
9695 | clearQueue: {
|
9696 | value: () => {
|
9697 | queue.length = 0;
|
9698 | }
|
9699 | }
|
9700 | });
|
9701 | return generator;
|
9702 | };
|
9703 | module2.exports = pLimit;
|
9704 | module2.exports.default = pLimit;
|
9705 | }
|
9706 | });
|
9707 | var require_p_locate = __commonJS2({
|
9708 | "node_modules/pkg-dir/node_modules/p-locate/index.js"(exports2, module2) {
|
9709 | "use strict";
|
9710 | var pLimit = require_p_limit();
|
9711 | var EndError = class extends Error {
|
9712 | constructor(value) {
|
9713 | super();
|
9714 | this.value = value;
|
9715 | }
|
9716 | };
|
9717 | var testElement = async (element, tester) => tester(await element);
|
9718 | var finder = async (element) => {
|
9719 | const values = await Promise.all(element);
|
9720 | if (values[1] === true) {
|
9721 | throw new EndError(values[0]);
|
9722 | }
|
9723 | return false;
|
9724 | };
|
9725 | var pLocate = async (iterable, tester, options) => {
|
9726 | options = Object.assign({
|
9727 | concurrency: Infinity,
|
9728 | preserveOrder: true
|
9729 | }, options);
|
9730 | const limit = pLimit(options.concurrency);
|
9731 | const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
|
9732 | const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
|
9733 | try {
|
9734 | await Promise.all(items.map((element) => checkLimit(finder, element)));
|
9735 | } catch (error) {
|
9736 | if (error instanceof EndError) {
|
9737 | return error.value;
|
9738 | }
|
9739 | throw error;
|
9740 | }
|
9741 | };
|
9742 | module2.exports = pLocate;
|
9743 | module2.exports.default = pLocate;
|
9744 | }
|
9745 | });
|
9746 | var require_locate_path = __commonJS2({
|
9747 | "node_modules/pkg-dir/node_modules/locate-path/index.js"(exports2, module2) {
|
9748 | "use strict";
|
9749 | var path = require("path");
|
9750 | var fs = require("fs");
|
9751 | var {
|
9752 | promisify
|
9753 | } = require("util");
|
9754 | var pLocate = require_p_locate();
|
9755 | var fsStat = promisify(fs.stat);
|
9756 | var fsLStat = promisify(fs.lstat);
|
9757 | var typeMappings = {
|
9758 | directory: "isDirectory",
|
9759 | file: "isFile"
|
9760 | };
|
9761 | function checkType({
|
9762 | type
|
9763 | }) {
|
9764 | if (type in typeMappings) {
|
9765 | return;
|
9766 | }
|
9767 | throw new Error(`Invalid type specified: ${type}`);
|
9768 | }
|
9769 | var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
|
9770 | module2.exports = async (paths, options) => {
|
9771 | options = Object.assign({
|
9772 | cwd: process.cwd(),
|
9773 | type: "file",
|
9774 | allowSymlinks: true
|
9775 | }, options);
|
9776 | checkType(options);
|
9777 | const statFn = options.allowSymlinks ? fsStat : fsLStat;
|
9778 | return pLocate(paths, async (path_) => {
|
9779 | try {
|
9780 | const stat = await statFn(path.resolve(options.cwd, path_));
|
9781 | return matchType(options.type, stat);
|
9782 | } catch (_) {
|
9783 | return false;
|
9784 | }
|
9785 | }, options);
|
9786 | };
|
9787 | module2.exports.sync = (paths, options) => {
|
9788 | options = Object.assign({
|
9789 | cwd: process.cwd(),
|
9790 | allowSymlinks: true,
|
9791 | type: "file"
|
9792 | }, options);
|
9793 | checkType(options);
|
9794 | const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
|
9795 | for (const path_ of paths) {
|
9796 | try {
|
9797 | const stat = statFn(path.resolve(options.cwd, path_));
|
9798 | if (matchType(options.type, stat)) {
|
9799 | return path_;
|
9800 | }
|
9801 | } catch (_) {
|
9802 | }
|
9803 | }
|
9804 | };
|
9805 | }
|
9806 | });
|
9807 | var require_path_exists = __commonJS2({
|
9808 | "node_modules/path-exists/index.js"(exports2, module2) {
|
9809 | "use strict";
|
9810 | var fs = require("fs");
|
9811 | var {
|
9812 | promisify
|
9813 | } = require("util");
|
9814 | var pAccess = promisify(fs.access);
|
9815 | module2.exports = async (path) => {
|
9816 | try {
|
9817 | await pAccess(path);
|
9818 | return true;
|
9819 | } catch (_) {
|
9820 | return false;
|
9821 | }
|
9822 | };
|
9823 | module2.exports.sync = (path) => {
|
9824 | try {
|
9825 | fs.accessSync(path);
|
9826 | return true;
|
9827 | } catch (_) {
|
9828 | return false;
|
9829 | }
|
9830 | };
|
9831 | }
|
9832 | });
|
9833 | var require_find_up = __commonJS2({
|
9834 | "node_modules/pkg-dir/node_modules/find-up/index.js"(exports2, module2) {
|
9835 | "use strict";
|
9836 | var path = require("path");
|
9837 | var locatePath = require_locate_path();
|
9838 | var pathExists = require_path_exists();
|
9839 | var stop = Symbol("findUp.stop");
|
9840 | module2.exports = async (name, options = {}) => {
|
9841 | let directory = path.resolve(options.cwd || "");
|
9842 | const {
|
9843 | root
|
9844 | } = path.parse(directory);
|
9845 | const paths = [].concat(name);
|
9846 | const runMatcher = async (locateOptions) => {
|
9847 | if (typeof name !== "function") {
|
9848 | return locatePath(paths, locateOptions);
|
9849 | }
|
9850 | const foundPath = await name(locateOptions.cwd);
|
9851 | if (typeof foundPath === "string") {
|
9852 | return locatePath([foundPath], locateOptions);
|
9853 | }
|
9854 | return foundPath;
|
9855 | };
|
9856 | while (true) {
|
9857 | const foundPath = await runMatcher(Object.assign(Object.assign({}, options), {}, {
|
9858 | cwd: directory
|
9859 | }));
|
9860 | if (foundPath === stop) {
|
9861 | return;
|
9862 | }
|
9863 | if (foundPath) {
|
9864 | return path.resolve(directory, foundPath);
|
9865 | }
|
9866 | if (directory === root) {
|
9867 | return;
|
9868 | }
|
9869 | directory = path.dirname(directory);
|
9870 | }
|
9871 | };
|
9872 | module2.exports.sync = (name, options = {}) => {
|
9873 | let directory = path.resolve(options.cwd || "");
|
9874 | const {
|
9875 | root
|
9876 | } = path.parse(directory);
|
9877 | const paths = [].concat(name);
|
9878 | const runMatcher = (locateOptions) => {
|
9879 | if (typeof name !== "function") {
|
9880 | return locatePath.sync(paths, locateOptions);
|
9881 | }
|
9882 | const foundPath = name(locateOptions.cwd);
|
9883 | if (typeof foundPath === "string") {
|
9884 | return locatePath.sync([foundPath], locateOptions);
|
9885 | }
|
9886 | return foundPath;
|
9887 | };
|
9888 | while (true) {
|
9889 | const foundPath = runMatcher(Object.assign(Object.assign({}, options), {}, {
|
9890 | cwd: directory
|
9891 | }));
|
9892 | if (foundPath === stop) {
|
9893 | return;
|
9894 | }
|
9895 | if (foundPath) {
|
9896 | return path.resolve(directory, foundPath);
|
9897 | }
|
9898 | if (directory === root) {
|
9899 | return;
|
9900 | }
|
9901 | directory = path.dirname(directory);
|
9902 | }
|
9903 | };
|
9904 | module2.exports.exists = pathExists;
|
9905 | module2.exports.sync.exists = pathExists.sync;
|
9906 | module2.exports.stop = stop;
|
9907 | }
|
9908 | });
|
9909 | var require_pkg_dir = __commonJS2({
|
9910 | "node_modules/pkg-dir/index.js"(exports2, module2) {
|
9911 | "use strict";
|
9912 | var path = require("path");
|
9913 | var findUp = require_find_up();
|
9914 | var pkgDir = async (cwd) => {
|
9915 | const filePath = await findUp("package.json", {
|
9916 | cwd
|
9917 | });
|
9918 | return filePath && path.dirname(filePath);
|
9919 | };
|
9920 | module2.exports = pkgDir;
|
9921 | module2.exports.default = pkgDir;
|
9922 | module2.exports.sync = (cwd) => {
|
9923 | const filePath = findUp.sync("package.json", {
|
9924 | cwd
|
9925 | });
|
9926 | return filePath && path.dirname(filePath);
|
9927 | };
|
9928 | }
|
9929 | });
|
9930 | var require_semver = __commonJS2({
|
9931 | "node_modules/make-dir/node_modules/semver/semver.js"(exports2, module2) {
|
9932 | exports2 = module2.exports = SemVer;
|
9933 | var debug;
|
9934 | if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
|
9935 | debug = function() {
|
9936 | var args = Array.prototype.slice.call(arguments, 0);
|
9937 | args.unshift("SEMVER");
|
9938 | console.log.apply(console, args);
|
9939 | };
|
9940 | } else {
|
9941 | debug = function() {
|
9942 | };
|
9943 | }
|
9944 | exports2.SEMVER_SPEC_VERSION = "2.0.0";
|
9945 | var MAX_LENGTH = 256;
|
9946 | var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
9947 | var MAX_SAFE_COMPONENT_LENGTH = 16;
|
9948 | var re = exports2.re = [];
|
9949 | var src = exports2.src = [];
|
9950 | var t = exports2.tokens = {};
|
9951 | var R = 0;
|
9952 | function tok(n) {
|
9953 | t[n] = R++;
|
9954 | }
|
9955 | tok("NUMERICIDENTIFIER");
|
9956 | src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
|
9957 | tok("NUMERICIDENTIFIERLOOSE");
|
9958 | src[t.NUMERICIDENTIFIERLOOSE] = "[0-9]+";
|
9959 | tok("NONNUMERICIDENTIFIER");
|
9960 | src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
|
9961 | tok("MAINVERSION");
|
9962 | src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
|
9963 | tok("MAINVERSIONLOOSE");
|
9964 | src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
|
9965 | tok("PRERELEASEIDENTIFIER");
|
9966 | src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
|
9967 | tok("PRERELEASEIDENTIFIERLOOSE");
|
9968 | src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
|
9969 | tok("PRERELEASE");
|
9970 | src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
|
9971 | tok("PRERELEASELOOSE");
|
9972 | src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
|
9973 | tok("BUILDIDENTIFIER");
|
9974 | src[t.BUILDIDENTIFIER] = "[0-9A-Za-z-]+";
|
9975 | tok("BUILD");
|
9976 | src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
|
9977 | tok("FULL");
|
9978 | tok("FULLPLAIN");
|
9979 | src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
|
9980 | src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
|
9981 | tok("LOOSEPLAIN");
|
9982 | src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
|
9983 | tok("LOOSE");
|
9984 | src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
|
9985 | tok("GTLT");
|
9986 | src[t.GTLT] = "((?:<|>)?=?)";
|
9987 | tok("XRANGEIDENTIFIERLOOSE");
|
9988 | src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
|
9989 | tok("XRANGEIDENTIFIER");
|
9990 | src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
|
9991 | tok("XRANGEPLAIN");
|
9992 | src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
|
9993 | tok("XRANGEPLAINLOOSE");
|
9994 | src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
|
9995 | tok("XRANGE");
|
9996 | src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
|
9997 | tok("XRANGELOOSE");
|
9998 | src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
|
9999 | tok("COERCE");
|
10000 | src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
|
10001 | tok("COERCERTL");
|
10002 | re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
|
10003 | tok("LONETILDE");
|
10004 | src[t.LONETILDE] = "(?:~>?)";
|
10005 | tok("TILDETRIM");
|
10006 | src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
|
10007 | re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
|
10008 | var tildeTrimReplace = "$1~";
|
10009 | tok("TILDE");
|
10010 | src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
|
10011 | tok("TILDELOOSE");
|
10012 | src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
|
10013 | tok("LONECARET");
|
10014 | src[t.LONECARET] = "(?:\\^)";
|
10015 | tok("CARETTRIM");
|
10016 | src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
|
10017 | re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
|
10018 | var caretTrimReplace = "$1^";
|
10019 | tok("CARET");
|
10020 | src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
|
10021 | tok("CARETLOOSE");
|
10022 | src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
|
10023 | tok("COMPARATORLOOSE");
|
10024 | src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
|
10025 | tok("COMPARATOR");
|
10026 | src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
|
10027 | tok("COMPARATORTRIM");
|
10028 | src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
|
10029 | re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
|
10030 | var comparatorTrimReplace = "$1$2$3";
|
10031 | tok("HYPHENRANGE");
|
10032 | src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
|
10033 | tok("HYPHENRANGELOOSE");
|
10034 | src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
|
10035 | tok("STAR");
|
10036 | src[t.STAR] = "(<|>)?=?\\s*\\*";
|
10037 | for (i = 0; i < R; i++) {
|
10038 | debug(i, src[i]);
|
10039 | if (!re[i]) {
|
10040 | re[i] = new RegExp(src[i]);
|
10041 | }
|
10042 | }
|
10043 | var i;
|
10044 | exports2.parse = parse;
|
10045 | function parse(version, options) {
|
10046 | if (!options || typeof options !== "object") {
|
10047 | options = {
|
10048 | loose: !!options,
|
10049 | includePrerelease: false
|
10050 | };
|
10051 | }
|
10052 | if (version instanceof SemVer) {
|
10053 | return version;
|
10054 | }
|
10055 | if (typeof version !== "string") {
|
10056 | return null;
|
10057 | }
|
10058 | if (version.length > MAX_LENGTH) {
|
10059 | return null;
|
10060 | }
|
10061 | var r = options.loose ? re[t.LOOSE] : re[t.FULL];
|
10062 | if (!r.test(version)) {
|
10063 | return null;
|
10064 | }
|
10065 | try {
|
10066 | return new SemVer(version, options);
|
10067 | } catch (er) {
|
10068 | return null;
|
10069 | }
|
10070 | }
|
10071 | exports2.valid = valid;
|
10072 | function valid(version, options) {
|
10073 | var v = parse(version, options);
|
10074 | return v ? v.version : null;
|
10075 | }
|
10076 | exports2.clean = clean;
|
10077 | function clean(version, options) {
|
10078 | var s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
10079 | return s ? s.version : null;
|
10080 | }
|
10081 | exports2.SemVer = SemVer;
|
10082 | function SemVer(version, options) {
|
10083 | if (!options || typeof options !== "object") {
|
10084 | options = {
|
10085 | loose: !!options,
|
10086 | includePrerelease: false
|
10087 | };
|
10088 | }
|
10089 | if (version instanceof SemVer) {
|
10090 | if (version.loose === options.loose) {
|
10091 | return version;
|
10092 | } else {
|
10093 | version = version.version;
|
10094 | }
|
10095 | } else if (typeof version !== "string") {
|
10096 | throw new TypeError("Invalid Version: " + version);
|
10097 | }
|
10098 | if (version.length > MAX_LENGTH) {
|
10099 | throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
|
10100 | }
|
10101 | if (!(this instanceof SemVer)) {
|
10102 | return new SemVer(version, options);
|
10103 | }
|
10104 | debug("SemVer", version, options);
|
10105 | this.options = options;
|
10106 | this.loose = !!options.loose;
|
10107 | var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
10108 | if (!m) {
|
10109 | throw new TypeError("Invalid Version: " + version);
|
10110 | }
|
10111 | this.raw = version;
|
10112 | this.major = +m[1];
|
10113 | this.minor = +m[2];
|
10114 | this.patch = +m[3];
|
10115 | if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
10116 | throw new TypeError("Invalid major version");
|
10117 | }
|
10118 | if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
10119 | throw new TypeError("Invalid minor version");
|
10120 | }
|
10121 | if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
10122 | throw new TypeError("Invalid patch version");
|
10123 | }
|
10124 | if (!m[4]) {
|
10125 | this.prerelease = [];
|
10126 | } else {
|
10127 | this.prerelease = m[4].split(".").map(function(id) {
|
10128 | if (/^[0-9]+$/.test(id)) {
|
10129 | var num = +id;
|
10130 | if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
10131 | return num;
|
10132 | }
|
10133 | }
|
10134 | return id;
|
10135 | });
|
10136 | }
|
10137 | this.build = m[5] ? m[5].split(".") : [];
|
10138 | this.format();
|
10139 | }
|
10140 | SemVer.prototype.format = function() {
|
10141 | this.version = this.major + "." + this.minor + "." + this.patch;
|
10142 | if (this.prerelease.length) {
|
10143 | this.version += "-" + this.prerelease.join(".");
|
10144 | }
|
10145 | return this.version;
|
10146 | };
|
10147 | SemVer.prototype.toString = function() {
|
10148 | return this.version;
|
10149 | };
|
10150 | SemVer.prototype.compare = function(other) {
|
10151 | debug("SemVer.compare", this.version, this.options, other);
|
10152 | if (!(other instanceof SemVer)) {
|
10153 | other = new SemVer(other, this.options);
|
10154 | }
|
10155 | return this.compareMain(other) || this.comparePre(other);
|
10156 | };
|
10157 | SemVer.prototype.compareMain = function(other) {
|
10158 | if (!(other instanceof SemVer)) {
|
10159 | other = new SemVer(other, this.options);
|
10160 | }
|
10161 | return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
10162 | };
|
10163 | SemVer.prototype.comparePre = function(other) {
|
10164 | if (!(other instanceof SemVer)) {
|
10165 | other = new SemVer(other, this.options);
|
10166 | }
|
10167 | if (this.prerelease.length && !other.prerelease.length) {
|
10168 | return -1;
|
10169 | } else if (!this.prerelease.length && other.prerelease.length) {
|
10170 | return 1;
|
10171 | } else if (!this.prerelease.length && !other.prerelease.length) {
|
10172 | return 0;
|
10173 | }
|
10174 | var i2 = 0;
|
10175 | do {
|
10176 | var a = this.prerelease[i2];
|
10177 | var b = other.prerelease[i2];
|
10178 | debug("prerelease compare", i2, a, b);
|
10179 | if (a === void 0 && b === void 0) {
|
10180 | return 0;
|
10181 | } else if (b === void 0) {
|
10182 | return 1;
|
10183 | } else if (a === void 0) {
|
10184 | return -1;
|
10185 | } else if (a === b) {
|
10186 | continue;
|
10187 | } else {
|
10188 | return compareIdentifiers(a, b);
|
10189 | }
|
10190 | } while (++i2);
|
10191 | };
|
10192 | SemVer.prototype.compareBuild = function(other) {
|
10193 | if (!(other instanceof SemVer)) {
|
10194 | other = new SemVer(other, this.options);
|
10195 | }
|
10196 | var i2 = 0;
|
10197 | do {
|
10198 | var a = this.build[i2];
|
10199 | var b = other.build[i2];
|
10200 | debug("prerelease compare", i2, a, b);
|
10201 | if (a === void 0 && b === void 0) {
|
10202 | return 0;
|
10203 | } else if (b === void 0) {
|
10204 | return 1;
|
10205 | } else if (a === void 0) {
|
10206 | return -1;
|
10207 | } else if (a === b) {
|
10208 | continue;
|
10209 | } else {
|
10210 | return compareIdentifiers(a, b);
|
10211 | }
|
10212 | } while (++i2);
|
10213 | };
|
10214 | SemVer.prototype.inc = function(release, identifier) {
|
10215 | switch (release) {
|
10216 | case "premajor":
|
10217 | this.prerelease.length = 0;
|
10218 | this.patch = 0;
|
10219 | this.minor = 0;
|
10220 | this.major++;
|
10221 | this.inc("pre", identifier);
|
10222 | break;
|
10223 | case "preminor":
|
10224 | this.prerelease.length = 0;
|
10225 | this.patch = 0;
|
10226 | this.minor++;
|
10227 | this.inc("pre", identifier);
|
10228 | break;
|
10229 | case "prepatch":
|
10230 | this.prerelease.length = 0;
|
10231 | this.inc("patch", identifier);
|
10232 | this.inc("pre", identifier);
|
10233 | break;
|
10234 | case "prerelease":
|
10235 | if (this.prerelease.length === 0) {
|
10236 | this.inc("patch", identifier);
|
10237 | }
|
10238 | this.inc("pre", identifier);
|
10239 | break;
|
10240 | case "major":
|
10241 | if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
10242 | this.major++;
|
10243 | }
|
10244 | this.minor = 0;
|
10245 | this.patch = 0;
|
10246 | this.prerelease = [];
|
10247 | break;
|
10248 | case "minor":
|
10249 | if (this.patch !== 0 || this.prerelease.length === 0) {
|
10250 | this.minor++;
|
10251 | }
|
10252 | this.patch = 0;
|
10253 | this.prerelease = [];
|
10254 | break;
|
10255 | case "patch":
|
10256 | if (this.prerelease.length === 0) {
|
10257 | this.patch++;
|
10258 | }
|
10259 | this.prerelease = [];
|
10260 | break;
|
10261 | case "pre":
|
10262 | if (this.prerelease.length === 0) {
|
10263 | this.prerelease = [0];
|
10264 | } else {
|
10265 | var i2 = this.prerelease.length;
|
10266 | while (--i2 >= 0) {
|
10267 | if (typeof this.prerelease[i2] === "number") {
|
10268 | this.prerelease[i2]++;
|
10269 | i2 = -2;
|
10270 | }
|
10271 | }
|
10272 | if (i2 === -1) {
|
10273 | this.prerelease.push(0);
|
10274 | }
|
10275 | }
|
10276 | if (identifier) {
|
10277 | if (this.prerelease[0] === identifier) {
|
10278 | if (isNaN(this.prerelease[1])) {
|
10279 | this.prerelease = [identifier, 0];
|
10280 | }
|
10281 | } else {
|
10282 | this.prerelease = [identifier, 0];
|
10283 | }
|
10284 | }
|
10285 | break;
|
10286 | default:
|
10287 | throw new Error("invalid increment argument: " + release);
|
10288 | }
|
10289 | this.format();
|
10290 | this.raw = this.version;
|
10291 | return this;
|
10292 | };
|
10293 | exports2.inc = inc;
|
10294 | function inc(version, release, loose, identifier) {
|
10295 | if (typeof loose === "string") {
|
10296 | identifier = loose;
|
10297 | loose = void 0;
|
10298 | }
|
10299 | try {
|
10300 | return new SemVer(version, loose).inc(release, identifier).version;
|
10301 | } catch (er) {
|
10302 | return null;
|
10303 | }
|
10304 | }
|
10305 | exports2.diff = diff;
|
10306 | function diff(version1, version2) {
|
10307 | if (eq(version1, version2)) {
|
10308 | return null;
|
10309 | } else {
|
10310 | var v1 = parse(version1);
|
10311 | var v2 = parse(version2);
|
10312 | var prefix = "";
|
10313 | if (v1.prerelease.length || v2.prerelease.length) {
|
10314 | prefix = "pre";
|
10315 | var defaultResult = "prerelease";
|
10316 | }
|
10317 | for (var key in v1) {
|
10318 | if (key === "major" || key === "minor" || key === "patch") {
|
10319 | if (v1[key] !== v2[key]) {
|
10320 | return prefix + key;
|
10321 | }
|
10322 | }
|
10323 | }
|
10324 | return defaultResult;
|
10325 | }
|
10326 | }
|
10327 | exports2.compareIdentifiers = compareIdentifiers;
|
10328 | var numeric = /^[0-9]+$/;
|
10329 | function compareIdentifiers(a, b) {
|
10330 | var anum = numeric.test(a);
|
10331 | var bnum = numeric.test(b);
|
10332 | if (anum && bnum) {
|
10333 | a = +a;
|
10334 | b = +b;
|
10335 | }
|
10336 | return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
10337 | }
|
10338 | exports2.rcompareIdentifiers = rcompareIdentifiers;
|
10339 | function rcompareIdentifiers(a, b) {
|
10340 | return compareIdentifiers(b, a);
|
10341 | }
|
10342 | exports2.major = major;
|
10343 | function major(a, loose) {
|
10344 | return new SemVer(a, loose).major;
|
10345 | }
|
10346 | exports2.minor = minor;
|
10347 | function minor(a, loose) {
|
10348 | return new SemVer(a, loose).minor;
|
10349 | }
|
10350 | exports2.patch = patch;
|
10351 | function patch(a, loose) {
|
10352 | return new SemVer(a, loose).patch;
|
10353 | }
|
10354 | exports2.compare = compare;
|
10355 | function compare(a, b, loose) {
|
10356 | return new SemVer(a, loose).compare(new SemVer(b, loose));
|
10357 | }
|
10358 | exports2.compareLoose = compareLoose;
|
10359 | function compareLoose(a, b) {
|
10360 | return compare(a, b, true);
|
10361 | }
|
10362 | exports2.compareBuild = compareBuild;
|
10363 | function compareBuild(a, b, loose) {
|
10364 | var versionA = new SemVer(a, loose);
|
10365 | var versionB = new SemVer(b, loose);
|
10366 | return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
10367 | }
|
10368 | exports2.rcompare = rcompare;
|
10369 | function rcompare(a, b, loose) {
|
10370 | return compare(b, a, loose);
|
10371 | }
|
10372 | exports2.sort = sort;
|
10373 | function sort(list, loose) {
|
10374 | return list.sort(function(a, b) {
|
10375 | return exports2.compareBuild(a, b, loose);
|
10376 | });
|
10377 | }
|
10378 | exports2.rsort = rsort;
|
10379 | function rsort(list, loose) {
|
10380 | return list.sort(function(a, b) {
|
10381 | return exports2.compareBuild(b, a, loose);
|
10382 | });
|
10383 | }
|
10384 | exports2.gt = gt;
|
10385 | function gt(a, b, loose) {
|
10386 | return compare(a, b, loose) > 0;
|
10387 | }
|
10388 | exports2.lt = lt;
|
10389 | function lt(a, b, loose) {
|
10390 | return compare(a, b, loose) < 0;
|
10391 | }
|
10392 | exports2.eq = eq;
|
10393 | function eq(a, b, loose) {
|
10394 | return compare(a, b, loose) === 0;
|
10395 | }
|
10396 | exports2.neq = neq;
|
10397 | function neq(a, b, loose) {
|
10398 | return compare(a, b, loose) !== 0;
|
10399 | }
|
10400 | exports2.gte = gte;
|
10401 | function gte(a, b, loose) {
|
10402 | return compare(a, b, loose) >= 0;
|
10403 | }
|
10404 | exports2.lte = lte;
|
10405 | function lte(a, b, loose) {
|
10406 | return compare(a, b, loose) <= 0;
|
10407 | }
|
10408 | exports2.cmp = cmp;
|
10409 | function cmp(a, op, b, loose) {
|
10410 | switch (op) {
|
10411 | case "===":
|
10412 | if (typeof a === "object")
|
10413 | a = a.version;
|
10414 | if (typeof b === "object")
|
10415 | b = b.version;
|
10416 | return a === b;
|
10417 | case "!==":
|
10418 | if (typeof a === "object")
|
10419 | a = a.version;
|
10420 | if (typeof b === "object")
|
10421 | b = b.version;
|
10422 | return a !== b;
|
10423 | case "":
|
10424 | case "=":
|
10425 | case "==":
|
10426 | return eq(a, b, loose);
|
10427 | case "!=":
|
10428 | return neq(a, b, loose);
|
10429 | case ">":
|
10430 | return gt(a, b, loose);
|
10431 | case ">=":
|
10432 | return gte(a, b, loose);
|
10433 | case "<":
|
10434 | return lt(a, b, loose);
|
10435 | case "<=":
|
10436 | return lte(a, b, loose);
|
10437 | default:
|
10438 | throw new TypeError("Invalid operator: " + op);
|
10439 | }
|
10440 | }
|
10441 | exports2.Comparator = Comparator;
|
10442 | function Comparator(comp, options) {
|
10443 | if (!options || typeof options !== "object") {
|
10444 | options = {
|
10445 | loose: !!options,
|
10446 | includePrerelease: false
|
10447 | };
|
10448 | }
|
10449 | if (comp instanceof Comparator) {
|
10450 | if (comp.loose === !!options.loose) {
|
10451 | return comp;
|
10452 | } else {
|
10453 | comp = comp.value;
|
10454 | }
|
10455 | }
|
10456 | if (!(this instanceof Comparator)) {
|
10457 | return new Comparator(comp, options);
|
10458 | }
|
10459 | debug("comparator", comp, options);
|
10460 | this.options = options;
|
10461 | this.loose = !!options.loose;
|
10462 | this.parse(comp);
|
10463 | if (this.semver === ANY) {
|
10464 | this.value = "";
|
10465 | } else {
|
10466 | this.value = this.operator + this.semver.version;
|
10467 | }
|
10468 | debug("comp", this);
|
10469 | }
|
10470 | var ANY = {};
|
10471 | Comparator.prototype.parse = function(comp) {
|
10472 | var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
10473 | var m = comp.match(r);
|
10474 | if (!m) {
|
10475 | throw new TypeError("Invalid comparator: " + comp);
|
10476 | }
|
10477 | this.operator = m[1] !== void 0 ? m[1] : "";
|
10478 | if (this.operator === "=") {
|
10479 | this.operator = "";
|
10480 | }
|
10481 | if (!m[2]) {
|
10482 | this.semver = ANY;
|
10483 | } else {
|
10484 | this.semver = new SemVer(m[2], this.options.loose);
|
10485 | }
|
10486 | };
|
10487 | Comparator.prototype.toString = function() {
|
10488 | return this.value;
|
10489 | };
|
10490 | Comparator.prototype.test = function(version) {
|
10491 | debug("Comparator.test", version, this.options.loose);
|
10492 | if (this.semver === ANY || version === ANY) {
|
10493 | return true;
|
10494 | }
|
10495 | if (typeof version === "string") {
|
10496 | try {
|
10497 | version = new SemVer(version, this.options);
|
10498 | } catch (er) {
|
10499 | return false;
|
10500 | }
|
10501 | }
|
10502 | return cmp(version, this.operator, this.semver, this.options);
|
10503 | };
|
10504 | Comparator.prototype.intersects = function(comp, options) {
|
10505 | if (!(comp instanceof Comparator)) {
|
10506 | throw new TypeError("a Comparator is required");
|
10507 | }
|
10508 | if (!options || typeof options !== "object") {
|
10509 | options = {
|
10510 | loose: !!options,
|
10511 | includePrerelease: false
|
10512 | };
|
10513 | }
|
10514 | var rangeTmp;
|
10515 | if (this.operator === "") {
|
10516 | if (this.value === "") {
|
10517 | return true;
|
10518 | }
|
10519 | rangeTmp = new Range(comp.value, options);
|
10520 | return satisfies(this.value, rangeTmp, options);
|
10521 | } else if (comp.operator === "") {
|
10522 | if (comp.value === "") {
|
10523 | return true;
|
10524 | }
|
10525 | rangeTmp = new Range(this.value, options);
|
10526 | return satisfies(comp.semver, rangeTmp, options);
|
10527 | }
|
10528 | var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
|
10529 | var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
|
10530 | var sameSemVer = this.semver.version === comp.semver.version;
|
10531 | var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
|
10532 | var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
|
10533 | var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
|
10534 | return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
|
10535 | };
|
10536 | exports2.Range = Range;
|
10537 | function Range(range, options) {
|
10538 | if (!options || typeof options !== "object") {
|
10539 | options = {
|
10540 | loose: !!options,
|
10541 | includePrerelease: false
|
10542 | };
|
10543 | }
|
10544 | if (range instanceof Range) {
|
10545 | if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
10546 | return range;
|
10547 | } else {
|
10548 | return new Range(range.raw, options);
|
10549 | }
|
10550 | }
|
10551 | if (range instanceof Comparator) {
|
10552 | return new Range(range.value, options);
|
10553 | }
|
10554 | if (!(this instanceof Range)) {
|
10555 | return new Range(range, options);
|
10556 | }
|
10557 | this.options = options;
|
10558 | this.loose = !!options.loose;
|
10559 | this.includePrerelease = !!options.includePrerelease;
|
10560 | this.raw = range;
|
10561 | this.set = range.split(/\s*\|\|\s*/).map(function(range2) {
|
10562 | return this.parseRange(range2.trim());
|
10563 | }, this).filter(function(c) {
|
10564 | return c.length;
|
10565 | });
|
10566 | if (!this.set.length) {
|
10567 | throw new TypeError("Invalid SemVer Range: " + range);
|
10568 | }
|
10569 | this.format();
|
10570 | }
|
10571 | Range.prototype.format = function() {
|
10572 | this.range = this.set.map(function(comps) {
|
10573 | return comps.join(" ").trim();
|
10574 | }).join("||").trim();
|
10575 | return this.range;
|
10576 | };
|
10577 | Range.prototype.toString = function() {
|
10578 | return this.range;
|
10579 | };
|
10580 | Range.prototype.parseRange = function(range) {
|
10581 | var loose = this.options.loose;
|
10582 | range = range.trim();
|
10583 | var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
10584 | range = range.replace(hr, hyphenReplace);
|
10585 | debug("hyphen replace", range);
|
10586 | range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
10587 | debug("comparator trim", range, re[t.COMPARATORTRIM]);
|
10588 | range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
10589 | range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
10590 | range = range.split(/\s+/).join(" ");
|
10591 | var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
10592 | var set = range.split(" ").map(function(comp) {
|
10593 | return parseComparator(comp, this.options);
|
10594 | }, this).join(" ").split(/\s+/);
|
10595 | if (this.options.loose) {
|
10596 | set = set.filter(function(comp) {
|
10597 | return !!comp.match(compRe);
|
10598 | });
|
10599 | }
|
10600 | set = set.map(function(comp) {
|
10601 | return new Comparator(comp, this.options);
|
10602 | }, this);
|
10603 | return set;
|
10604 | };
|
10605 | Range.prototype.intersects = function(range, options) {
|
10606 | if (!(range instanceof Range)) {
|
10607 | throw new TypeError("a Range is required");
|
10608 | }
|
10609 | return this.set.some(function(thisComparators) {
|
10610 | return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
|
10611 | return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
|
10612 | return rangeComparators.every(function(rangeComparator) {
|
10613 | return thisComparator.intersects(rangeComparator, options);
|
10614 | });
|
10615 | });
|
10616 | });
|
10617 | });
|
10618 | };
|
10619 | function isSatisfiable(comparators, options) {
|
10620 | var result = true;
|
10621 | var remainingComparators = comparators.slice();
|
10622 | var testComparator = remainingComparators.pop();
|
10623 | while (result && remainingComparators.length) {
|
10624 | result = remainingComparators.every(function(otherComparator) {
|
10625 | return testComparator.intersects(otherComparator, options);
|
10626 | });
|
10627 | testComparator = remainingComparators.pop();
|
10628 | }
|
10629 | return result;
|
10630 | }
|
10631 | exports2.toComparators = toComparators;
|
10632 | function toComparators(range, options) {
|
10633 | return new Range(range, options).set.map(function(comp) {
|
10634 | return comp.map(function(c) {
|
10635 | return c.value;
|
10636 | }).join(" ").trim().split(" ");
|
10637 | });
|
10638 | }
|
10639 | function parseComparator(comp, options) {
|
10640 | debug("comp", comp, options);
|
10641 | comp = replaceCarets(comp, options);
|
10642 | debug("caret", comp);
|
10643 | comp = replaceTildes(comp, options);
|
10644 | debug("tildes", comp);
|
10645 | comp = replaceXRanges(comp, options);
|
10646 | debug("xrange", comp);
|
10647 | comp = replaceStars(comp, options);
|
10648 | debug("stars", comp);
|
10649 | return comp;
|
10650 | }
|
10651 | function isX(id) {
|
10652 | return !id || id.toLowerCase() === "x" || id === "*";
|
10653 | }
|
10654 | function replaceTildes(comp, options) {
|
10655 | return comp.trim().split(/\s+/).map(function(comp2) {
|
10656 | return replaceTilde(comp2, options);
|
10657 | }).join(" ");
|
10658 | }
|
10659 | function replaceTilde(comp, options) {
|
10660 | var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
10661 | return comp.replace(r, function(_, M, m, p, pr) {
|
10662 | debug("tilde", comp, _, M, m, p, pr);
|
10663 | var ret;
|
10664 | if (isX(M)) {
|
10665 | ret = "";
|
10666 | } else if (isX(m)) {
|
10667 | ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
|
10668 | } else if (isX(p)) {
|
10669 | ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
|
10670 | } else if (pr) {
|
10671 | debug("replaceTilde pr", pr);
|
10672 | ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
|
10673 | } else {
|
10674 | ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
|
10675 | }
|
10676 | debug("tilde return", ret);
|
10677 | return ret;
|
10678 | });
|
10679 | }
|
10680 | function replaceCarets(comp, options) {
|
10681 | return comp.trim().split(/\s+/).map(function(comp2) {
|
10682 | return replaceCaret(comp2, options);
|
10683 | }).join(" ");
|
10684 | }
|
10685 | function replaceCaret(comp, options) {
|
10686 | debug("caret", comp, options);
|
10687 | var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
10688 | return comp.replace(r, function(_, M, m, p, pr) {
|
10689 | debug("caret", comp, _, M, m, p, pr);
|
10690 | var ret;
|
10691 | if (isX(M)) {
|
10692 | ret = "";
|
10693 | } else if (isX(m)) {
|
10694 | ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
|
10695 | } else if (isX(p)) {
|
10696 | if (M === "0") {
|
10697 | ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
|
10698 | } else {
|
10699 | ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
|
10700 | }
|
10701 | } else if (pr) {
|
10702 | debug("replaceCaret pr", pr);
|
10703 | if (M === "0") {
|
10704 | if (m === "0") {
|
10705 | ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
|
10706 | } else {
|
10707 | ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
|
10708 | }
|
10709 | } else {
|
10710 | ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
|
10711 | }
|
10712 | } else {
|
10713 | debug("no pr");
|
10714 | if (M === "0") {
|
10715 | if (m === "0") {
|
10716 | ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
|
10717 | } else {
|
10718 | ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
|
10719 | }
|
10720 | } else {
|
10721 | ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
|
10722 | }
|
10723 | }
|
10724 | debug("caret return", ret);
|
10725 | return ret;
|
10726 | });
|
10727 | }
|
10728 | function replaceXRanges(comp, options) {
|
10729 | debug("replaceXRanges", comp, options);
|
10730 | return comp.split(/\s+/).map(function(comp2) {
|
10731 | return replaceXRange(comp2, options);
|
10732 | }).join(" ");
|
10733 | }
|
10734 | function replaceXRange(comp, options) {
|
10735 | comp = comp.trim();
|
10736 | var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
10737 | return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
|
10738 | debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
10739 | var xM = isX(M);
|
10740 | var xm = xM || isX(m);
|
10741 | var xp = xm || isX(p);
|
10742 | var anyX = xp;
|
10743 | if (gtlt === "=" && anyX) {
|
10744 | gtlt = "";
|
10745 | }
|
10746 | pr = options.includePrerelease ? "-0" : "";
|
10747 | if (xM) {
|
10748 | if (gtlt === ">" || gtlt === "<") {
|
10749 | ret = "<0.0.0-0";
|
10750 | } else {
|
10751 | ret = "*";
|
10752 | }
|
10753 | } else if (gtlt && anyX) {
|
10754 | if (xm) {
|
10755 | m = 0;
|
10756 | }
|
10757 | p = 0;
|
10758 | if (gtlt === ">") {
|
10759 | gtlt = ">=";
|
10760 | if (xm) {
|
10761 | M = +M + 1;
|
10762 | m = 0;
|
10763 | p = 0;
|
10764 | } else {
|
10765 | m = +m + 1;
|
10766 | p = 0;
|
10767 | }
|
10768 | } else if (gtlt === "<=") {
|
10769 | gtlt = "<";
|
10770 | if (xm) {
|
10771 | M = +M + 1;
|
10772 | } else {
|
10773 | m = +m + 1;
|
10774 | }
|
10775 | }
|
10776 | ret = gtlt + M + "." + m + "." + p + pr;
|
10777 | } else if (xm) {
|
10778 | ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
|
10779 | } else if (xp) {
|
10780 | ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
|
10781 | }
|
10782 | debug("xRange return", ret);
|
10783 | return ret;
|
10784 | });
|
10785 | }
|
10786 | function replaceStars(comp, options) {
|
10787 | debug("replaceStars", comp, options);
|
10788 | return comp.trim().replace(re[t.STAR], "");
|
10789 | }
|
10790 | function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
|
10791 | if (isX(fM)) {
|
10792 | from = "";
|
10793 | } else if (isX(fm)) {
|
10794 | from = ">=" + fM + ".0.0";
|
10795 | } else if (isX(fp)) {
|
10796 | from = ">=" + fM + "." + fm + ".0";
|
10797 | } else {
|
10798 | from = ">=" + from;
|
10799 | }
|
10800 | if (isX(tM)) {
|
10801 | to = "";
|
10802 | } else if (isX(tm)) {
|
10803 | to = "<" + (+tM + 1) + ".0.0";
|
10804 | } else if (isX(tp)) {
|
10805 | to = "<" + tM + "." + (+tm + 1) + ".0";
|
10806 | } else if (tpr) {
|
10807 | to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
|
10808 | } else {
|
10809 | to = "<=" + to;
|
10810 | }
|
10811 | return (from + " " + to).trim();
|
10812 | }
|
10813 | Range.prototype.test = function(version) {
|
10814 | if (!version) {
|
10815 | return false;
|
10816 | }
|
10817 | if (typeof version === "string") {
|
10818 | try {
|
10819 | version = new SemVer(version, this.options);
|
10820 | } catch (er) {
|
10821 | return false;
|
10822 | }
|
10823 | }
|
10824 | for (var i2 = 0; i2 < this.set.length; i2++) {
|
10825 | if (testSet(this.set[i2], version, this.options)) {
|
10826 | return true;
|
10827 | }
|
10828 | }
|
10829 | return false;
|
10830 | };
|
10831 | function testSet(set, version, options) {
|
10832 | for (var i2 = 0; i2 < set.length; i2++) {
|
10833 | if (!set[i2].test(version)) {
|
10834 | return false;
|
10835 | }
|
10836 | }
|
10837 | if (version.prerelease.length && !options.includePrerelease) {
|
10838 | for (i2 = 0; i2 < set.length; i2++) {
|
10839 | debug(set[i2].semver);
|
10840 | if (set[i2].semver === ANY) {
|
10841 | continue;
|
10842 | }
|
10843 | if (set[i2].semver.prerelease.length > 0) {
|
10844 | var allowed = set[i2].semver;
|
10845 | if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
10846 | return true;
|
10847 | }
|
10848 | }
|
10849 | }
|
10850 | return false;
|
10851 | }
|
10852 | return true;
|
10853 | }
|
10854 | exports2.satisfies = satisfies;
|
10855 | function satisfies(version, range, options) {
|
10856 | try {
|
10857 | range = new Range(range, options);
|
10858 | } catch (er) {
|
10859 | return false;
|
10860 | }
|
10861 | return range.test(version);
|
10862 | }
|
10863 | exports2.maxSatisfying = maxSatisfying;
|
10864 | function maxSatisfying(versions, range, options) {
|
10865 | var max = null;
|
10866 | var maxSV = null;
|
10867 | try {
|
10868 | var rangeObj = new Range(range, options);
|
10869 | } catch (er) {
|
10870 | return null;
|
10871 | }
|
10872 | versions.forEach(function(v) {
|
10873 | if (rangeObj.test(v)) {
|
10874 | if (!max || maxSV.compare(v) === -1) {
|
10875 | max = v;
|
10876 | maxSV = new SemVer(max, options);
|
10877 | }
|
10878 | }
|
10879 | });
|
10880 | return max;
|
10881 | }
|
10882 | exports2.minSatisfying = minSatisfying;
|
10883 | function minSatisfying(versions, range, options) {
|
10884 | var min = null;
|
10885 | var minSV = null;
|
10886 | try {
|
10887 | var rangeObj = new Range(range, options);
|
10888 | } catch (er) {
|
10889 | return null;
|
10890 | }
|
10891 | versions.forEach(function(v) {
|
10892 | if (rangeObj.test(v)) {
|
10893 | if (!min || minSV.compare(v) === 1) {
|
10894 | min = v;
|
10895 | minSV = new SemVer(min, options);
|
10896 | }
|
10897 | }
|
10898 | });
|
10899 | return min;
|
10900 | }
|
10901 | exports2.minVersion = minVersion;
|
10902 | function minVersion(range, loose) {
|
10903 | range = new Range(range, loose);
|
10904 | var minver = new SemVer("0.0.0");
|
10905 | if (range.test(minver)) {
|
10906 | return minver;
|
10907 | }
|
10908 | minver = new SemVer("0.0.0-0");
|
10909 | if (range.test(minver)) {
|
10910 | return minver;
|
10911 | }
|
10912 | minver = null;
|
10913 | for (var i2 = 0; i2 < range.set.length; ++i2) {
|
10914 | var comparators = range.set[i2];
|
10915 | comparators.forEach(function(comparator) {
|
10916 | var compver = new SemVer(comparator.semver.version);
|
10917 | switch (comparator.operator) {
|
10918 | case ">":
|
10919 | if (compver.prerelease.length === 0) {
|
10920 | compver.patch++;
|
10921 | } else {
|
10922 | compver.prerelease.push(0);
|
10923 | }
|
10924 | compver.raw = compver.format();
|
10925 | case "":
|
10926 | case ">=":
|
10927 | if (!minver || gt(minver, compver)) {
|
10928 | minver = compver;
|
10929 | }
|
10930 | break;
|
10931 | case "<":
|
10932 | case "<=":
|
10933 | break;
|
10934 | default:
|
10935 | throw new Error("Unexpected operation: " + comparator.operator);
|
10936 | }
|
10937 | });
|
10938 | }
|
10939 | if (minver && range.test(minver)) {
|
10940 | return minver;
|
10941 | }
|
10942 | return null;
|
10943 | }
|
10944 | exports2.validRange = validRange;
|
10945 | function validRange(range, options) {
|
10946 | try {
|
10947 | return new Range(range, options).range || "*";
|
10948 | } catch (er) {
|
10949 | return null;
|
10950 | }
|
10951 | }
|
10952 | exports2.ltr = ltr;
|
10953 | function ltr(version, range, options) {
|
10954 | return outside(version, range, "<", options);
|
10955 | }
|
10956 | exports2.gtr = gtr;
|
10957 | function gtr(version, range, options) {
|
10958 | return outside(version, range, ">", options);
|
10959 | }
|
10960 | exports2.outside = outside;
|
10961 | function outside(version, range, hilo, options) {
|
10962 | version = new SemVer(version, options);
|
10963 | range = new Range(range, options);
|
10964 | var gtfn, ltefn, ltfn, comp, ecomp;
|
10965 | switch (hilo) {
|
10966 | case ">":
|
10967 | gtfn = gt;
|
10968 | ltefn = lte;
|
10969 | ltfn = lt;
|
10970 | comp = ">";
|
10971 | ecomp = ">=";
|
10972 | break;
|
10973 | case "<":
|
10974 | gtfn = lt;
|
10975 | ltefn = gte;
|
10976 | ltfn = gt;
|
10977 | comp = "<";
|
10978 | ecomp = "<=";
|
10979 | break;
|
10980 | default:
|
10981 | throw new TypeError('Must provide a hilo val of "<" or ">"');
|
10982 | }
|
10983 | if (satisfies(version, range, options)) {
|
10984 | return false;
|
10985 | }
|
10986 | for (var i2 = 0; i2 < range.set.length; ++i2) {
|
10987 | var comparators = range.set[i2];
|
10988 | var high = null;
|
10989 | var low = null;
|
10990 | comparators.forEach(function(comparator) {
|
10991 | if (comparator.semver === ANY) {
|
10992 | comparator = new Comparator(">=0.0.0");
|
10993 | }
|
10994 | high = high || comparator;
|
10995 | low = low || comparator;
|
10996 | if (gtfn(comparator.semver, high.semver, options)) {
|
10997 | high = comparator;
|
10998 | } else if (ltfn(comparator.semver, low.semver, options)) {
|
10999 | low = comparator;
|
11000 | }
|
11001 | });
|
11002 | if (high.operator === comp || high.operator === ecomp) {
|
11003 | return false;
|
11004 | }
|
11005 | if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
11006 | return false;
|
11007 | } else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
11008 | return false;
|
11009 | }
|
11010 | }
|
11011 | return true;
|
11012 | }
|
11013 | exports2.prerelease = prerelease;
|
11014 | function prerelease(version, options) {
|
11015 | var parsed = parse(version, options);
|
11016 | return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
11017 | }
|
11018 | exports2.intersects = intersects;
|
11019 | function intersects(r1, r2, options) {
|
11020 | r1 = new Range(r1, options);
|
11021 | r2 = new Range(r2, options);
|
11022 | return r1.intersects(r2);
|
11023 | }
|
11024 | exports2.coerce = coerce;
|
11025 | function coerce(version, options) {
|
11026 | if (version instanceof SemVer) {
|
11027 | return version;
|
11028 | }
|
11029 | if (typeof version === "number") {
|
11030 | version = String(version);
|
11031 | }
|
11032 | if (typeof version !== "string") {
|
11033 | return null;
|
11034 | }
|
11035 | options = options || {};
|
11036 | var match = null;
|
11037 | if (!options.rtl) {
|
11038 | match = version.match(re[t.COERCE]);
|
11039 | } else {
|
11040 | var next;
|
11041 | while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
11042 | if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
11043 | match = next;
|
11044 | }
|
11045 | re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
|
11046 | }
|
11047 | re[t.COERCERTL].lastIndex = -1;
|
11048 | }
|
11049 | if (match === null) {
|
11050 | return null;
|
11051 | }
|
11052 | return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
|
11053 | }
|
11054 | }
|
11055 | });
|
11056 | var require_make_dir = __commonJS2({
|
11057 | "node_modules/make-dir/index.js"(exports2, module2) {
|
11058 | "use strict";
|
11059 | var fs = require("fs");
|
11060 | var path = require("path");
|
11061 | var {
|
11062 | promisify
|
11063 | } = require("util");
|
11064 | var semver = require_semver();
|
11065 | var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0");
|
11066 | var checkPath = (pth) => {
|
11067 | if (process.platform === "win32") {
|
11068 | const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
|
11069 | if (pathHasInvalidWinCharacters) {
|
11070 | const error = new Error(`Path contains invalid characters: ${pth}`);
|
11071 | error.code = "EINVAL";
|
11072 | throw error;
|
11073 | }
|
11074 | }
|
11075 | };
|
11076 | var processOptions = (options) => {
|
11077 | const defaults = {
|
11078 | mode: 511,
|
11079 | fs
|
11080 | };
|
11081 | return Object.assign(Object.assign({}, defaults), options);
|
11082 | };
|
11083 | var permissionError = (pth) => {
|
11084 | const error = new Error(`operation not permitted, mkdir '${pth}'`);
|
11085 | error.code = "EPERM";
|
11086 | error.errno = -4048;
|
11087 | error.path = pth;
|
11088 | error.syscall = "mkdir";
|
11089 | return error;
|
11090 | };
|
11091 | var makeDir = async (input, options) => {
|
11092 | checkPath(input);
|
11093 | options = processOptions(options);
|
11094 | const mkdir = promisify(options.fs.mkdir);
|
11095 | const stat = promisify(options.fs.stat);
|
11096 | if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
|
11097 | const pth = path.resolve(input);
|
11098 | await mkdir(pth, {
|
11099 | mode: options.mode,
|
11100 | recursive: true
|
11101 | });
|
11102 | return pth;
|
11103 | }
|
11104 | const make = async (pth) => {
|
11105 | try {
|
11106 | await mkdir(pth, options.mode);
|
11107 | return pth;
|
11108 | } catch (error) {
|
11109 | if (error.code === "EPERM") {
|
11110 | throw error;
|
11111 | }
|
11112 | if (error.code === "ENOENT") {
|
11113 | if (path.dirname(pth) === pth) {
|
11114 | throw permissionError(pth);
|
11115 | }
|
11116 | if (error.message.includes("null bytes")) {
|
11117 | throw error;
|
11118 | }
|
11119 | await make(path.dirname(pth));
|
11120 | return make(pth);
|
11121 | }
|
11122 | try {
|
11123 | const stats = await stat(pth);
|
11124 | if (!stats.isDirectory()) {
|
11125 | throw new Error("The path is not a directory");
|
11126 | }
|
11127 | } catch (_) {
|
11128 | throw error;
|
11129 | }
|
11130 | return pth;
|
11131 | }
|
11132 | };
|
11133 | return make(path.resolve(input));
|
11134 | };
|
11135 | module2.exports = makeDir;
|
11136 | module2.exports.sync = (input, options) => {
|
11137 | checkPath(input);
|
11138 | options = processOptions(options);
|
11139 | if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
|
11140 | const pth = path.resolve(input);
|
11141 | fs.mkdirSync(pth, {
|
11142 | mode: options.mode,
|
11143 | recursive: true
|
11144 | });
|
11145 | return pth;
|
11146 | }
|
11147 | const make = (pth) => {
|
11148 | try {
|
11149 | options.fs.mkdirSync(pth, options.mode);
|
11150 | } catch (error) {
|
11151 | if (error.code === "EPERM") {
|
11152 | throw error;
|
11153 | }
|
11154 | if (error.code === "ENOENT") {
|
11155 | if (path.dirname(pth) === pth) {
|
11156 | throw permissionError(pth);
|
11157 | }
|
11158 | if (error.message.includes("null bytes")) {
|
11159 | throw error;
|
11160 | }
|
11161 | make(path.dirname(pth));
|
11162 | return make(pth);
|
11163 | }
|
11164 | try {
|
11165 | if (!options.fs.statSync(pth).isDirectory()) {
|
11166 | throw new Error("The path is not a directory");
|
11167 | }
|
11168 | } catch (_) {
|
11169 | throw error;
|
11170 | }
|
11171 | }
|
11172 | return pth;
|
11173 | };
|
11174 | return make(path.resolve(input));
|
11175 | };
|
11176 | }
|
11177 | });
|
11178 | var require_find_cache_dir = __commonJS2({
|
11179 | "node_modules/find-cache-dir/index.js"(exports2, module2) {
|
11180 | "use strict";
|
11181 | var path = require("path");
|
11182 | var fs = require("fs");
|
11183 | var commonDir = require_commondir();
|
11184 | var pkgDir = require_pkg_dir();
|
11185 | var makeDir = require_make_dir();
|
11186 | var {
|
11187 | env: env2,
|
11188 | cwd
|
11189 | } = process;
|
11190 | var isWritable = (path2) => {
|
11191 | try {
|
11192 | fs.accessSync(path2, fs.constants.W_OK);
|
11193 | return true;
|
11194 | } catch (_) {
|
11195 | return false;
|
11196 | }
|
11197 | };
|
11198 | function useDirectory(directory, options) {
|
11199 | if (options.create) {
|
11200 | makeDir.sync(directory);
|
11201 | }
|
11202 | if (options.thunk) {
|
11203 | return (...arguments_) => path.join(directory, ...arguments_);
|
11204 | }
|
11205 | return directory;
|
11206 | }
|
11207 | function getNodeModuleDirectory(directory) {
|
11208 | const nodeModules = path.join(directory, "node_modules");
|
11209 | if (!isWritable(nodeModules) && (fs.existsSync(nodeModules) || !isWritable(path.join(directory)))) {
|
11210 | return;
|
11211 | }
|
11212 | return nodeModules;
|
11213 | }
|
11214 | module2.exports = (options = {}) => {
|
11215 | if (env2.CACHE_DIR && !["true", "false", "1", "0"].includes(env2.CACHE_DIR)) {
|
11216 | return useDirectory(path.join(env2.CACHE_DIR, options.name), options);
|
11217 | }
|
11218 | let {
|
11219 | cwd: directory = cwd()
|
11220 | } = options;
|
11221 | if (options.files) {
|
11222 | directory = commonDir(directory, options.files);
|
11223 | }
|
11224 | directory = pkgDir.sync(directory);
|
11225 | if (!directory) {
|
11226 | return;
|
11227 | }
|
11228 | const nodeModules = getNodeModuleDirectory(directory);
|
11229 | if (!nodeModules) {
|
11230 | return void 0;
|
11231 | }
|
11232 | return useDirectory(path.join(directory, "node_modules", ".cache", options.name), options);
|
11233 | };
|
11234 | }
|
11235 | });
|
11236 | var require_find_cache_file = __commonJS2({
|
11237 | "src/cli/find-cache-file.js"(exports2, module2) {
|
11238 | "use strict";
|
11239 | var fs = require("fs").promises;
|
11240 | var os2 = require("os");
|
11241 | var path = require("path");
|
11242 | var findCacheDir = require_find_cache_dir();
|
11243 | var {
|
11244 | statSafe,
|
11245 | isJson
|
11246 | } = require_utils();
|
11247 | function findDefaultCacheFile() {
|
11248 | const cacheDir = findCacheDir({
|
11249 | name: "prettier",
|
11250 | create: true
|
11251 | }) || os2.tmpdir();
|
11252 | const cacheFilePath = path.join(cacheDir, ".prettier-cache");
|
11253 | return cacheFilePath;
|
11254 | }
|
11255 | async function findCacheFileFromOption(cacheLocation) {
|
11256 | const cacheFile = path.resolve(cacheLocation);
|
11257 | const stat = await statSafe(cacheFile);
|
11258 | if (stat) {
|
11259 | if (stat.isDirectory()) {
|
11260 | throw new Error(`Resolved --cache-location '${cacheFile}' is a directory`);
|
11261 | }
|
11262 | const data = await fs.readFile(cacheFile, "utf8");
|
11263 | if (!isJson(data)) {
|
11264 | throw new Error(`'${cacheFile}' isn't a valid JSON file`);
|
11265 | }
|
11266 | }
|
11267 | return cacheFile;
|
11268 | }
|
11269 | async function findCacheFile(cacheLocation) {
|
11270 | if (!cacheLocation) {
|
11271 | return findDefaultCacheFile();
|
11272 | }
|
11273 | const cacheFile = await findCacheFileFromOption(cacheLocation);
|
11274 | return cacheFile;
|
11275 | }
|
11276 | module2.exports = findCacheFile;
|
11277 | }
|
11278 | });
|
11279 | var require_cjs = __commonJS2({
|
11280 | "node_modules/flatted/cjs/index.js"(exports2) {
|
11281 | "use strict";
|
11282 | var {
|
11283 | parse: $parse,
|
11284 | stringify: $stringify
|
11285 | } = JSON;
|
11286 | var {
|
11287 | keys
|
11288 | } = Object;
|
11289 | var Primitive = String;
|
11290 | var primitive = "string";
|
11291 | var ignore = {};
|
11292 | var object = "object";
|
11293 | var noop = (_, value) => value;
|
11294 | var primitives = (value) => value instanceof Primitive ? Primitive(value) : value;
|
11295 | var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value;
|
11296 | var revive = (input, parsed, output, $) => {
|
11297 | const lazy = [];
|
11298 | for (let ke = keys(output), {
|
11299 | length
|
11300 | } = ke, y = 0; y < length; y++) {
|
11301 | const k = ke[y];
|
11302 | const value = output[k];
|
11303 | if (value instanceof Primitive) {
|
11304 | const tmp = input[value];
|
11305 | if (typeof tmp === object && !parsed.has(tmp)) {
|
11306 | parsed.add(tmp);
|
11307 | output[k] = ignore;
|
11308 | lazy.push({
|
11309 | k,
|
11310 | a: [input, parsed, tmp, $]
|
11311 | });
|
11312 | } else
|
11313 | output[k] = $.call(output, k, tmp);
|
11314 | } else if (output[k] !== ignore)
|
11315 | output[k] = $.call(output, k, value);
|
11316 | }
|
11317 | for (let {
|
11318 | length
|
11319 | } = lazy, i = 0; i < length; i++) {
|
11320 | const {
|
11321 | k,
|
11322 | a
|
11323 | } = lazy[i];
|
11324 | output[k] = $.call(output, k, revive.apply(null, a));
|
11325 | }
|
11326 | return output;
|
11327 | };
|
11328 | var set = (known, input, value) => {
|
11329 | const index = Primitive(input.push(value) - 1);
|
11330 | known.set(value, index);
|
11331 | return index;
|
11332 | };
|
11333 | var parse = (text, reviver) => {
|
11334 | const input = $parse(text, Primitives).map(primitives);
|
11335 | const value = input[0];
|
11336 | const $ = reviver || noop;
|
11337 | const tmp = typeof value === object && value ? revive(input, new Set(), value, $) : value;
|
11338 | return $.call({
|
11339 | "": tmp
|
11340 | }, "", tmp);
|
11341 | };
|
11342 | exports2.parse = parse;
|
11343 | var stringify2 = (value, replacer, space) => {
|
11344 | const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop;
|
11345 | const known = new Map();
|
11346 | const input = [];
|
11347 | const output = [];
|
11348 | let i = +set(known, input, $.call({
|
11349 | "": value
|
11350 | }, "", value));
|
11351 | let firstRun = !i;
|
11352 | while (i < input.length) {
|
11353 | firstRun = true;
|
11354 | output[i] = $stringify(input[i++], replace, space);
|
11355 | }
|
11356 | return "[" + output.join(",") + "]";
|
11357 | function replace(key, value2) {
|
11358 | if (firstRun) {
|
11359 | firstRun = !firstRun;
|
11360 | return value2;
|
11361 | }
|
11362 | const after = $.call(this, key, value2);
|
11363 | switch (typeof after) {
|
11364 | case object:
|
11365 | if (after === null)
|
11366 | return after;
|
11367 | case primitive:
|
11368 | return known.get(after) || set(known, input, after);
|
11369 | }
|
11370 | return after;
|
11371 | }
|
11372 | };
|
11373 | exports2.stringify = stringify2;
|
11374 | var toJSON = (any) => $parse(stringify2(any));
|
11375 | exports2.toJSON = toJSON;
|
11376 | var fromJSON = (any) => parse($stringify(any));
|
11377 | exports2.fromJSON = fromJSON;
|
11378 | }
|
11379 | });
|
11380 | var require_utils6 = __commonJS2({
|
11381 | "node_modules/flat-cache/src/utils.js"(exports2, module2) {
|
11382 | var fs = require("fs");
|
11383 | var path = require("path");
|
11384 | var flatted = require_cjs();
|
11385 | module2.exports = {
|
11386 | tryParse: function(filePath, defaultValue) {
|
11387 | var result;
|
11388 | try {
|
11389 | result = this.readJSON(filePath);
|
11390 | } catch (ex) {
|
11391 | result = defaultValue;
|
11392 | }
|
11393 | return result;
|
11394 | },
|
11395 | readJSON: function(filePath) {
|
11396 | return flatted.parse(fs.readFileSync(filePath, {
|
11397 | encoding: "utf8"
|
11398 | }));
|
11399 | },
|
11400 | writeJSON: function(filePath, data) {
|
11401 | fs.mkdirSync(path.dirname(filePath), {
|
11402 | recursive: true
|
11403 | });
|
11404 | fs.writeFileSync(filePath, flatted.stringify(data));
|
11405 | }
|
11406 | };
|
11407 | }
|
11408 | });
|
11409 | var require_old = __commonJS2({
|
11410 | "node_modules/fs.realpath/old.js"(exports2) {
|
11411 | var pathModule = require("path");
|
11412 | var isWindows = process.platform === "win32";
|
11413 | var fs = require("fs");
|
11414 | var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
11415 | function rethrow() {
|
11416 | var callback;
|
11417 | if (DEBUG) {
|
11418 | var backtrace = new Error();
|
11419 | callback = debugCallback;
|
11420 | } else
|
11421 | callback = missingCallback;
|
11422 | return callback;
|
11423 | function debugCallback(err) {
|
11424 | if (err) {
|
11425 | backtrace.message = err.message;
|
11426 | err = backtrace;
|
11427 | missingCallback(err);
|
11428 | }
|
11429 | }
|
11430 | function missingCallback(err) {
|
11431 | if (err) {
|
11432 | if (process.throwDeprecation)
|
11433 | throw err;
|
11434 | else if (!process.noDeprecation) {
|
11435 | var msg = "fs: missing callback " + (err.stack || err.message);
|
11436 | if (process.traceDeprecation)
|
11437 | console.trace(msg);
|
11438 | else
|
11439 | console.error(msg);
|
11440 | }
|
11441 | }
|
11442 | }
|
11443 | }
|
11444 | function maybeCallback(cb) {
|
11445 | return typeof cb === "function" ? cb : rethrow();
|
11446 | }
|
11447 | var normalize = pathModule.normalize;
|
11448 | if (isWindows) {
|
11449 | nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
|
11450 | } else {
|
11451 | nextPartRe = /(.*?)(?:[\/]+|$)/g;
|
11452 | }
|
11453 | var nextPartRe;
|
11454 | if (isWindows) {
|
11455 | splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
|
11456 | } else {
|
11457 | splitRootRe = /^[\/]*/;
|
11458 | }
|
11459 | var splitRootRe;
|
11460 | exports2.realpathSync = function realpathSync(p, cache) {
|
11461 | p = pathModule.resolve(p);
|
11462 | if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
11463 | return cache[p];
|
11464 | }
|
11465 | var original = p, seenLinks = {}, knownHard = {};
|
11466 | var pos;
|
11467 | var current;
|
11468 | var base;
|
11469 | var previous;
|
11470 | start();
|
11471 | function start() {
|
11472 | var m = splitRootRe.exec(p);
|
11473 | pos = m[0].length;
|
11474 | current = m[0];
|
11475 | base = m[0];
|
11476 | previous = "";
|
11477 | if (isWindows && !knownHard[base]) {
|
11478 | fs.lstatSync(base);
|
11479 | knownHard[base] = true;
|
11480 | }
|
11481 | }
|
11482 | while (pos < p.length) {
|
11483 | nextPartRe.lastIndex = pos;
|
11484 | var result = nextPartRe.exec(p);
|
11485 | previous = current;
|
11486 | current += result[0];
|
11487 | base = previous + result[1];
|
11488 | pos = nextPartRe.lastIndex;
|
11489 | if (knownHard[base] || cache && cache[base] === base) {
|
11490 | continue;
|
11491 | }
|
11492 | var resolvedLink;
|
11493 | if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
11494 | resolvedLink = cache[base];
|
11495 | } else {
|
11496 | var stat = fs.lstatSync(base);
|
11497 | if (!stat.isSymbolicLink()) {
|
11498 | knownHard[base] = true;
|
11499 | if (cache)
|
11500 | cache[base] = base;
|
11501 | continue;
|
11502 | }
|
11503 | var linkTarget = null;
|
11504 | if (!isWindows) {
|
11505 | var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
11506 | if (seenLinks.hasOwnProperty(id)) {
|
11507 | linkTarget = seenLinks[id];
|
11508 | }
|
11509 | }
|
11510 | if (linkTarget === null) {
|
11511 | fs.statSync(base);
|
11512 | linkTarget = fs.readlinkSync(base);
|
11513 | }
|
11514 | resolvedLink = pathModule.resolve(previous, linkTarget);
|
11515 | if (cache)
|
11516 | cache[base] = resolvedLink;
|
11517 | if (!isWindows)
|
11518 | seenLinks[id] = linkTarget;
|
11519 | }
|
11520 | p = pathModule.resolve(resolvedLink, p.slice(pos));
|
11521 | start();
|
11522 | }
|
11523 | if (cache)
|
11524 | cache[original] = p;
|
11525 | return p;
|
11526 | };
|
11527 | exports2.realpath = function realpath(p, cache, cb) {
|
11528 | if (typeof cb !== "function") {
|
11529 | cb = maybeCallback(cache);
|
11530 | cache = null;
|
11531 | }
|
11532 | p = pathModule.resolve(p);
|
11533 | if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
11534 | return process.nextTick(cb.bind(null, null, cache[p]));
|
11535 | }
|
11536 | var original = p, seenLinks = {}, knownHard = {};
|
11537 | var pos;
|
11538 | var current;
|
11539 | var base;
|
11540 | var previous;
|
11541 | start();
|
11542 | function start() {
|
11543 | var m = splitRootRe.exec(p);
|
11544 | pos = m[0].length;
|
11545 | current = m[0];
|
11546 | base = m[0];
|
11547 | previous = "";
|
11548 | if (isWindows && !knownHard[base]) {
|
11549 | fs.lstat(base, function(err) {
|
11550 | if (err)
|
11551 | return cb(err);
|
11552 | knownHard[base] = true;
|
11553 | LOOP();
|
11554 | });
|
11555 | } else {
|
11556 | process.nextTick(LOOP);
|
11557 | }
|
11558 | }
|
11559 | function LOOP() {
|
11560 | if (pos >= p.length) {
|
11561 | if (cache)
|
11562 | cache[original] = p;
|
11563 | return cb(null, p);
|
11564 | }
|
11565 | nextPartRe.lastIndex = pos;
|
11566 | var result = nextPartRe.exec(p);
|
11567 | previous = current;
|
11568 | current += result[0];
|
11569 | base = previous + result[1];
|
11570 | pos = nextPartRe.lastIndex;
|
11571 | if (knownHard[base] || cache && cache[base] === base) {
|
11572 | return process.nextTick(LOOP);
|
11573 | }
|
11574 | if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
11575 | return gotResolvedLink(cache[base]);
|
11576 | }
|
11577 | return fs.lstat(base, gotStat);
|
11578 | }
|
11579 | function gotStat(err, stat) {
|
11580 | if (err)
|
11581 | return cb(err);
|
11582 | if (!stat.isSymbolicLink()) {
|
11583 | knownHard[base] = true;
|
11584 | if (cache)
|
11585 | cache[base] = base;
|
11586 | return process.nextTick(LOOP);
|
11587 | }
|
11588 | if (!isWindows) {
|
11589 | var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
11590 | if (seenLinks.hasOwnProperty(id)) {
|
11591 | return gotTarget(null, seenLinks[id], base);
|
11592 | }
|
11593 | }
|
11594 | fs.stat(base, function(err2) {
|
11595 | if (err2)
|
11596 | return cb(err2);
|
11597 | fs.readlink(base, function(err3, target) {
|
11598 | if (!isWindows)
|
11599 | seenLinks[id] = target;
|
11600 | gotTarget(err3, target);
|
11601 | });
|
11602 | });
|
11603 | }
|
11604 | function gotTarget(err, target, base2) {
|
11605 | if (err)
|
11606 | return cb(err);
|
11607 | var resolvedLink = pathModule.resolve(previous, target);
|
11608 | if (cache)
|
11609 | cache[base2] = resolvedLink;
|
11610 | gotResolvedLink(resolvedLink);
|
11611 | }
|
11612 | function gotResolvedLink(resolvedLink) {
|
11613 | p = pathModule.resolve(resolvedLink, p.slice(pos));
|
11614 | start();
|
11615 | }
|
11616 | };
|
11617 | }
|
11618 | });
|
11619 | var require_fs5 = __commonJS2({
|
11620 | "node_modules/fs.realpath/index.js"(exports2, module2) {
|
11621 | module2.exports = realpath;
|
11622 | realpath.realpath = realpath;
|
11623 | realpath.sync = realpathSync;
|
11624 | realpath.realpathSync = realpathSync;
|
11625 | realpath.monkeypatch = monkeypatch;
|
11626 | realpath.unmonkeypatch = unmonkeypatch;
|
11627 | var fs = require("fs");
|
11628 | var origRealpath = fs.realpath;
|
11629 | var origRealpathSync = fs.realpathSync;
|
11630 | var version = process.version;
|
11631 | var ok = /^v[0-5]\./.test(version);
|
11632 | var old = require_old();
|
11633 | function newError(er) {
|
11634 | return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
|
11635 | }
|
11636 | function realpath(p, cache, cb) {
|
11637 | if (ok) {
|
11638 | return origRealpath(p, cache, cb);
|
11639 | }
|
11640 | if (typeof cache === "function") {
|
11641 | cb = cache;
|
11642 | cache = null;
|
11643 | }
|
11644 | origRealpath(p, cache, function(er, result) {
|
11645 | if (newError(er)) {
|
11646 | old.realpath(p, cache, cb);
|
11647 | } else {
|
11648 | cb(er, result);
|
11649 | }
|
11650 | });
|
11651 | }
|
11652 | function realpathSync(p, cache) {
|
11653 | if (ok) {
|
11654 | return origRealpathSync(p, cache);
|
11655 | }
|
11656 | try {
|
11657 | return origRealpathSync(p, cache);
|
11658 | } catch (er) {
|
11659 | if (newError(er)) {
|
11660 | return old.realpathSync(p, cache);
|
11661 | } else {
|
11662 | throw er;
|
11663 | }
|
11664 | }
|
11665 | }
|
11666 | function monkeypatch() {
|
11667 | fs.realpath = realpath;
|
11668 | fs.realpathSync = realpathSync;
|
11669 | }
|
11670 | function unmonkeypatch() {
|
11671 | fs.realpath = origRealpath;
|
11672 | fs.realpathSync = origRealpathSync;
|
11673 | }
|
11674 | }
|
11675 | });
|
11676 | var require_concat_map = __commonJS2({
|
11677 | "node_modules/concat-map/index.js"(exports2, module2) {
|
11678 | module2.exports = function(xs, fn) {
|
11679 | var res = [];
|
11680 | for (var i = 0; i < xs.length; i++) {
|
11681 | var x = fn(xs[i], i);
|
11682 | if (isArray(x))
|
11683 | res.push.apply(res, x);
|
11684 | else
|
11685 | res.push(x);
|
11686 | }
|
11687 | return res;
|
11688 | };
|
11689 | var isArray = Array.isArray || function(xs) {
|
11690 | return Object.prototype.toString.call(xs) === "[object Array]";
|
11691 | };
|
11692 | }
|
11693 | });
|
11694 | var require_balanced_match = __commonJS2({
|
11695 | "node_modules/balanced-match/index.js"(exports2, module2) {
|
11696 | "use strict";
|
11697 | module2.exports = balanced;
|
11698 | function balanced(a, b, str) {
|
11699 | if (a instanceof RegExp)
|
11700 | a = maybeMatch(a, str);
|
11701 | if (b instanceof RegExp)
|
11702 | b = maybeMatch(b, str);
|
11703 | var r = range(a, b, str);
|
11704 | return r && {
|
11705 | start: r[0],
|
11706 | end: r[1],
|
11707 | pre: str.slice(0, r[0]),
|
11708 | body: str.slice(r[0] + a.length, r[1]),
|
11709 | post: str.slice(r[1] + b.length)
|
11710 | };
|
11711 | }
|
11712 | function maybeMatch(reg, str) {
|
11713 | var m = str.match(reg);
|
11714 | return m ? m[0] : null;
|
11715 | }
|
11716 | balanced.range = range;
|
11717 | function range(a, b, str) {
|
11718 | var begs, beg, left, right, result;
|
11719 | var ai = str.indexOf(a);
|
11720 | var bi = str.indexOf(b, ai + 1);
|
11721 | var i = ai;
|
11722 | if (ai >= 0 && bi > 0) {
|
11723 | if (a === b) {
|
11724 | return [ai, bi];
|
11725 | }
|
11726 | begs = [];
|
11727 | left = str.length;
|
11728 | while (i >= 0 && !result) {
|
11729 | if (i == ai) {
|
11730 | begs.push(i);
|
11731 | ai = str.indexOf(a, i + 1);
|
11732 | } else if (begs.length == 1) {
|
11733 | result = [begs.pop(), bi];
|
11734 | } else {
|
11735 | beg = begs.pop();
|
11736 | if (beg < left) {
|
11737 | left = beg;
|
11738 | right = bi;
|
11739 | }
|
11740 | bi = str.indexOf(b, i + 1);
|
11741 | }
|
11742 | i = ai < bi && ai >= 0 ? ai : bi;
|
11743 | }
|
11744 | if (begs.length) {
|
11745 | result = [left, right];
|
11746 | }
|
11747 | }
|
11748 | return result;
|
11749 | }
|
11750 | }
|
11751 | });
|
11752 | var require_brace_expansion = __commonJS2({
|
11753 | "node_modules/brace-expansion/index.js"(exports2, module2) {
|
11754 | var concatMap = require_concat_map();
|
11755 | var balanced = require_balanced_match();
|
11756 | module2.exports = expandTop;
|
11757 | var escSlash = "\0SLASH" + Math.random() + "\0";
|
11758 | var escOpen = "\0OPEN" + Math.random() + "\0";
|
11759 | var escClose = "\0CLOSE" + Math.random() + "\0";
|
11760 | var escComma = "\0COMMA" + Math.random() + "\0";
|
11761 | var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
11762 | function numeric(str) {
|
11763 | return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
11764 | }
|
11765 | function escapeBraces(str) {
|
11766 | return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
11767 | }
|
11768 | function unescapeBraces(str) {
|
11769 | return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
11770 | }
|
11771 | function parseCommaParts(str) {
|
11772 | if (!str)
|
11773 | return [""];
|
11774 | var parts = [];
|
11775 | var m = balanced("{", "}", str);
|
11776 | if (!m)
|
11777 | return str.split(",");
|
11778 | var pre = m.pre;
|
11779 | var body = m.body;
|
11780 | var post = m.post;
|
11781 | var p = pre.split(",");
|
11782 | p[p.length - 1] += "{" + body + "}";
|
11783 | var postParts = parseCommaParts(post);
|
11784 | if (post.length) {
|
11785 | p[p.length - 1] += postParts.shift();
|
11786 | p.push.apply(p, postParts);
|
11787 | }
|
11788 | parts.push.apply(parts, p);
|
11789 | return parts;
|
11790 | }
|
11791 | function expandTop(str) {
|
11792 | if (!str)
|
11793 | return [];
|
11794 | if (str.substr(0, 2) === "{}") {
|
11795 | str = "\\{\\}" + str.substr(2);
|
11796 | }
|
11797 | return expand(escapeBraces(str), true).map(unescapeBraces);
|
11798 | }
|
11799 | function embrace(str) {
|
11800 | return "{" + str + "}";
|
11801 | }
|
11802 | function isPadded(el) {
|
11803 | return /^-?0\d/.test(el);
|
11804 | }
|
11805 | function lte(i, y) {
|
11806 | return i <= y;
|
11807 | }
|
11808 | function gte(i, y) {
|
11809 | return i >= y;
|
11810 | }
|
11811 | function expand(str, isTop) {
|
11812 | var expansions = [];
|
11813 | var m = balanced("{", "}", str);
|
11814 | if (!m || /\$$/.test(m.pre))
|
11815 | return [str];
|
11816 | var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
11817 | var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
11818 | var isSequence = isNumericSequence || isAlphaSequence;
|
11819 | var isOptions = m.body.indexOf(",") >= 0;
|
11820 | if (!isSequence && !isOptions) {
|
11821 | if (m.post.match(/,.*\}/)) {
|
11822 | str = m.pre + "{" + m.body + escClose + m.post;
|
11823 | return expand(str);
|
11824 | }
|
11825 | return [str];
|
11826 | }
|
11827 | var n;
|
11828 | if (isSequence) {
|
11829 | n = m.body.split(/\.\./);
|
11830 | } else {
|
11831 | n = parseCommaParts(m.body);
|
11832 | if (n.length === 1) {
|
11833 | n = expand(n[0], false).map(embrace);
|
11834 | if (n.length === 1) {
|
11835 | var post = m.post.length ? expand(m.post, false) : [""];
|
11836 | return post.map(function(p) {
|
11837 | return m.pre + n[0] + p;
|
11838 | });
|
11839 | }
|
11840 | }
|
11841 | }
|
11842 | var pre = m.pre;
|
11843 | var post = m.post.length ? expand(m.post, false) : [""];
|
11844 | var N;
|
11845 | if (isSequence) {
|
11846 | var x = numeric(n[0]);
|
11847 | var y = numeric(n[1]);
|
11848 | var width = Math.max(n[0].length, n[1].length);
|
11849 | var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
11850 | var test = lte;
|
11851 | var reverse = y < x;
|
11852 | if (reverse) {
|
11853 | incr *= -1;
|
11854 | test = gte;
|
11855 | }
|
11856 | var pad = n.some(isPadded);
|
11857 | N = [];
|
11858 | for (var i = x; test(i, y); i += incr) {
|
11859 | var c;
|
11860 | if (isAlphaSequence) {
|
11861 | c = String.fromCharCode(i);
|
11862 | if (c === "\\")
|
11863 | c = "";
|
11864 | } else {
|
11865 | c = String(i);
|
11866 | if (pad) {
|
11867 | var need = width - c.length;
|
11868 | if (need > 0) {
|
11869 | var z = new Array(need + 1).join("0");
|
11870 | if (i < 0)
|
11871 | c = "-" + z + c.slice(1);
|
11872 | else
|
11873 | c = z + c;
|
11874 | }
|
11875 | }
|
11876 | }
|
11877 | N.push(c);
|
11878 | }
|
11879 | } else {
|
11880 | N = concatMap(n, function(el) {
|
11881 | return expand(el, false);
|
11882 | });
|
11883 | }
|
11884 | for (var j = 0; j < N.length; j++) {
|
11885 | for (var k = 0; k < post.length; k++) {
|
11886 | var expansion = pre + N[j] + post[k];
|
11887 | if (!isTop || isSequence || expansion)
|
11888 | expansions.push(expansion);
|
11889 | }
|
11890 | }
|
11891 | return expansions;
|
11892 | }
|
11893 | }
|
11894 | });
|
11895 | var require_minimatch = __commonJS2({
|
11896 | "node_modules/minimatch/minimatch.js"(exports2, module2) {
|
11897 | module2.exports = minimatch;
|
11898 | minimatch.Minimatch = Minimatch;
|
11899 | var path = function() {
|
11900 | try {
|
11901 | return require("path");
|
11902 | } catch (e) {
|
11903 | }
|
11904 | }() || {
|
11905 | sep: "/"
|
11906 | };
|
11907 | minimatch.sep = path.sep;
|
11908 | var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
11909 | var expand = require_brace_expansion();
|
11910 | var plTypes = {
|
11911 | "!": {
|
11912 | open: "(?:(?!(?:",
|
11913 | close: "))[^/]*?)"
|
11914 | },
|
11915 | "?": {
|
11916 | open: "(?:",
|
11917 | close: ")?"
|
11918 | },
|
11919 | "+": {
|
11920 | open: "(?:",
|
11921 | close: ")+"
|
11922 | },
|
11923 | "*": {
|
11924 | open: "(?:",
|
11925 | close: ")*"
|
11926 | },
|
11927 | "@": {
|
11928 | open: "(?:",
|
11929 | close: ")"
|
11930 | }
|
11931 | };
|
11932 | var qmark = "[^/]";
|
11933 | var star = qmark + "*?";
|
11934 | var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
11935 | var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
11936 | var reSpecials = charSet("().*{}+?[]^$\\!");
|
11937 | function charSet(s) {
|
11938 | return s.split("").reduce(function(set, c) {
|
11939 | set[c] = true;
|
11940 | return set;
|
11941 | }, {});
|
11942 | }
|
11943 | var slashSplit = /\/+/;
|
11944 | minimatch.filter = filter;
|
11945 | function filter(pattern, options) {
|
11946 | options = options || {};
|
11947 | return function(p, i, list) {
|
11948 | return minimatch(p, pattern, options);
|
11949 | };
|
11950 | }
|
11951 | function ext(a, b) {
|
11952 | b = b || {};
|
11953 | var t = {};
|
11954 | Object.keys(a).forEach(function(k) {
|
11955 | t[k] = a[k];
|
11956 | });
|
11957 | Object.keys(b).forEach(function(k) {
|
11958 | t[k] = b[k];
|
11959 | });
|
11960 | return t;
|
11961 | }
|
11962 | minimatch.defaults = function(def) {
|
11963 | if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
11964 | return minimatch;
|
11965 | }
|
11966 | var orig = minimatch;
|
11967 | var m = function minimatch2(p, pattern, options) {
|
11968 | return orig(p, pattern, ext(def, options));
|
11969 | };
|
11970 | m.Minimatch = function Minimatch2(pattern, options) {
|
11971 | return new orig.Minimatch(pattern, ext(def, options));
|
11972 | };
|
11973 | m.Minimatch.defaults = function defaults(options) {
|
11974 | return orig.defaults(ext(def, options)).Minimatch;
|
11975 | };
|
11976 | m.filter = function filter2(pattern, options) {
|
11977 | return orig.filter(pattern, ext(def, options));
|
11978 | };
|
11979 | m.defaults = function defaults(options) {
|
11980 | return orig.defaults(ext(def, options));
|
11981 | };
|
11982 | m.makeRe = function makeRe2(pattern, options) {
|
11983 | return orig.makeRe(pattern, ext(def, options));
|
11984 | };
|
11985 | m.braceExpand = function braceExpand2(pattern, options) {
|
11986 | return orig.braceExpand(pattern, ext(def, options));
|
11987 | };
|
11988 | m.match = function(list, pattern, options) {
|
11989 | return orig.match(list, pattern, ext(def, options));
|
11990 | };
|
11991 | return m;
|
11992 | };
|
11993 | Minimatch.defaults = function(def) {
|
11994 | return minimatch.defaults(def).Minimatch;
|
11995 | };
|
11996 | function minimatch(p, pattern, options) {
|
11997 | assertValidPattern(pattern);
|
11998 | if (!options)
|
11999 | options = {};
|
12000 | if (!options.nocomment && pattern.charAt(0) === "#") {
|
12001 | return false;
|
12002 | }
|
12003 | return new Minimatch(pattern, options).match(p);
|
12004 | }
|
12005 | function Minimatch(pattern, options) {
|
12006 | if (!(this instanceof Minimatch)) {
|
12007 | return new Minimatch(pattern, options);
|
12008 | }
|
12009 | assertValidPattern(pattern);
|
12010 | if (!options)
|
12011 | options = {};
|
12012 | pattern = pattern.trim();
|
12013 | if (!options.allowWindowsEscape && path.sep !== "/") {
|
12014 | pattern = pattern.split(path.sep).join("/");
|
12015 | }
|
12016 | this.options = options;
|
12017 | this.set = [];
|
12018 | this.pattern = pattern;
|
12019 | this.regexp = null;
|
12020 | this.negate = false;
|
12021 | this.comment = false;
|
12022 | this.empty = false;
|
12023 | this.partial = !!options.partial;
|
12024 | this.make();
|
12025 | }
|
12026 | Minimatch.prototype.debug = function() {
|
12027 | };
|
12028 | Minimatch.prototype.make = make;
|
12029 | function make() {
|
12030 | var pattern = this.pattern;
|
12031 | var options = this.options;
|
12032 | if (!options.nocomment && pattern.charAt(0) === "#") {
|
12033 | this.comment = true;
|
12034 | return;
|
12035 | }
|
12036 | if (!pattern) {
|
12037 | this.empty = true;
|
12038 | return;
|
12039 | }
|
12040 | this.parseNegate();
|
12041 | var set = this.globSet = this.braceExpand();
|
12042 | if (options.debug)
|
12043 | this.debug = function debug() {
|
12044 | console.error.apply(console, arguments);
|
12045 | };
|
12046 | this.debug(this.pattern, set);
|
12047 | set = this.globParts = set.map(function(s) {
|
12048 | return s.split(slashSplit);
|
12049 | });
|
12050 | this.debug(this.pattern, set);
|
12051 | set = set.map(function(s, si, set2) {
|
12052 | return s.map(this.parse, this);
|
12053 | }, this);
|
12054 | this.debug(this.pattern, set);
|
12055 | set = set.filter(function(s) {
|
12056 | return s.indexOf(false) === -1;
|
12057 | });
|
12058 | this.debug(this.pattern, set);
|
12059 | this.set = set;
|
12060 | }
|
12061 | Minimatch.prototype.parseNegate = parseNegate;
|
12062 | function parseNegate() {
|
12063 | var pattern = this.pattern;
|
12064 | var negate = false;
|
12065 | var options = this.options;
|
12066 | var negateOffset = 0;
|
12067 | if (options.nonegate)
|
12068 | return;
|
12069 | for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
|
12070 | negate = !negate;
|
12071 | negateOffset++;
|
12072 | }
|
12073 | if (negateOffset)
|
12074 | this.pattern = pattern.substr(negateOffset);
|
12075 | this.negate = negate;
|
12076 | }
|
12077 | minimatch.braceExpand = function(pattern, options) {
|
12078 | return braceExpand(pattern, options);
|
12079 | };
|
12080 | Minimatch.prototype.braceExpand = braceExpand;
|
12081 | function braceExpand(pattern, options) {
|
12082 | if (!options) {
|
12083 | if (this instanceof Minimatch) {
|
12084 | options = this.options;
|
12085 | } else {
|
12086 | options = {};
|
12087 | }
|
12088 | }
|
12089 | pattern = typeof pattern === "undefined" ? this.pattern : pattern;
|
12090 | assertValidPattern(pattern);
|
12091 | if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
12092 | return [pattern];
|
12093 | }
|
12094 | return expand(pattern);
|
12095 | }
|
12096 | var MAX_PATTERN_LENGTH = 1024 * 64;
|
12097 | var assertValidPattern = function(pattern) {
|
12098 | if (typeof pattern !== "string") {
|
12099 | throw new TypeError("invalid pattern");
|
12100 | }
|
12101 | if (pattern.length > MAX_PATTERN_LENGTH) {
|
12102 | throw new TypeError("pattern is too long");
|
12103 | }
|
12104 | };
|
12105 | Minimatch.prototype.parse = parse;
|
12106 | var SUBPARSE = {};
|
12107 | function parse(pattern, isSub) {
|
12108 | assertValidPattern(pattern);
|
12109 | var options = this.options;
|
12110 | if (pattern === "**") {
|
12111 | if (!options.noglobstar)
|
12112 | return GLOBSTAR;
|
12113 | else
|
12114 | pattern = "*";
|
12115 | }
|
12116 | if (pattern === "")
|
12117 | return "";
|
12118 | var re = "";
|
12119 | var hasMagic = !!options.nocase;
|
12120 | var escaping = false;
|
12121 | var patternListStack = [];
|
12122 | var negativeLists = [];
|
12123 | var stateChar;
|
12124 | var inClass = false;
|
12125 | var reClassStart = -1;
|
12126 | var classStart = -1;
|
12127 | var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
12128 | var self2 = this;
|
12129 | function clearStateChar() {
|
12130 | if (stateChar) {
|
12131 | switch (stateChar) {
|
12132 | case "*":
|
12133 | re += star;
|
12134 | hasMagic = true;
|
12135 | break;
|
12136 | case "?":
|
12137 | re += qmark;
|
12138 | hasMagic = true;
|
12139 | break;
|
12140 | default:
|
12141 | re += "\\" + stateChar;
|
12142 | break;
|
12143 | }
|
12144 | self2.debug("clearStateChar %j %j", stateChar, re);
|
12145 | stateChar = false;
|
12146 | }
|
12147 | }
|
12148 | for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
|
12149 | this.debug("%s %s %s %j", pattern, i, re, c);
|
12150 | if (escaping && reSpecials[c]) {
|
12151 | re += "\\" + c;
|
12152 | escaping = false;
|
12153 | continue;
|
12154 | }
|
12155 | switch (c) {
|
12156 | case "/": {
|
12157 | return false;
|
12158 | }
|
12159 | case "\\":
|
12160 | clearStateChar();
|
12161 | escaping = true;
|
12162 | continue;
|
12163 | case "?":
|
12164 | case "*":
|
12165 | case "+":
|
12166 | case "@":
|
12167 | case "!":
|
12168 | this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
|
12169 | if (inClass) {
|
12170 | this.debug(" in class");
|
12171 | if (c === "!" && i === classStart + 1)
|
12172 | c = "^";
|
12173 | re += c;
|
12174 | continue;
|
12175 | }
|
12176 | self2.debug("call clearStateChar %j", stateChar);
|
12177 | clearStateChar();
|
12178 | stateChar = c;
|
12179 | if (options.noext)
|
12180 | clearStateChar();
|
12181 | continue;
|
12182 | case "(":
|
12183 | if (inClass) {
|
12184 | re += "(";
|
12185 | continue;
|
12186 | }
|
12187 | if (!stateChar) {
|
12188 | re += "\\(";
|
12189 | continue;
|
12190 | }
|
12191 | patternListStack.push({
|
12192 | type: stateChar,
|
12193 | start: i - 1,
|
12194 | reStart: re.length,
|
12195 | open: plTypes[stateChar].open,
|
12196 | close: plTypes[stateChar].close
|
12197 | });
|
12198 | re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
|
12199 | this.debug("plType %j %j", stateChar, re);
|
12200 | stateChar = false;
|
12201 | continue;
|
12202 | case ")":
|
12203 | if (inClass || !patternListStack.length) {
|
12204 | re += "\\)";
|
12205 | continue;
|
12206 | }
|
12207 | clearStateChar();
|
12208 | hasMagic = true;
|
12209 | var pl = patternListStack.pop();
|
12210 | re += pl.close;
|
12211 | if (pl.type === "!") {
|
12212 | negativeLists.push(pl);
|
12213 | }
|
12214 | pl.reEnd = re.length;
|
12215 | continue;
|
12216 | case "|":
|
12217 | if (inClass || !patternListStack.length || escaping) {
|
12218 | re += "\\|";
|
12219 | escaping = false;
|
12220 | continue;
|
12221 | }
|
12222 | clearStateChar();
|
12223 | re += "|";
|
12224 | continue;
|
12225 | case "[":
|
12226 | clearStateChar();
|
12227 | if (inClass) {
|
12228 | re += "\\" + c;
|
12229 | continue;
|
12230 | }
|
12231 | inClass = true;
|
12232 | classStart = i;
|
12233 | reClassStart = re.length;
|
12234 | re += c;
|
12235 | continue;
|
12236 | case "]":
|
12237 | if (i === classStart + 1 || !inClass) {
|
12238 | re += "\\" + c;
|
12239 | escaping = false;
|
12240 | continue;
|
12241 | }
|
12242 | var cs = pattern.substring(classStart + 1, i);
|
12243 | try {
|
12244 | RegExp("[" + cs + "]");
|
12245 | } catch (er) {
|
12246 | var sp = this.parse(cs, SUBPARSE);
|
12247 | re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
|
12248 | hasMagic = hasMagic || sp[1];
|
12249 | inClass = false;
|
12250 | continue;
|
12251 | }
|
12252 | hasMagic = true;
|
12253 | inClass = false;
|
12254 | re += c;
|
12255 | continue;
|
12256 | default:
|
12257 | clearStateChar();
|
12258 | if (escaping) {
|
12259 | escaping = false;
|
12260 | } else if (reSpecials[c] && !(c === "^" && inClass)) {
|
12261 | re += "\\";
|
12262 | }
|
12263 | re += c;
|
12264 | }
|
12265 | }
|
12266 | if (inClass) {
|
12267 | cs = pattern.substr(classStart + 1);
|
12268 | sp = this.parse(cs, SUBPARSE);
|
12269 | re = re.substr(0, reClassStart) + "\\[" + sp[0];
|
12270 | hasMagic = hasMagic || sp[1];
|
12271 | }
|
12272 | for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
12273 | var tail = re.slice(pl.reStart + pl.open.length);
|
12274 | this.debug("setting tail", re, pl);
|
12275 | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
|
12276 | if (!$2) {
|
12277 | $2 = "\\";
|
12278 | }
|
12279 | return $1 + $1 + $2 + "|";
|
12280 | });
|
12281 | this.debug("tail=%j\n %s", tail, tail, pl, re);
|
12282 | var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
|
12283 | hasMagic = true;
|
12284 | re = re.slice(0, pl.reStart) + t + "\\(" + tail;
|
12285 | }
|
12286 | clearStateChar();
|
12287 | if (escaping) {
|
12288 | re += "\\\\";
|
12289 | }
|
12290 | var addPatternStart = false;
|
12291 | switch (re.charAt(0)) {
|
12292 | case "[":
|
12293 | case ".":
|
12294 | case "(":
|
12295 | addPatternStart = true;
|
12296 | }
|
12297 | for (var n = negativeLists.length - 1; n > -1; n--) {
|
12298 | var nl = negativeLists[n];
|
12299 | var nlBefore = re.slice(0, nl.reStart);
|
12300 | var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
|
12301 | var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
|
12302 | var nlAfter = re.slice(nl.reEnd);
|
12303 | nlLast += nlAfter;
|
12304 | var openParensBefore = nlBefore.split("(").length - 1;
|
12305 | var cleanAfter = nlAfter;
|
12306 | for (i = 0; i < openParensBefore; i++) {
|
12307 | cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
|
12308 | }
|
12309 | nlAfter = cleanAfter;
|
12310 | var dollar = "";
|
12311 | if (nlAfter === "" && isSub !== SUBPARSE) {
|
12312 | dollar = "$";
|
12313 | }
|
12314 | var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
|
12315 | re = newRe;
|
12316 | }
|
12317 | if (re !== "" && hasMagic) {
|
12318 | re = "(?=.)" + re;
|
12319 | }
|
12320 | if (addPatternStart) {
|
12321 | re = patternStart + re;
|
12322 | }
|
12323 | if (isSub === SUBPARSE) {
|
12324 | return [re, hasMagic];
|
12325 | }
|
12326 | if (!hasMagic) {
|
12327 | return globUnescape(pattern);
|
12328 | }
|
12329 | var flags = options.nocase ? "i" : "";
|
12330 | try {
|
12331 | var regExp = new RegExp("^" + re + "$", flags);
|
12332 | } catch (er) {
|
12333 | return new RegExp("$.");
|
12334 | }
|
12335 | regExp._glob = pattern;
|
12336 | regExp._src = re;
|
12337 | return regExp;
|
12338 | }
|
12339 | minimatch.makeRe = function(pattern, options) {
|
12340 | return new Minimatch(pattern, options || {}).makeRe();
|
12341 | };
|
12342 | Minimatch.prototype.makeRe = makeRe;
|
12343 | function makeRe() {
|
12344 | if (this.regexp || this.regexp === false)
|
12345 | return this.regexp;
|
12346 | var set = this.set;
|
12347 | if (!set.length) {
|
12348 | this.regexp = false;
|
12349 | return this.regexp;
|
12350 | }
|
12351 | var options = this.options;
|
12352 | var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
12353 | var flags = options.nocase ? "i" : "";
|
12354 | var re = set.map(function(pattern) {
|
12355 | return pattern.map(function(p) {
|
12356 | return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
|
12357 | }).join("\\/");
|
12358 | }).join("|");
|
12359 | re = "^(?:" + re + ")$";
|
12360 | if (this.negate)
|
12361 | re = "^(?!" + re + ").*$";
|
12362 | try {
|
12363 | this.regexp = new RegExp(re, flags);
|
12364 | } catch (ex) {
|
12365 | this.regexp = false;
|
12366 | }
|
12367 | return this.regexp;
|
12368 | }
|
12369 | minimatch.match = function(list, pattern, options) {
|
12370 | options = options || {};
|
12371 | var mm = new Minimatch(pattern, options);
|
12372 | list = list.filter(function(f) {
|
12373 | return mm.match(f);
|
12374 | });
|
12375 | if (mm.options.nonull && !list.length) {
|
12376 | list.push(pattern);
|
12377 | }
|
12378 | return list;
|
12379 | };
|
12380 | Minimatch.prototype.match = function match(f, partial) {
|
12381 | if (typeof partial === "undefined")
|
12382 | partial = this.partial;
|
12383 | this.debug("match", f, this.pattern);
|
12384 | if (this.comment)
|
12385 | return false;
|
12386 | if (this.empty)
|
12387 | return f === "";
|
12388 | if (f === "/" && partial)
|
12389 | return true;
|
12390 | var options = this.options;
|
12391 | if (path.sep !== "/") {
|
12392 | f = f.split(path.sep).join("/");
|
12393 | }
|
12394 | f = f.split(slashSplit);
|
12395 | this.debug(this.pattern, "split", f);
|
12396 | var set = this.set;
|
12397 | this.debug(this.pattern, "set", set);
|
12398 | var filename;
|
12399 | var i;
|
12400 | for (i = f.length - 1; i >= 0; i--) {
|
12401 | filename = f[i];
|
12402 | if (filename)
|
12403 | break;
|
12404 | }
|
12405 | for (i = 0; i < set.length; i++) {
|
12406 | var pattern = set[i];
|
12407 | var file = f;
|
12408 | if (options.matchBase && pattern.length === 1) {
|
12409 | file = [filename];
|
12410 | }
|
12411 | var hit = this.matchOne(file, pattern, partial);
|
12412 | if (hit) {
|
12413 | if (options.flipNegate)
|
12414 | return true;
|
12415 | return !this.negate;
|
12416 | }
|
12417 | }
|
12418 | if (options.flipNegate)
|
12419 | return false;
|
12420 | return this.negate;
|
12421 | };
|
12422 | Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
12423 | var options = this.options;
|
12424 | this.debug("matchOne", {
|
12425 | "this": this,
|
12426 | file,
|
12427 | pattern
|
12428 | });
|
12429 | this.debug("matchOne", file.length, pattern.length);
|
12430 | for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
12431 | this.debug("matchOne loop");
|
12432 | var p = pattern[pi];
|
12433 | var f = file[fi];
|
12434 | this.debug(pattern, p, f);
|
12435 | if (p === false)
|
12436 | return false;
|
12437 | if (p === GLOBSTAR) {
|
12438 | this.debug("GLOBSTAR", [pattern, p, f]);
|
12439 | var fr = fi;
|
12440 | var pr = pi + 1;
|
12441 | if (pr === pl) {
|
12442 | this.debug("** at the end");
|
12443 | for (; fi < fl; fi++) {
|
12444 | if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
12445 | return false;
|
12446 | }
|
12447 | return true;
|
12448 | }
|
12449 | while (fr < fl) {
|
12450 | var swallowee = file[fr];
|
12451 | this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
12452 | if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
12453 | this.debug("globstar found match!", fr, fl, swallowee);
|
12454 | return true;
|
12455 | } else {
|
12456 | if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
12457 | this.debug("dot detected!", file, fr, pattern, pr);
|
12458 | break;
|
12459 | }
|
12460 | this.debug("globstar swallow a segment, and continue");
|
12461 | fr++;
|
12462 | }
|
12463 | }
|
12464 | if (partial) {
|
12465 | this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
12466 | if (fr === fl)
|
12467 | return true;
|
12468 | }
|
12469 | return false;
|
12470 | }
|
12471 | var hit;
|
12472 | if (typeof p === "string") {
|
12473 | hit = f === p;
|
12474 | this.debug("string match", p, f, hit);
|
12475 | } else {
|
12476 | hit = f.match(p);
|
12477 | this.debug("pattern match", p, f, hit);
|
12478 | }
|
12479 | if (!hit)
|
12480 | return false;
|
12481 | }
|
12482 | if (fi === fl && pi === pl) {
|
12483 | return true;
|
12484 | } else if (fi === fl) {
|
12485 | return partial;
|
12486 | } else if (pi === pl) {
|
12487 | return fi === fl - 1 && file[fi] === "";
|
12488 | }
|
12489 | throw new Error("wtf?");
|
12490 | };
|
12491 | function globUnescape(s) {
|
12492 | return s.replace(/\\(.)/g, "$1");
|
12493 | }
|
12494 | function regExpEscape(s) {
|
12495 | return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
12496 | }
|
12497 | }
|
12498 | });
|
12499 | var require_inherits_browser = __commonJS2({
|
12500 | "node_modules/inherits/inherits_browser.js"(exports2, module2) {
|
12501 | if (typeof Object.create === "function") {
|
12502 | module2.exports = function inherits(ctor, superCtor) {
|
12503 | if (superCtor) {
|
12504 | ctor.super_ = superCtor;
|
12505 | ctor.prototype = Object.create(superCtor.prototype, {
|
12506 | constructor: {
|
12507 | value: ctor,
|
12508 | enumerable: false,
|
12509 | writable: true,
|
12510 | configurable: true
|
12511 | }
|
12512 | });
|
12513 | }
|
12514 | };
|
12515 | } else {
|
12516 | module2.exports = function inherits(ctor, superCtor) {
|
12517 | if (superCtor) {
|
12518 | ctor.super_ = superCtor;
|
12519 | var TempCtor = function() {
|
12520 | };
|
12521 | TempCtor.prototype = superCtor.prototype;
|
12522 | ctor.prototype = new TempCtor();
|
12523 | ctor.prototype.constructor = ctor;
|
12524 | }
|
12525 | };
|
12526 | }
|
12527 | }
|
12528 | });
|
12529 | var require_inherits = __commonJS2({
|
12530 | "node_modules/inherits/inherits.js"(exports2, module2) {
|
12531 | try {
|
12532 | util = require("util");
|
12533 | if (typeof util.inherits !== "function")
|
12534 | throw "";
|
12535 | module2.exports = util.inherits;
|
12536 | } catch (e) {
|
12537 | module2.exports = require_inherits_browser();
|
12538 | }
|
12539 | var util;
|
12540 | }
|
12541 | });
|
12542 | var require_path_is_absolute = __commonJS2({
|
12543 | "node_modules/path-is-absolute/index.js"(exports2, module2) {
|
12544 | "use strict";
|
12545 | function posix(path) {
|
12546 | return path.charAt(0) === "/";
|
12547 | }
|
12548 | function win32(path) {
|
12549 | var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
|
12550 | var result = splitDeviceRe.exec(path);
|
12551 | var device = result[1] || "";
|
12552 | var isUnc = Boolean(device && device.charAt(1) !== ":");
|
12553 | return Boolean(result[2] || isUnc);
|
12554 | }
|
12555 | module2.exports = process.platform === "win32" ? win32 : posix;
|
12556 | module2.exports.posix = posix;
|
12557 | module2.exports.win32 = win32;
|
12558 | }
|
12559 | });
|
12560 | var require_common3 = __commonJS2({
|
12561 | "node_modules/glob/common.js"(exports2) {
|
12562 | exports2.setopts = setopts;
|
12563 | exports2.ownProp = ownProp;
|
12564 | exports2.makeAbs = makeAbs;
|
12565 | exports2.finish = finish;
|
12566 | exports2.mark = mark;
|
12567 | exports2.isIgnored = isIgnored;
|
12568 | exports2.childrenIgnored = childrenIgnored;
|
12569 | function ownProp(obj, field) {
|
12570 | return Object.prototype.hasOwnProperty.call(obj, field);
|
12571 | }
|
12572 | var fs = require("fs");
|
12573 | var path = require("path");
|
12574 | var minimatch = require_minimatch();
|
12575 | var isAbsolute = require_path_is_absolute();
|
12576 | var Minimatch = minimatch.Minimatch;
|
12577 | function alphasort(a, b) {
|
12578 | return a.localeCompare(b, "en");
|
12579 | }
|
12580 | function setupIgnores(self2, options) {
|
12581 | self2.ignore = options.ignore || [];
|
12582 | if (!Array.isArray(self2.ignore))
|
12583 | self2.ignore = [self2.ignore];
|
12584 | if (self2.ignore.length) {
|
12585 | self2.ignore = self2.ignore.map(ignoreMap);
|
12586 | }
|
12587 | }
|
12588 | function ignoreMap(pattern) {
|
12589 | var gmatcher = null;
|
12590 | if (pattern.slice(-3) === "/**") {
|
12591 | var gpattern = pattern.replace(/(\/\*\*)+$/, "");
|
12592 | gmatcher = new Minimatch(gpattern, {
|
12593 | dot: true
|
12594 | });
|
12595 | }
|
12596 | return {
|
12597 | matcher: new Minimatch(pattern, {
|
12598 | dot: true
|
12599 | }),
|
12600 | gmatcher
|
12601 | };
|
12602 | }
|
12603 | function setopts(self2, pattern, options) {
|
12604 | if (!options)
|
12605 | options = {};
|
12606 | if (options.matchBase && -1 === pattern.indexOf("/")) {
|
12607 | if (options.noglobstar) {
|
12608 | throw new Error("base matching requires globstar");
|
12609 | }
|
12610 | pattern = "**/" + pattern;
|
12611 | }
|
12612 | self2.silent = !!options.silent;
|
12613 | self2.pattern = pattern;
|
12614 | self2.strict = options.strict !== false;
|
12615 | self2.realpath = !!options.realpath;
|
12616 | self2.realpathCache = options.realpathCache || Object.create(null);
|
12617 | self2.follow = !!options.follow;
|
12618 | self2.dot = !!options.dot;
|
12619 | self2.mark = !!options.mark;
|
12620 | self2.nodir = !!options.nodir;
|
12621 | if (self2.nodir)
|
12622 | self2.mark = true;
|
12623 | self2.sync = !!options.sync;
|
12624 | self2.nounique = !!options.nounique;
|
12625 | self2.nonull = !!options.nonull;
|
12626 | self2.nosort = !!options.nosort;
|
12627 | self2.nocase = !!options.nocase;
|
12628 | self2.stat = !!options.stat;
|
12629 | self2.noprocess = !!options.noprocess;
|
12630 | self2.absolute = !!options.absolute;
|
12631 | self2.fs = options.fs || fs;
|
12632 | self2.maxLength = options.maxLength || Infinity;
|
12633 | self2.cache = options.cache || Object.create(null);
|
12634 | self2.statCache = options.statCache || Object.create(null);
|
12635 | self2.symlinks = options.symlinks || Object.create(null);
|
12636 | setupIgnores(self2, options);
|
12637 | self2.changedCwd = false;
|
12638 | var cwd = process.cwd();
|
12639 | if (!ownProp(options, "cwd"))
|
12640 | self2.cwd = cwd;
|
12641 | else {
|
12642 | self2.cwd = path.resolve(options.cwd);
|
12643 | self2.changedCwd = self2.cwd !== cwd;
|
12644 | }
|
12645 | self2.root = options.root || path.resolve(self2.cwd, "/");
|
12646 | self2.root = path.resolve(self2.root);
|
12647 | if (process.platform === "win32")
|
12648 | self2.root = self2.root.replace(/\\/g, "/");
|
12649 | self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
|
12650 | if (process.platform === "win32")
|
12651 | self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
|
12652 | self2.nomount = !!options.nomount;
|
12653 | options.nonegate = true;
|
12654 | options.nocomment = true;
|
12655 | options.allowWindowsEscape = false;
|
12656 | self2.minimatch = new Minimatch(pattern, options);
|
12657 | self2.options = self2.minimatch.options;
|
12658 | }
|
12659 | function finish(self2) {
|
12660 | var nou = self2.nounique;
|
12661 | var all = nou ? [] : Object.create(null);
|
12662 | for (var i = 0, l = self2.matches.length; i < l; i++) {
|
12663 | var matches = self2.matches[i];
|
12664 | if (!matches || Object.keys(matches).length === 0) {
|
12665 | if (self2.nonull) {
|
12666 | var literal = self2.minimatch.globSet[i];
|
12667 | if (nou)
|
12668 | all.push(literal);
|
12669 | else
|
12670 | all[literal] = true;
|
12671 | }
|
12672 | } else {
|
12673 | var m = Object.keys(matches);
|
12674 | if (nou)
|
12675 | all.push.apply(all, m);
|
12676 | else
|
12677 | m.forEach(function(m2) {
|
12678 | all[m2] = true;
|
12679 | });
|
12680 | }
|
12681 | }
|
12682 | if (!nou)
|
12683 | all = Object.keys(all);
|
12684 | if (!self2.nosort)
|
12685 | all = all.sort(alphasort);
|
12686 | if (self2.mark) {
|
12687 | for (var i = 0; i < all.length; i++) {
|
12688 | all[i] = self2._mark(all[i]);
|
12689 | }
|
12690 | if (self2.nodir) {
|
12691 | all = all.filter(function(e) {
|
12692 | var notDir = !/\/$/.test(e);
|
12693 | var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
|
12694 | if (notDir && c)
|
12695 | notDir = c !== "DIR" && !Array.isArray(c);
|
12696 | return notDir;
|
12697 | });
|
12698 | }
|
12699 | }
|
12700 | if (self2.ignore.length)
|
12701 | all = all.filter(function(m2) {
|
12702 | return !isIgnored(self2, m2);
|
12703 | });
|
12704 | self2.found = all;
|
12705 | }
|
12706 | function mark(self2, p) {
|
12707 | var abs = makeAbs(self2, p);
|
12708 | var c = self2.cache[abs];
|
12709 | var m = p;
|
12710 | if (c) {
|
12711 | var isDir = c === "DIR" || Array.isArray(c);
|
12712 | var slash = p.slice(-1) === "/";
|
12713 | if (isDir && !slash)
|
12714 | m += "/";
|
12715 | else if (!isDir && slash)
|
12716 | m = m.slice(0, -1);
|
12717 | if (m !== p) {
|
12718 | var mabs = makeAbs(self2, m);
|
12719 | self2.statCache[mabs] = self2.statCache[abs];
|
12720 | self2.cache[mabs] = self2.cache[abs];
|
12721 | }
|
12722 | }
|
12723 | return m;
|
12724 | }
|
12725 | function makeAbs(self2, f) {
|
12726 | var abs = f;
|
12727 | if (f.charAt(0) === "/") {
|
12728 | abs = path.join(self2.root, f);
|
12729 | } else if (isAbsolute(f) || f === "") {
|
12730 | abs = f;
|
12731 | } else if (self2.changedCwd) {
|
12732 | abs = path.resolve(self2.cwd, f);
|
12733 | } else {
|
12734 | abs = path.resolve(f);
|
12735 | }
|
12736 | if (process.platform === "win32")
|
12737 | abs = abs.replace(/\\/g, "/");
|
12738 | return abs;
|
12739 | }
|
12740 | function isIgnored(self2, path2) {
|
12741 | if (!self2.ignore.length)
|
12742 | return false;
|
12743 | return self2.ignore.some(function(item) {
|
12744 | return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2));
|
12745 | });
|
12746 | }
|
12747 | function childrenIgnored(self2, path2) {
|
12748 | if (!self2.ignore.length)
|
12749 | return false;
|
12750 | return self2.ignore.some(function(item) {
|
12751 | return !!(item.gmatcher && item.gmatcher.match(path2));
|
12752 | });
|
12753 | }
|
12754 | }
|
12755 | });
|
12756 | var require_sync7 = __commonJS2({
|
12757 | "node_modules/glob/sync.js"(exports2, module2) {
|
12758 | module2.exports = globSync;
|
12759 | globSync.GlobSync = GlobSync;
|
12760 | var rp = require_fs5();
|
12761 | var minimatch = require_minimatch();
|
12762 | var Minimatch = minimatch.Minimatch;
|
12763 | var Glob = require_glob().Glob;
|
12764 | var util = require("util");
|
12765 | var path = require("path");
|
12766 | var assert = require("assert");
|
12767 | var isAbsolute = require_path_is_absolute();
|
12768 | var common = require_common3();
|
12769 | var setopts = common.setopts;
|
12770 | var ownProp = common.ownProp;
|
12771 | var childrenIgnored = common.childrenIgnored;
|
12772 | var isIgnored = common.isIgnored;
|
12773 | function globSync(pattern, options) {
|
12774 | if (typeof options === "function" || arguments.length === 3)
|
12775 | throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
|
12776 | return new GlobSync(pattern, options).found;
|
12777 | }
|
12778 | function GlobSync(pattern, options) {
|
12779 | if (!pattern)
|
12780 | throw new Error("must provide pattern");
|
12781 | if (typeof options === "function" || arguments.length === 3)
|
12782 | throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
|
12783 | if (!(this instanceof GlobSync))
|
12784 | return new GlobSync(pattern, options);
|
12785 | setopts(this, pattern, options);
|
12786 | if (this.noprocess)
|
12787 | return this;
|
12788 | var n = this.minimatch.set.length;
|
12789 | this.matches = new Array(n);
|
12790 | for (var i = 0; i < n; i++) {
|
12791 | this._process(this.minimatch.set[i], i, false);
|
12792 | }
|
12793 | this._finish();
|
12794 | }
|
12795 | GlobSync.prototype._finish = function() {
|
12796 | assert.ok(this instanceof GlobSync);
|
12797 | if (this.realpath) {
|
12798 | var self2 = this;
|
12799 | this.matches.forEach(function(matchset, index) {
|
12800 | var set = self2.matches[index] = /* @__PURE__ */ Object.create(null);
|
12801 | for (var p in matchset) {
|
12802 | try {
|
12803 | p = self2._makeAbs(p);
|
12804 | var real = rp.realpathSync(p, self2.realpathCache);
|
12805 | set[real] = true;
|
12806 | } catch (er) {
|
12807 | if (er.syscall === "stat")
|
12808 | set[self2._makeAbs(p)] = true;
|
12809 | else
|
12810 | throw er;
|
12811 | }
|
12812 | }
|
12813 | });
|
12814 | }
|
12815 | common.finish(this);
|
12816 | };
|
12817 | GlobSync.prototype._process = function(pattern, index, inGlobStar) {
|
12818 | assert.ok(this instanceof GlobSync);
|
12819 | var n = 0;
|
12820 | while (typeof pattern[n] === "string") {
|
12821 | n++;
|
12822 | }
|
12823 | var prefix;
|
12824 | switch (n) {
|
12825 | case pattern.length:
|
12826 | this._processSimple(pattern.join("/"), index);
|
12827 | return;
|
12828 | case 0:
|
12829 | prefix = null;
|
12830 | break;
|
12831 | default:
|
12832 | prefix = pattern.slice(0, n).join("/");
|
12833 | break;
|
12834 | }
|
12835 | var remain = pattern.slice(n);
|
12836 | var read;
|
12837 | if (prefix === null)
|
12838 | read = ".";
|
12839 | else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
12840 | return typeof p === "string" ? p : "[*]";
|
12841 | }).join("/"))) {
|
12842 | if (!prefix || !isAbsolute(prefix))
|
12843 | prefix = "/" + prefix;
|
12844 | read = prefix;
|
12845 | } else
|
12846 | read = prefix;
|
12847 | var abs = this._makeAbs(read);
|
12848 | if (childrenIgnored(this, read))
|
12849 | return;
|
12850 | var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
12851 | if (isGlobStar)
|
12852 | this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
|
12853 | else
|
12854 | this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
|
12855 | };
|
12856 | GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
|
12857 | var entries = this._readdir(abs, inGlobStar);
|
12858 | if (!entries)
|
12859 | return;
|
12860 | var pn = remain[0];
|
12861 | var negate = !!this.minimatch.negate;
|
12862 | var rawGlob = pn._glob;
|
12863 | var dotOk = this.dot || rawGlob.charAt(0) === ".";
|
12864 | var matchedEntries = [];
|
12865 | for (var i = 0; i < entries.length; i++) {
|
12866 | var e = entries[i];
|
12867 | if (e.charAt(0) !== "." || dotOk) {
|
12868 | var m;
|
12869 | if (negate && !prefix) {
|
12870 | m = !e.match(pn);
|
12871 | } else {
|
12872 | m = e.match(pn);
|
12873 | }
|
12874 | if (m)
|
12875 | matchedEntries.push(e);
|
12876 | }
|
12877 | }
|
12878 | var len = matchedEntries.length;
|
12879 | if (len === 0)
|
12880 | return;
|
12881 | if (remain.length === 1 && !this.mark && !this.stat) {
|
12882 | if (!this.matches[index])
|
12883 | this.matches[index] = Object.create(null);
|
12884 | for (var i = 0; i < len; i++) {
|
12885 | var e = matchedEntries[i];
|
12886 | if (prefix) {
|
12887 | if (prefix.slice(-1) !== "/")
|
12888 | e = prefix + "/" + e;
|
12889 | else
|
12890 | e = prefix + e;
|
12891 | }
|
12892 | if (e.charAt(0) === "/" && !this.nomount) {
|
12893 | e = path.join(this.root, e);
|
12894 | }
|
12895 | this._emitMatch(index, e);
|
12896 | }
|
12897 | return;
|
12898 | }
|
12899 | remain.shift();
|
12900 | for (var i = 0; i < len; i++) {
|
12901 | var e = matchedEntries[i];
|
12902 | var newPattern;
|
12903 | if (prefix)
|
12904 | newPattern = [prefix, e];
|
12905 | else
|
12906 | newPattern = [e];
|
12907 | this._process(newPattern.concat(remain), index, inGlobStar);
|
12908 | }
|
12909 | };
|
12910 | GlobSync.prototype._emitMatch = function(index, e) {
|
12911 | if (isIgnored(this, e))
|
12912 | return;
|
12913 | var abs = this._makeAbs(e);
|
12914 | if (this.mark)
|
12915 | e = this._mark(e);
|
12916 | if (this.absolute) {
|
12917 | e = abs;
|
12918 | }
|
12919 | if (this.matches[index][e])
|
12920 | return;
|
12921 | if (this.nodir) {
|
12922 | var c = this.cache[abs];
|
12923 | if (c === "DIR" || Array.isArray(c))
|
12924 | return;
|
12925 | }
|
12926 | this.matches[index][e] = true;
|
12927 | if (this.stat)
|
12928 | this._stat(e);
|
12929 | };
|
12930 | GlobSync.prototype._readdirInGlobStar = function(abs) {
|
12931 | if (this.follow)
|
12932 | return this._readdir(abs, false);
|
12933 | var entries;
|
12934 | var lstat;
|
12935 | var stat;
|
12936 | try {
|
12937 | lstat = this.fs.lstatSync(abs);
|
12938 | } catch (er) {
|
12939 | if (er.code === "ENOENT") {
|
12940 | return null;
|
12941 | }
|
12942 | }
|
12943 | var isSym = lstat && lstat.isSymbolicLink();
|
12944 | this.symlinks[abs] = isSym;
|
12945 | if (!isSym && lstat && !lstat.isDirectory())
|
12946 | this.cache[abs] = "FILE";
|
12947 | else
|
12948 | entries = this._readdir(abs, false);
|
12949 | return entries;
|
12950 | };
|
12951 | GlobSync.prototype._readdir = function(abs, inGlobStar) {
|
12952 | var entries;
|
12953 | if (inGlobStar && !ownProp(this.symlinks, abs))
|
12954 | return this._readdirInGlobStar(abs);
|
12955 | if (ownProp(this.cache, abs)) {
|
12956 | var c = this.cache[abs];
|
12957 | if (!c || c === "FILE")
|
12958 | return null;
|
12959 | if (Array.isArray(c))
|
12960 | return c;
|
12961 | }
|
12962 | try {
|
12963 | return this._readdirEntries(abs, this.fs.readdirSync(abs));
|
12964 | } catch (er) {
|
12965 | this._readdirError(abs, er);
|
12966 | return null;
|
12967 | }
|
12968 | };
|
12969 | GlobSync.prototype._readdirEntries = function(abs, entries) {
|
12970 | if (!this.mark && !this.stat) {
|
12971 | for (var i = 0; i < entries.length; i++) {
|
12972 | var e = entries[i];
|
12973 | if (abs === "/")
|
12974 | e = abs + e;
|
12975 | else
|
12976 | e = abs + "/" + e;
|
12977 | this.cache[e] = true;
|
12978 | }
|
12979 | }
|
12980 | this.cache[abs] = entries;
|
12981 | return entries;
|
12982 | };
|
12983 | GlobSync.prototype._readdirError = function(f, er) {
|
12984 | switch (er.code) {
|
12985 | case "ENOTSUP":
|
12986 | case "ENOTDIR":
|
12987 | var abs = this._makeAbs(f);
|
12988 | this.cache[abs] = "FILE";
|
12989 | if (abs === this.cwdAbs) {
|
12990 | var error = new Error(er.code + " invalid cwd " + this.cwd);
|
12991 | error.path = this.cwd;
|
12992 | error.code = er.code;
|
12993 | throw error;
|
12994 | }
|
12995 | break;
|
12996 | case "ENOENT":
|
12997 | case "ELOOP":
|
12998 | case "ENAMETOOLONG":
|
12999 | case "UNKNOWN":
|
13000 | this.cache[this._makeAbs(f)] = false;
|
13001 | break;
|
13002 | default:
|
13003 | this.cache[this._makeAbs(f)] = false;
|
13004 | if (this.strict)
|
13005 | throw er;
|
13006 | if (!this.silent)
|
13007 | console.error("glob error", er);
|
13008 | break;
|
13009 | }
|
13010 | };
|
13011 | GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
|
13012 | var entries = this._readdir(abs, inGlobStar);
|
13013 | if (!entries)
|
13014 | return;
|
13015 | var remainWithoutGlobStar = remain.slice(1);
|
13016 | var gspref = prefix ? [prefix] : [];
|
13017 | var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
13018 | this._process(noGlobStar, index, false);
|
13019 | var len = entries.length;
|
13020 | var isSym = this.symlinks[abs];
|
13021 | if (isSym && inGlobStar)
|
13022 | return;
|
13023 | for (var i = 0; i < len; i++) {
|
13024 | var e = entries[i];
|
13025 | if (e.charAt(0) === "." && !this.dot)
|
13026 | continue;
|
13027 | var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
13028 | this._process(instead, index, true);
|
13029 | var below = gspref.concat(entries[i], remain);
|
13030 | this._process(below, index, true);
|
13031 | }
|
13032 | };
|
13033 | GlobSync.prototype._processSimple = function(prefix, index) {
|
13034 | var exists = this._stat(prefix);
|
13035 | if (!this.matches[index])
|
13036 | this.matches[index] = Object.create(null);
|
13037 | if (!exists)
|
13038 | return;
|
13039 | if (prefix && isAbsolute(prefix) && !this.nomount) {
|
13040 | var trail = /[\/\\]$/.test(prefix);
|
13041 | if (prefix.charAt(0) === "/") {
|
13042 | prefix = path.join(this.root, prefix);
|
13043 | } else {
|
13044 | prefix = path.resolve(this.root, prefix);
|
13045 | if (trail)
|
13046 | prefix += "/";
|
13047 | }
|
13048 | }
|
13049 | if (process.platform === "win32")
|
13050 | prefix = prefix.replace(/\\/g, "/");
|
13051 | this._emitMatch(index, prefix);
|
13052 | };
|
13053 | GlobSync.prototype._stat = function(f) {
|
13054 | var abs = this._makeAbs(f);
|
13055 | var needDir = f.slice(-1) === "/";
|
13056 | if (f.length > this.maxLength)
|
13057 | return false;
|
13058 | if (!this.stat && ownProp(this.cache, abs)) {
|
13059 | var c = this.cache[abs];
|
13060 | if (Array.isArray(c))
|
13061 | c = "DIR";
|
13062 | if (!needDir || c === "DIR")
|
13063 | return c;
|
13064 | if (needDir && c === "FILE")
|
13065 | return false;
|
13066 | }
|
13067 | var exists;
|
13068 | var stat = this.statCache[abs];
|
13069 | if (!stat) {
|
13070 | var lstat;
|
13071 | try {
|
13072 | lstat = this.fs.lstatSync(abs);
|
13073 | } catch (er) {
|
13074 | if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
|
13075 | this.statCache[abs] = false;
|
13076 | return false;
|
13077 | }
|
13078 | }
|
13079 | if (lstat && lstat.isSymbolicLink()) {
|
13080 | try {
|
13081 | stat = this.fs.statSync(abs);
|
13082 | } catch (er) {
|
13083 | stat = lstat;
|
13084 | }
|
13085 | } else {
|
13086 | stat = lstat;
|
13087 | }
|
13088 | }
|
13089 | this.statCache[abs] = stat;
|
13090 | var c = true;
|
13091 | if (stat)
|
13092 | c = stat.isDirectory() ? "DIR" : "FILE";
|
13093 | this.cache[abs] = this.cache[abs] || c;
|
13094 | if (needDir && c === "FILE")
|
13095 | return false;
|
13096 | return c;
|
13097 | };
|
13098 | GlobSync.prototype._mark = function(p) {
|
13099 | return common.mark(this, p);
|
13100 | };
|
13101 | GlobSync.prototype._makeAbs = function(f) {
|
13102 | return common.makeAbs(this, f);
|
13103 | };
|
13104 | }
|
13105 | });
|
13106 | var require_wrappy = __commonJS2({
|
13107 | "node_modules/wrappy/wrappy.js"(exports2, module2) {
|
13108 | module2.exports = wrappy;
|
13109 | function wrappy(fn, cb) {
|
13110 | if (fn && cb)
|
13111 | return wrappy(fn)(cb);
|
13112 | if (typeof fn !== "function")
|
13113 | throw new TypeError("need wrapper function");
|
13114 | Object.keys(fn).forEach(function(k) {
|
13115 | wrapper[k] = fn[k];
|
13116 | });
|
13117 | return wrapper;
|
13118 | function wrapper() {
|
13119 | var args = new Array(arguments.length);
|
13120 | for (var i = 0; i < args.length; i++) {
|
13121 | args[i] = arguments[i];
|
13122 | }
|
13123 | var ret = fn.apply(this, args);
|
13124 | var cb2 = args[args.length - 1];
|
13125 | if (typeof ret === "function" && ret !== cb2) {
|
13126 | Object.keys(cb2).forEach(function(k) {
|
13127 | ret[k] = cb2[k];
|
13128 | });
|
13129 | }
|
13130 | return ret;
|
13131 | }
|
13132 | }
|
13133 | }
|
13134 | });
|
13135 | var require_once = __commonJS2({
|
13136 | "node_modules/once/once.js"(exports2, module2) {
|
13137 | var wrappy = require_wrappy();
|
13138 | module2.exports = wrappy(once);
|
13139 | module2.exports.strict = wrappy(onceStrict);
|
13140 | once.proto = once(function() {
|
13141 | Object.defineProperty(Function.prototype, "once", {
|
13142 | value: function() {
|
13143 | return once(this);
|
13144 | },
|
13145 | configurable: true
|
13146 | });
|
13147 | Object.defineProperty(Function.prototype, "onceStrict", {
|
13148 | value: function() {
|
13149 | return onceStrict(this);
|
13150 | },
|
13151 | configurable: true
|
13152 | });
|
13153 | });
|
13154 | function once(fn) {
|
13155 | var f = function() {
|
13156 | if (f.called)
|
13157 | return f.value;
|
13158 | f.called = true;
|
13159 | return f.value = fn.apply(this, arguments);
|
13160 | };
|
13161 | f.called = false;
|
13162 | return f;
|
13163 | }
|
13164 | function onceStrict(fn) {
|
13165 | var f = function() {
|
13166 | if (f.called)
|
13167 | throw new Error(f.onceError);
|
13168 | f.called = true;
|
13169 | return f.value = fn.apply(this, arguments);
|
13170 | };
|
13171 | var name = fn.name || "Function wrapped with `once`";
|
13172 | f.onceError = name + " shouldn't be called more than once";
|
13173 | f.called = false;
|
13174 | return f;
|
13175 | }
|
13176 | }
|
13177 | });
|
13178 | var require_inflight = __commonJS2({
|
13179 | "node_modules/inflight/inflight.js"(exports2, module2) {
|
13180 | var wrappy = require_wrappy();
|
13181 | var reqs = Object.create(null);
|
13182 | var once = require_once();
|
13183 | module2.exports = wrappy(inflight);
|
13184 | function inflight(key, cb) {
|
13185 | if (reqs[key]) {
|
13186 | reqs[key].push(cb);
|
13187 | return null;
|
13188 | } else {
|
13189 | reqs[key] = [cb];
|
13190 | return makeres(key);
|
13191 | }
|
13192 | }
|
13193 | function makeres(key) {
|
13194 | return once(function RES() {
|
13195 | var cbs = reqs[key];
|
13196 | var len = cbs.length;
|
13197 | var args = slice(arguments);
|
13198 | try {
|
13199 | for (var i = 0; i < len; i++) {
|
13200 | cbs[i].apply(null, args);
|
13201 | }
|
13202 | } finally {
|
13203 | if (cbs.length > len) {
|
13204 | cbs.splice(0, len);
|
13205 | process.nextTick(function() {
|
13206 | RES.apply(null, args);
|
13207 | });
|
13208 | } else {
|
13209 | delete reqs[key];
|
13210 | }
|
13211 | }
|
13212 | });
|
13213 | }
|
13214 | function slice(args) {
|
13215 | var length = args.length;
|
13216 | var array2 = [];
|
13217 | for (var i = 0; i < length; i++)
|
13218 | array2[i] = args[i];
|
13219 | return array2;
|
13220 | }
|
13221 | }
|
13222 | });
|
13223 | var require_glob = __commonJS2({
|
13224 | "node_modules/glob/glob.js"(exports2, module2) {
|
13225 | module2.exports = glob;
|
13226 | var rp = require_fs5();
|
13227 | var minimatch = require_minimatch();
|
13228 | var Minimatch = minimatch.Minimatch;
|
13229 | var inherits = require_inherits();
|
13230 | var EE = require("events").EventEmitter;
|
13231 | var path = require("path");
|
13232 | var assert = require("assert");
|
13233 | var isAbsolute = require_path_is_absolute();
|
13234 | var globSync = require_sync7();
|
13235 | var common = require_common3();
|
13236 | var setopts = common.setopts;
|
13237 | var ownProp = common.ownProp;
|
13238 | var inflight = require_inflight();
|
13239 | var util = require("util");
|
13240 | var childrenIgnored = common.childrenIgnored;
|
13241 | var isIgnored = common.isIgnored;
|
13242 | var once = require_once();
|
13243 | function glob(pattern, options, cb) {
|
13244 | if (typeof options === "function")
|
13245 | cb = options, options = {};
|
13246 | if (!options)
|
13247 | options = {};
|
13248 | if (options.sync) {
|
13249 | if (cb)
|
13250 | throw new TypeError("callback provided to sync glob");
|
13251 | return globSync(pattern, options);
|
13252 | }
|
13253 | return new Glob(pattern, options, cb);
|
13254 | }
|
13255 | glob.sync = globSync;
|
13256 | var GlobSync = glob.GlobSync = globSync.GlobSync;
|
13257 | glob.glob = glob;
|
13258 | function extend(origin, add) {
|
13259 | if (add === null || typeof add !== "object") {
|
13260 | return origin;
|
13261 | }
|
13262 | var keys = Object.keys(add);
|
13263 | var i = keys.length;
|
13264 | while (i--) {
|
13265 | origin[keys[i]] = add[keys[i]];
|
13266 | }
|
13267 | return origin;
|
13268 | }
|
13269 | glob.hasMagic = function(pattern, options_) {
|
13270 | var options = extend({}, options_);
|
13271 | options.noprocess = true;
|
13272 | var g = new Glob(pattern, options);
|
13273 | var set = g.minimatch.set;
|
13274 | if (!pattern)
|
13275 | return false;
|
13276 | if (set.length > 1)
|
13277 | return true;
|
13278 | for (var j = 0; j < set[0].length; j++) {
|
13279 | if (typeof set[0][j] !== "string")
|
13280 | return true;
|
13281 | }
|
13282 | return false;
|
13283 | };
|
13284 | glob.Glob = Glob;
|
13285 | inherits(Glob, EE);
|
13286 | function Glob(pattern, options, cb) {
|
13287 | if (typeof options === "function") {
|
13288 | cb = options;
|
13289 | options = null;
|
13290 | }
|
13291 | if (options && options.sync) {
|
13292 | if (cb)
|
13293 | throw new TypeError("callback provided to sync glob");
|
13294 | return new GlobSync(pattern, options);
|
13295 | }
|
13296 | if (!(this instanceof Glob))
|
13297 | return new Glob(pattern, options, cb);
|
13298 | setopts(this, pattern, options);
|
13299 | this._didRealPath = false;
|
13300 | var n = this.minimatch.set.length;
|
13301 | this.matches = new Array(n);
|
13302 | if (typeof cb === "function") {
|
13303 | cb = once(cb);
|
13304 | this.on("error", cb);
|
13305 | this.on("end", function(matches) {
|
13306 | cb(null, matches);
|
13307 | });
|
13308 | }
|
13309 | var self2 = this;
|
13310 | this._processing = 0;
|
13311 | this._emitQueue = [];
|
13312 | this._processQueue = [];
|
13313 | this.paused = false;
|
13314 | if (this.noprocess)
|
13315 | return this;
|
13316 | if (n === 0)
|
13317 | return done();
|
13318 | var sync = true;
|
13319 | for (var i = 0; i < n; i++) {
|
13320 | this._process(this.minimatch.set[i], i, false, done);
|
13321 | }
|
13322 | sync = false;
|
13323 | function done() {
|
13324 | --self2._processing;
|
13325 | if (self2._processing <= 0) {
|
13326 | if (sync) {
|
13327 | process.nextTick(function() {
|
13328 | self2._finish();
|
13329 | });
|
13330 | } else {
|
13331 | self2._finish();
|
13332 | }
|
13333 | }
|
13334 | }
|
13335 | }
|
13336 | Glob.prototype._finish = function() {
|
13337 | assert(this instanceof Glob);
|
13338 | if (this.aborted)
|
13339 | return;
|
13340 | if (this.realpath && !this._didRealpath)
|
13341 | return this._realpath();
|
13342 | common.finish(this);
|
13343 | this.emit("end", this.found);
|
13344 | };
|
13345 | Glob.prototype._realpath = function() {
|
13346 | if (this._didRealpath)
|
13347 | return;
|
13348 | this._didRealpath = true;
|
13349 | var n = this.matches.length;
|
13350 | if (n === 0)
|
13351 | return this._finish();
|
13352 | var self2 = this;
|
13353 | for (var i = 0; i < this.matches.length; i++)
|
13354 | this._realpathSet(i, next);
|
13355 | function next() {
|
13356 | if (--n === 0)
|
13357 | self2._finish();
|
13358 | }
|
13359 | };
|
13360 | Glob.prototype._realpathSet = function(index, cb) {
|
13361 | var matchset = this.matches[index];
|
13362 | if (!matchset)
|
13363 | return cb();
|
13364 | var found = Object.keys(matchset);
|
13365 | var self2 = this;
|
13366 | var n = found.length;
|
13367 | if (n === 0)
|
13368 | return cb();
|
13369 | var set = this.matches[index] = /* @__PURE__ */ Object.create(null);
|
13370 | found.forEach(function(p, i) {
|
13371 | p = self2._makeAbs(p);
|
13372 | rp.realpath(p, self2.realpathCache, function(er, real) {
|
13373 | if (!er)
|
13374 | set[real] = true;
|
13375 | else if (er.syscall === "stat")
|
13376 | set[p] = true;
|
13377 | else
|
13378 | self2.emit("error", er);
|
13379 | if (--n === 0) {
|
13380 | self2.matches[index] = set;
|
13381 | cb();
|
13382 | }
|
13383 | });
|
13384 | });
|
13385 | };
|
13386 | Glob.prototype._mark = function(p) {
|
13387 | return common.mark(this, p);
|
13388 | };
|
13389 | Glob.prototype._makeAbs = function(f) {
|
13390 | return common.makeAbs(this, f);
|
13391 | };
|
13392 | Glob.prototype.abort = function() {
|
13393 | this.aborted = true;
|
13394 | this.emit("abort");
|
13395 | };
|
13396 | Glob.prototype.pause = function() {
|
13397 | if (!this.paused) {
|
13398 | this.paused = true;
|
13399 | this.emit("pause");
|
13400 | }
|
13401 | };
|
13402 | Glob.prototype.resume = function() {
|
13403 | if (this.paused) {
|
13404 | this.emit("resume");
|
13405 | this.paused = false;
|
13406 | if (this._emitQueue.length) {
|
13407 | var eq = this._emitQueue.slice(0);
|
13408 | this._emitQueue.length = 0;
|
13409 | for (var i = 0; i < eq.length; i++) {
|
13410 | var e = eq[i];
|
13411 | this._emitMatch(e[0], e[1]);
|
13412 | }
|
13413 | }
|
13414 | if (this._processQueue.length) {
|
13415 | var pq = this._processQueue.slice(0);
|
13416 | this._processQueue.length = 0;
|
13417 | for (var i = 0; i < pq.length; i++) {
|
13418 | var p = pq[i];
|
13419 | this._processing--;
|
13420 | this._process(p[0], p[1], p[2], p[3]);
|
13421 | }
|
13422 | }
|
13423 | }
|
13424 | };
|
13425 | Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
|
13426 | assert(this instanceof Glob);
|
13427 | assert(typeof cb === "function");
|
13428 | if (this.aborted)
|
13429 | return;
|
13430 | this._processing++;
|
13431 | if (this.paused) {
|
13432 | this._processQueue.push([pattern, index, inGlobStar, cb]);
|
13433 | return;
|
13434 | }
|
13435 | var n = 0;
|
13436 | while (typeof pattern[n] === "string") {
|
13437 | n++;
|
13438 | }
|
13439 | var prefix;
|
13440 | switch (n) {
|
13441 | case pattern.length:
|
13442 | this._processSimple(pattern.join("/"), index, cb);
|
13443 | return;
|
13444 | case 0:
|
13445 | prefix = null;
|
13446 | break;
|
13447 | default:
|
13448 | prefix = pattern.slice(0, n).join("/");
|
13449 | break;
|
13450 | }
|
13451 | var remain = pattern.slice(n);
|
13452 | var read;
|
13453 | if (prefix === null)
|
13454 | read = ".";
|
13455 | else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
13456 | return typeof p === "string" ? p : "[*]";
|
13457 | }).join("/"))) {
|
13458 | if (!prefix || !isAbsolute(prefix))
|
13459 | prefix = "/" + prefix;
|
13460 | read = prefix;
|
13461 | } else
|
13462 | read = prefix;
|
13463 | var abs = this._makeAbs(read);
|
13464 | if (childrenIgnored(this, read))
|
13465 | return cb();
|
13466 | var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
13467 | if (isGlobStar)
|
13468 | this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
|
13469 | else
|
13470 | this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
|
13471 | };
|
13472 | Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
|
13473 | var self2 = this;
|
13474 | this._readdir(abs, inGlobStar, function(er, entries) {
|
13475 | return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
|
13476 | });
|
13477 | };
|
13478 | Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
13479 | if (!entries)
|
13480 | return cb();
|
13481 | var pn = remain[0];
|
13482 | var negate = !!this.minimatch.negate;
|
13483 | var rawGlob = pn._glob;
|
13484 | var dotOk = this.dot || rawGlob.charAt(0) === ".";
|
13485 | var matchedEntries = [];
|
13486 | for (var i = 0; i < entries.length; i++) {
|
13487 | var e = entries[i];
|
13488 | if (e.charAt(0) !== "." || dotOk) {
|
13489 | var m;
|
13490 | if (negate && !prefix) {
|
13491 | m = !e.match(pn);
|
13492 | } else {
|
13493 | m = e.match(pn);
|
13494 | }
|
13495 | if (m)
|
13496 | matchedEntries.push(e);
|
13497 | }
|
13498 | }
|
13499 | var len = matchedEntries.length;
|
13500 | if (len === 0)
|
13501 | return cb();
|
13502 | if (remain.length === 1 && !this.mark && !this.stat) {
|
13503 | if (!this.matches[index])
|
13504 | this.matches[index] = Object.create(null);
|
13505 | for (var i = 0; i < len; i++) {
|
13506 | var e = matchedEntries[i];
|
13507 | if (prefix) {
|
13508 | if (prefix !== "/")
|
13509 | e = prefix + "/" + e;
|
13510 | else
|
13511 | e = prefix + e;
|
13512 | }
|
13513 | if (e.charAt(0) === "/" && !this.nomount) {
|
13514 | e = path.join(this.root, e);
|
13515 | }
|
13516 | this._emitMatch(index, e);
|
13517 | }
|
13518 | return cb();
|
13519 | }
|
13520 | remain.shift();
|
13521 | for (var i = 0; i < len; i++) {
|
13522 | var e = matchedEntries[i];
|
13523 | var newPattern;
|
13524 | if (prefix) {
|
13525 | if (prefix !== "/")
|
13526 | e = prefix + "/" + e;
|
13527 | else
|
13528 | e = prefix + e;
|
13529 | }
|
13530 | this._process([e].concat(remain), index, inGlobStar, cb);
|
13531 | }
|
13532 | cb();
|
13533 | };
|
13534 | Glob.prototype._emitMatch = function(index, e) {
|
13535 | if (this.aborted)
|
13536 | return;
|
13537 | if (isIgnored(this, e))
|
13538 | return;
|
13539 | if (this.paused) {
|
13540 | this._emitQueue.push([index, e]);
|
13541 | return;
|
13542 | }
|
13543 | var abs = isAbsolute(e) ? e : this._makeAbs(e);
|
13544 | if (this.mark)
|
13545 | e = this._mark(e);
|
13546 | if (this.absolute)
|
13547 | e = abs;
|
13548 | if (this.matches[index][e])
|
13549 | return;
|
13550 | if (this.nodir) {
|
13551 | var c = this.cache[abs];
|
13552 | if (c === "DIR" || Array.isArray(c))
|
13553 | return;
|
13554 | }
|
13555 | this.matches[index][e] = true;
|
13556 | var st = this.statCache[abs];
|
13557 | if (st)
|
13558 | this.emit("stat", e, st);
|
13559 | this.emit("match", e);
|
13560 | };
|
13561 | Glob.prototype._readdirInGlobStar = function(abs, cb) {
|
13562 | if (this.aborted)
|
13563 | return;
|
13564 | if (this.follow)
|
13565 | return this._readdir(abs, false, cb);
|
13566 | var lstatkey = "lstat\0" + abs;
|
13567 | var self2 = this;
|
13568 | var lstatcb = inflight(lstatkey, lstatcb_);
|
13569 | if (lstatcb)
|
13570 | self2.fs.lstat(abs, lstatcb);
|
13571 | function lstatcb_(er, lstat) {
|
13572 | if (er && er.code === "ENOENT")
|
13573 | return cb();
|
13574 | var isSym = lstat && lstat.isSymbolicLink();
|
13575 | self2.symlinks[abs] = isSym;
|
13576 | if (!isSym && lstat && !lstat.isDirectory()) {
|
13577 | self2.cache[abs] = "FILE";
|
13578 | cb();
|
13579 | } else
|
13580 | self2._readdir(abs, false, cb);
|
13581 | }
|
13582 | };
|
13583 | Glob.prototype._readdir = function(abs, inGlobStar, cb) {
|
13584 | if (this.aborted)
|
13585 | return;
|
13586 | cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
|
13587 | if (!cb)
|
13588 | return;
|
13589 | if (inGlobStar && !ownProp(this.symlinks, abs))
|
13590 | return this._readdirInGlobStar(abs, cb);
|
13591 | if (ownProp(this.cache, abs)) {
|
13592 | var c = this.cache[abs];
|
13593 | if (!c || c === "FILE")
|
13594 | return cb();
|
13595 | if (Array.isArray(c))
|
13596 | return cb(null, c);
|
13597 | }
|
13598 | var self2 = this;
|
13599 | self2.fs.readdir(abs, readdirCb(this, abs, cb));
|
13600 | };
|
13601 | function readdirCb(self2, abs, cb) {
|
13602 | return function(er, entries) {
|
13603 | if (er)
|
13604 | self2._readdirError(abs, er, cb);
|
13605 | else
|
13606 | self2._readdirEntries(abs, entries, cb);
|
13607 | };
|
13608 | }
|
13609 | Glob.prototype._readdirEntries = function(abs, entries, cb) {
|
13610 | if (this.aborted)
|
13611 | return;
|
13612 | if (!this.mark && !this.stat) {
|
13613 | for (var i = 0; i < entries.length; i++) {
|
13614 | var e = entries[i];
|
13615 | if (abs === "/")
|
13616 | e = abs + e;
|
13617 | else
|
13618 | e = abs + "/" + e;
|
13619 | this.cache[e] = true;
|
13620 | }
|
13621 | }
|
13622 | this.cache[abs] = entries;
|
13623 | return cb(null, entries);
|
13624 | };
|
13625 | Glob.prototype._readdirError = function(f, er, cb) {
|
13626 | if (this.aborted)
|
13627 | return;
|
13628 | switch (er.code) {
|
13629 | case "ENOTSUP":
|
13630 | case "ENOTDIR":
|
13631 | var abs = this._makeAbs(f);
|
13632 | this.cache[abs] = "FILE";
|
13633 | if (abs === this.cwdAbs) {
|
13634 | var error = new Error(er.code + " invalid cwd " + this.cwd);
|
13635 | error.path = this.cwd;
|
13636 | error.code = er.code;
|
13637 | this.emit("error", error);
|
13638 | this.abort();
|
13639 | }
|
13640 | break;
|
13641 | case "ENOENT":
|
13642 | case "ELOOP":
|
13643 | case "ENAMETOOLONG":
|
13644 | case "UNKNOWN":
|
13645 | this.cache[this._makeAbs(f)] = false;
|
13646 | break;
|
13647 | default:
|
13648 | this.cache[this._makeAbs(f)] = false;
|
13649 | if (this.strict) {
|
13650 | this.emit("error", er);
|
13651 | this.abort();
|
13652 | }
|
13653 | if (!this.silent)
|
13654 | console.error("glob error", er);
|
13655 | break;
|
13656 | }
|
13657 | return cb();
|
13658 | };
|
13659 | Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
|
13660 | var self2 = this;
|
13661 | this._readdir(abs, inGlobStar, function(er, entries) {
|
13662 | self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
|
13663 | });
|
13664 | };
|
13665 | Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
13666 | if (!entries)
|
13667 | return cb();
|
13668 | var remainWithoutGlobStar = remain.slice(1);
|
13669 | var gspref = prefix ? [prefix] : [];
|
13670 | var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
13671 | this._process(noGlobStar, index, false, cb);
|
13672 | var isSym = this.symlinks[abs];
|
13673 | var len = entries.length;
|
13674 | if (isSym && inGlobStar)
|
13675 | return cb();
|
13676 | for (var i = 0; i < len; i++) {
|
13677 | var e = entries[i];
|
13678 | if (e.charAt(0) === "." && !this.dot)
|
13679 | continue;
|
13680 | var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
13681 | this._process(instead, index, true, cb);
|
13682 | var below = gspref.concat(entries[i], remain);
|
13683 | this._process(below, index, true, cb);
|
13684 | }
|
13685 | cb();
|
13686 | };
|
13687 | Glob.prototype._processSimple = function(prefix, index, cb) {
|
13688 | var self2 = this;
|
13689 | this._stat(prefix, function(er, exists) {
|
13690 | self2._processSimple2(prefix, index, er, exists, cb);
|
13691 | });
|
13692 | };
|
13693 | Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
|
13694 | if (!this.matches[index])
|
13695 | this.matches[index] = Object.create(null);
|
13696 | if (!exists)
|
13697 | return cb();
|
13698 | if (prefix && isAbsolute(prefix) && !this.nomount) {
|
13699 | var trail = /[\/\\]$/.test(prefix);
|
13700 | if (prefix.charAt(0) === "/") {
|
13701 | prefix = path.join(this.root, prefix);
|
13702 | } else {
|
13703 | prefix = path.resolve(this.root, prefix);
|
13704 | if (trail)
|
13705 | prefix += "/";
|
13706 | }
|
13707 | }
|
13708 | if (process.platform === "win32")
|
13709 | prefix = prefix.replace(/\\/g, "/");
|
13710 | this._emitMatch(index, prefix);
|
13711 | cb();
|
13712 | };
|
13713 | Glob.prototype._stat = function(f, cb) {
|
13714 | var abs = this._makeAbs(f);
|
13715 | var needDir = f.slice(-1) === "/";
|
13716 | if (f.length > this.maxLength)
|
13717 | return cb();
|
13718 | if (!this.stat && ownProp(this.cache, abs)) {
|
13719 | var c = this.cache[abs];
|
13720 | if (Array.isArray(c))
|
13721 | c = "DIR";
|
13722 | if (!needDir || c === "DIR")
|
13723 | return cb(null, c);
|
13724 | if (needDir && c === "FILE")
|
13725 | return cb();
|
13726 | }
|
13727 | var exists;
|
13728 | var stat = this.statCache[abs];
|
13729 | if (stat !== void 0) {
|
13730 | if (stat === false)
|
13731 | return cb(null, stat);
|
13732 | else {
|
13733 | var type = stat.isDirectory() ? "DIR" : "FILE";
|
13734 | if (needDir && type === "FILE")
|
13735 | return cb();
|
13736 | else
|
13737 | return cb(null, type, stat);
|
13738 | }
|
13739 | }
|
13740 | var self2 = this;
|
13741 | var statcb = inflight("stat\0" + abs, lstatcb_);
|
13742 | if (statcb)
|
13743 | self2.fs.lstat(abs, statcb);
|
13744 | function lstatcb_(er, lstat) {
|
13745 | if (lstat && lstat.isSymbolicLink()) {
|
13746 | return self2.fs.stat(abs, function(er2, stat2) {
|
13747 | if (er2)
|
13748 | self2._stat2(f, abs, null, lstat, cb);
|
13749 | else
|
13750 | self2._stat2(f, abs, er2, stat2, cb);
|
13751 | });
|
13752 | } else {
|
13753 | self2._stat2(f, abs, er, lstat, cb);
|
13754 | }
|
13755 | }
|
13756 | };
|
13757 | Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
|
13758 | if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
|
13759 | this.statCache[abs] = false;
|
13760 | return cb();
|
13761 | }
|
13762 | var needDir = f.slice(-1) === "/";
|
13763 | this.statCache[abs] = stat;
|
13764 | if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
|
13765 | return cb(null, false, stat);
|
13766 | var c = true;
|
13767 | if (stat)
|
13768 | c = stat.isDirectory() ? "DIR" : "FILE";
|
13769 | this.cache[abs] = this.cache[abs] || c;
|
13770 | if (needDir && c === "FILE")
|
13771 | return cb();
|
13772 | return cb(null, c, stat);
|
13773 | };
|
13774 | }
|
13775 | });
|
13776 | var require_rimraf = __commonJS2({
|
13777 | "node_modules/rimraf/rimraf.js"(exports2, module2) {
|
13778 | var assert = require("assert");
|
13779 | var path = require("path");
|
13780 | var fs = require("fs");
|
13781 | var glob = void 0;
|
13782 | try {
|
13783 | glob = require_glob();
|
13784 | } catch (_err) {
|
13785 | }
|
13786 | var defaultGlobOpts = {
|
13787 | nosort: true,
|
13788 | silent: true
|
13789 | };
|
13790 | var timeout = 0;
|
13791 | var isWindows = process.platform === "win32";
|
13792 | var defaults = (options) => {
|
13793 | const methods = ["unlink", "chmod", "stat", "lstat", "rmdir", "readdir"];
|
13794 | methods.forEach((m) => {
|
13795 | options[m] = options[m] || fs[m];
|
13796 | m = m + "Sync";
|
13797 | options[m] = options[m] || fs[m];
|
13798 | });
|
13799 | options.maxBusyTries = options.maxBusyTries || 3;
|
13800 | options.emfileWait = options.emfileWait || 1e3;
|
13801 | if (options.glob === false) {
|
13802 | options.disableGlob = true;
|
13803 | }
|
13804 | if (options.disableGlob !== true && glob === void 0) {
|
13805 | throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
|
13806 | }
|
13807 | options.disableGlob = options.disableGlob || false;
|
13808 | options.glob = options.glob || defaultGlobOpts;
|
13809 | };
|
13810 | var rimraf = (p, options, cb) => {
|
13811 | if (typeof options === "function") {
|
13812 | cb = options;
|
13813 | options = {};
|
13814 | }
|
13815 | assert(p, "rimraf: missing path");
|
13816 | assert.equal(typeof p, "string", "rimraf: path should be a string");
|
13817 | assert.equal(typeof cb, "function", "rimraf: callback function required");
|
13818 | assert(options, "rimraf: invalid options argument provided");
|
13819 | assert.equal(typeof options, "object", "rimraf: options should be object");
|
13820 | defaults(options);
|
13821 | let busyTries = 0;
|
13822 | let errState = null;
|
13823 | let n = 0;
|
13824 | const next = (er) => {
|
13825 | errState = errState || er;
|
13826 | if (--n === 0)
|
13827 | cb(errState);
|
13828 | };
|
13829 | const afterGlob = (er, results) => {
|
13830 | if (er)
|
13831 | return cb(er);
|
13832 | n = results.length;
|
13833 | if (n === 0)
|
13834 | return cb();
|
13835 | results.forEach((p2) => {
|
13836 | const CB = (er2) => {
|
13837 | if (er2) {
|
13838 | if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
|
13839 | busyTries++;
|
13840 | return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100);
|
13841 | }
|
13842 | if (er2.code === "EMFILE" && timeout < options.emfileWait) {
|
13843 | return setTimeout(() => rimraf_(p2, options, CB), timeout++);
|
13844 | }
|
13845 | if (er2.code === "ENOENT")
|
13846 | er2 = null;
|
13847 | }
|
13848 | timeout = 0;
|
13849 | next(er2);
|
13850 | };
|
13851 | rimraf_(p2, options, CB);
|
13852 | });
|
13853 | };
|
13854 | if (options.disableGlob || !glob.hasMagic(p))
|
13855 | return afterGlob(null, [p]);
|
13856 | options.lstat(p, (er, stat) => {
|
13857 | if (!er)
|
13858 | return afterGlob(null, [p]);
|
13859 | glob(p, options.glob, afterGlob);
|
13860 | });
|
13861 | };
|
13862 | var rimraf_ = (p, options, cb) => {
|
13863 | assert(p);
|
13864 | assert(options);
|
13865 | assert(typeof cb === "function");
|
13866 | options.lstat(p, (er, st) => {
|
13867 | if (er && er.code === "ENOENT")
|
13868 | return cb(null);
|
13869 | if (er && er.code === "EPERM" && isWindows)
|
13870 | fixWinEPERM(p, options, er, cb);
|
13871 | if (st && st.isDirectory())
|
13872 | return rmdir(p, options, er, cb);
|
13873 | options.unlink(p, (er2) => {
|
13874 | if (er2) {
|
13875 | if (er2.code === "ENOENT")
|
13876 | return cb(null);
|
13877 | if (er2.code === "EPERM")
|
13878 | return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
|
13879 | if (er2.code === "EISDIR")
|
13880 | return rmdir(p, options, er2, cb);
|
13881 | }
|
13882 | return cb(er2);
|
13883 | });
|
13884 | });
|
13885 | };
|
13886 | var fixWinEPERM = (p, options, er, cb) => {
|
13887 | assert(p);
|
13888 | assert(options);
|
13889 | assert(typeof cb === "function");
|
13890 | options.chmod(p, 438, (er2) => {
|
13891 | if (er2)
|
13892 | cb(er2.code === "ENOENT" ? null : er);
|
13893 | else
|
13894 | options.stat(p, (er3, stats) => {
|
13895 | if (er3)
|
13896 | cb(er3.code === "ENOENT" ? null : er);
|
13897 | else if (stats.isDirectory())
|
13898 | rmdir(p, options, er, cb);
|
13899 | else
|
13900 | options.unlink(p, cb);
|
13901 | });
|
13902 | });
|
13903 | };
|
13904 | var fixWinEPERMSync = (p, options, er) => {
|
13905 | assert(p);
|
13906 | assert(options);
|
13907 | try {
|
13908 | options.chmodSync(p, 438);
|
13909 | } catch (er2) {
|
13910 | if (er2.code === "ENOENT")
|
13911 | return;
|
13912 | else
|
13913 | throw er;
|
13914 | }
|
13915 | let stats;
|
13916 | try {
|
13917 | stats = options.statSync(p);
|
13918 | } catch (er3) {
|
13919 | if (er3.code === "ENOENT")
|
13920 | return;
|
13921 | else
|
13922 | throw er;
|
13923 | }
|
13924 | if (stats.isDirectory())
|
13925 | rmdirSync(p, options, er);
|
13926 | else
|
13927 | options.unlinkSync(p);
|
13928 | };
|
13929 | var rmdir = (p, options, originalEr, cb) => {
|
13930 | assert(p);
|
13931 | assert(options);
|
13932 | assert(typeof cb === "function");
|
13933 | options.rmdir(p, (er) => {
|
13934 | if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
|
13935 | rmkids(p, options, cb);
|
13936 | else if (er && er.code === "ENOTDIR")
|
13937 | cb(originalEr);
|
13938 | else
|
13939 | cb(er);
|
13940 | });
|
13941 | };
|
13942 | var rmkids = (p, options, cb) => {
|
13943 | assert(p);
|
13944 | assert(options);
|
13945 | assert(typeof cb === "function");
|
13946 | options.readdir(p, (er, files) => {
|
13947 | if (er)
|
13948 | return cb(er);
|
13949 | let n = files.length;
|
13950 | if (n === 0)
|
13951 | return options.rmdir(p, cb);
|
13952 | let errState;
|
13953 | files.forEach((f) => {
|
13954 | rimraf(path.join(p, f), options, (er2) => {
|
13955 | if (errState)
|
13956 | return;
|
13957 | if (er2)
|
13958 | return cb(errState = er2);
|
13959 | if (--n === 0)
|
13960 | options.rmdir(p, cb);
|
13961 | });
|
13962 | });
|
13963 | });
|
13964 | };
|
13965 | var rimrafSync = (p, options) => {
|
13966 | options = options || {};
|
13967 | defaults(options);
|
13968 | assert(p, "rimraf: missing path");
|
13969 | assert.equal(typeof p, "string", "rimraf: path should be a string");
|
13970 | assert(options, "rimraf: missing options");
|
13971 | assert.equal(typeof options, "object", "rimraf: options should be object");
|
13972 | let results;
|
13973 | if (options.disableGlob || !glob.hasMagic(p)) {
|
13974 | results = [p];
|
13975 | } else {
|
13976 | try {
|
13977 | options.lstatSync(p);
|
13978 | results = [p];
|
13979 | } catch (er) {
|
13980 | results = glob.sync(p, options.glob);
|
13981 | }
|
13982 | }
|
13983 | if (!results.length)
|
13984 | return;
|
13985 | for (let i = 0; i < results.length; i++) {
|
13986 | const p2 = results[i];
|
13987 | let st;
|
13988 | try {
|
13989 | st = options.lstatSync(p2);
|
13990 | } catch (er) {
|
13991 | if (er.code === "ENOENT")
|
13992 | return;
|
13993 | if (er.code === "EPERM" && isWindows)
|
13994 | fixWinEPERMSync(p2, options, er);
|
13995 | }
|
13996 | try {
|
13997 | if (st && st.isDirectory())
|
13998 | rmdirSync(p2, options, null);
|
13999 | else
|
14000 | options.unlinkSync(p2);
|
14001 | } catch (er) {
|
14002 | if (er.code === "ENOENT")
|
14003 | return;
|
14004 | if (er.code === "EPERM")
|
14005 | return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er);
|
14006 | if (er.code !== "EISDIR")
|
14007 | throw er;
|
14008 | rmdirSync(p2, options, er);
|
14009 | }
|
14010 | }
|
14011 | };
|
14012 | var rmdirSync = (p, options, originalEr) => {
|
14013 | assert(p);
|
14014 | assert(options);
|
14015 | try {
|
14016 | options.rmdirSync(p);
|
14017 | } catch (er) {
|
14018 | if (er.code === "ENOENT")
|
14019 | return;
|
14020 | if (er.code === "ENOTDIR")
|
14021 | throw originalEr;
|
14022 | if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
|
14023 | rmkidsSync(p, options);
|
14024 | }
|
14025 | };
|
14026 | var rmkidsSync = (p, options) => {
|
14027 | assert(p);
|
14028 | assert(options);
|
14029 | options.readdirSync(p).forEach((f) => rimrafSync(path.join(p, f), options));
|
14030 | const retries = isWindows ? 100 : 1;
|
14031 | let i = 0;
|
14032 | do {
|
14033 | let threw = true;
|
14034 | try {
|
14035 | const ret = options.rmdirSync(p, options);
|
14036 | threw = false;
|
14037 | return ret;
|
14038 | } finally {
|
14039 | if (++i < retries && threw)
|
14040 | continue;
|
14041 | }
|
14042 | } while (true);
|
14043 | };
|
14044 | module2.exports = rimraf;
|
14045 | rimraf.sync = rimrafSync;
|
14046 | }
|
14047 | });
|
14048 | var require_del = __commonJS2({
|
14049 | "node_modules/flat-cache/src/del.js"(exports2, module2) {
|
14050 | var rimraf = require_rimraf().sync;
|
14051 | var fs = require("fs");
|
14052 | module2.exports = function del(file) {
|
14053 | if (fs.existsSync(file)) {
|
14054 | rimraf(file, {
|
14055 | glob: false
|
14056 | });
|
14057 | return true;
|
14058 | }
|
14059 | return false;
|
14060 | };
|
14061 | }
|
14062 | });
|
14063 | var require_cache = __commonJS2({
|
14064 | "node_modules/flat-cache/src/cache.js"(exports2, module2) {
|
14065 | var path = require("path");
|
14066 | var fs = require("fs");
|
14067 | var utils = require_utils6();
|
14068 | var del = require_del();
|
14069 | var writeJSON = utils.writeJSON;
|
14070 | var cache = {
|
14071 | load: function(docId, cacheDir) {
|
14072 | var me = this;
|
14073 | me._visited = {};
|
14074 | me._persisted = {};
|
14075 | me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
|
14076 | if (fs.existsSync(me._pathToFile)) {
|
14077 | me._persisted = utils.tryParse(me._pathToFile, {});
|
14078 | }
|
14079 | },
|
14080 | loadFile: function(pathToFile) {
|
14081 | var me = this;
|
14082 | var dir = path.dirname(pathToFile);
|
14083 | var fName = path.basename(pathToFile);
|
14084 | me.load(fName, dir);
|
14085 | },
|
14086 | all: function() {
|
14087 | return this._persisted;
|
14088 | },
|
14089 | keys: function() {
|
14090 | return Object.keys(this._persisted);
|
14091 | },
|
14092 | setKey: function(key, value) {
|
14093 | this._visited[key] = true;
|
14094 | this._persisted[key] = value;
|
14095 | },
|
14096 | removeKey: function(key) {
|
14097 | delete this._visited[key];
|
14098 | delete this._persisted[key];
|
14099 | },
|
14100 | getKey: function(key) {
|
14101 | this._visited[key] = true;
|
14102 | return this._persisted[key];
|
14103 | },
|
14104 | _prune: function() {
|
14105 | var me = this;
|
14106 | var obj = {};
|
14107 | var keys = Object.keys(me._visited);
|
14108 | if (keys.length === 0) {
|
14109 | return;
|
14110 | }
|
14111 | keys.forEach(function(key) {
|
14112 | obj[key] = me._persisted[key];
|
14113 | });
|
14114 | me._visited = {};
|
14115 | me._persisted = obj;
|
14116 | },
|
14117 | save: function(noPrune) {
|
14118 | var me = this;
|
14119 | !noPrune && me._prune();
|
14120 | writeJSON(me._pathToFile, me._persisted);
|
14121 | },
|
14122 | removeCacheFile: function() {
|
14123 | return del(this._pathToFile);
|
14124 | },
|
14125 | destroy: function() {
|
14126 | var me = this;
|
14127 | me._visited = {};
|
14128 | me._persisted = {};
|
14129 | me.removeCacheFile();
|
14130 | }
|
14131 | };
|
14132 | module2.exports = {
|
14133 | load: function(docId, cacheDir) {
|
14134 | return this.create(docId, cacheDir);
|
14135 | },
|
14136 | create: function(docId, cacheDir) {
|
14137 | var obj = Object.create(cache);
|
14138 | obj.load(docId, cacheDir);
|
14139 | return obj;
|
14140 | },
|
14141 | createFromFile: function(filePath) {
|
14142 | var obj = Object.create(cache);
|
14143 | obj.loadFile(filePath);
|
14144 | return obj;
|
14145 | },
|
14146 | clearCacheById: function(docId, cacheDir) {
|
14147 | var filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
|
14148 | return del(filePath);
|
14149 | },
|
14150 | clearAll: function(cacheDir) {
|
14151 | var filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, "../.cache/");
|
14152 | return del(filePath);
|
14153 | }
|
14154 | };
|
14155 | }
|
14156 | });
|
14157 | var require_cache2 = __commonJS2({
|
14158 | "node_modules/file-entry-cache/cache.js"(exports2, module2) {
|
14159 | var path = require("path");
|
14160 | var crypto = require("crypto");
|
14161 | module2.exports = {
|
14162 | createFromFile: function(filePath, useChecksum) {
|
14163 | var fname = path.basename(filePath);
|
14164 | var dir = path.dirname(filePath);
|
14165 | return this.create(fname, dir, useChecksum);
|
14166 | },
|
14167 | create: function(cacheId, _path, useChecksum) {
|
14168 | var fs = require("fs");
|
14169 | var flatCache = require_cache();
|
14170 | var cache = flatCache.load(cacheId, _path);
|
14171 | var normalizedEntries = {};
|
14172 | var removeNotFoundFiles = function removeNotFoundFiles2() {
|
14173 | const cachedEntries = cache.keys();
|
14174 | cachedEntries.forEach(function remover(fPath) {
|
14175 | try {
|
14176 | fs.statSync(fPath);
|
14177 | } catch (err) {
|
14178 | if (err.code === "ENOENT") {
|
14179 | cache.removeKey(fPath);
|
14180 | }
|
14181 | }
|
14182 | });
|
14183 | };
|
14184 | removeNotFoundFiles();
|
14185 | return {
|
14186 | cache,
|
14187 | getHash: function(buffer) {
|
14188 | return crypto.createHash("md5").update(buffer).digest("hex");
|
14189 | },
|
14190 | hasFileChanged: function(file) {
|
14191 | return this.getFileDescriptor(file).changed;
|
14192 | },
|
14193 | analyzeFiles: function(files) {
|
14194 | var me = this;
|
14195 | files = files || [];
|
14196 | var res = {
|
14197 | changedFiles: [],
|
14198 | notFoundFiles: [],
|
14199 | notChangedFiles: []
|
14200 | };
|
14201 | me.normalizeEntries(files).forEach(function(entry) {
|
14202 | if (entry.changed) {
|
14203 | res.changedFiles.push(entry.key);
|
14204 | return;
|
14205 | }
|
14206 | if (entry.notFound) {
|
14207 | res.notFoundFiles.push(entry.key);
|
14208 | return;
|
14209 | }
|
14210 | res.notChangedFiles.push(entry.key);
|
14211 | });
|
14212 | return res;
|
14213 | },
|
14214 | getFileDescriptor: function(file) {
|
14215 | var fstat;
|
14216 | try {
|
14217 | fstat = fs.statSync(file);
|
14218 | } catch (ex) {
|
14219 | this.removeEntry(file);
|
14220 | return {
|
14221 | key: file,
|
14222 | notFound: true,
|
14223 | err: ex
|
14224 | };
|
14225 | }
|
14226 | if (useChecksum) {
|
14227 | return this._getFileDescriptorUsingChecksum(file);
|
14228 | }
|
14229 | return this._getFileDescriptorUsingMtimeAndSize(file, fstat);
|
14230 | },
|
14231 | _getFileDescriptorUsingMtimeAndSize: function(file, fstat) {
|
14232 | var meta = cache.getKey(file);
|
14233 | var cacheExists = !!meta;
|
14234 | var cSize = fstat.size;
|
14235 | var cTime = fstat.mtime.getTime();
|
14236 | var isDifferentDate;
|
14237 | var isDifferentSize;
|
14238 | if (!meta) {
|
14239 | meta = {
|
14240 | size: cSize,
|
14241 | mtime: cTime
|
14242 | };
|
14243 | } else {
|
14244 | isDifferentDate = cTime !== meta.mtime;
|
14245 | isDifferentSize = cSize !== meta.size;
|
14246 | }
|
14247 | var nEntry = normalizedEntries[file] = {
|
14248 | key: file,
|
14249 | changed: !cacheExists || isDifferentDate || isDifferentSize,
|
14250 | meta
|
14251 | };
|
14252 | return nEntry;
|
14253 | },
|
14254 | _getFileDescriptorUsingChecksum: function(file) {
|
14255 | var meta = cache.getKey(file);
|
14256 | var cacheExists = !!meta;
|
14257 | var contentBuffer;
|
14258 | try {
|
14259 | contentBuffer = fs.readFileSync(file);
|
14260 | } catch (ex) {
|
14261 | contentBuffer = "";
|
14262 | }
|
14263 | var isDifferent = true;
|
14264 | var hash = this.getHash(contentBuffer);
|
14265 | if (!meta) {
|
14266 | meta = {
|
14267 | hash
|
14268 | };
|
14269 | } else {
|
14270 | isDifferent = hash !== meta.hash;
|
14271 | }
|
14272 | var nEntry = normalizedEntries[file] = {
|
14273 | key: file,
|
14274 | changed: !cacheExists || isDifferent,
|
14275 | meta
|
14276 | };
|
14277 | return nEntry;
|
14278 | },
|
14279 | getUpdatedFiles: function(files) {
|
14280 | var me = this;
|
14281 | files = files || [];
|
14282 | return me.normalizeEntries(files).filter(function(entry) {
|
14283 | return entry.changed;
|
14284 | }).map(function(entry) {
|
14285 | return entry.key;
|
14286 | });
|
14287 | },
|
14288 | normalizeEntries: function(files) {
|
14289 | files = files || [];
|
14290 | var me = this;
|
14291 | var nEntries = files.map(function(file) {
|
14292 | return me.getFileDescriptor(file);
|
14293 | });
|
14294 | return nEntries;
|
14295 | },
|
14296 | removeEntry: function(entryName) {
|
14297 | delete normalizedEntries[entryName];
|
14298 | cache.removeKey(entryName);
|
14299 | },
|
14300 | deleteCacheFile: function() {
|
14301 | cache.removeCacheFile();
|
14302 | },
|
14303 | destroy: function() {
|
14304 | normalizedEntries = {};
|
14305 | cache.destroy();
|
14306 | },
|
14307 | _getMetaForFileUsingCheckSum: function(cacheEntry) {
|
14308 | var contentBuffer = fs.readFileSync(cacheEntry.key);
|
14309 | var hash = this.getHash(contentBuffer);
|
14310 | var meta = Object.assign(cacheEntry.meta, {
|
14311 | hash
|
14312 | });
|
14313 | delete meta.size;
|
14314 | delete meta.mtime;
|
14315 | return meta;
|
14316 | },
|
14317 | _getMetaForFileUsingMtimeAndSize: function(cacheEntry) {
|
14318 | var stat = fs.statSync(cacheEntry.key);
|
14319 | var meta = Object.assign(cacheEntry.meta, {
|
14320 | size: stat.size,
|
14321 | mtime: stat.mtime.getTime()
|
14322 | });
|
14323 | delete meta.hash;
|
14324 | return meta;
|
14325 | },
|
14326 | reconcile: function(noPrune) {
|
14327 | removeNotFoundFiles();
|
14328 | noPrune = typeof noPrune === "undefined" ? true : noPrune;
|
14329 | var entries = normalizedEntries;
|
14330 | var keys = Object.keys(entries);
|
14331 | if (keys.length === 0) {
|
14332 | return;
|
14333 | }
|
14334 | var me = this;
|
14335 | keys.forEach(function(entryName) {
|
14336 | var cacheEntry = entries[entryName];
|
14337 | try {
|
14338 | var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry);
|
14339 | cache.setKey(entryName, meta);
|
14340 | } catch (err) {
|
14341 | if (err.code !== "ENOENT") {
|
14342 | throw err;
|
14343 | }
|
14344 | }
|
14345 | });
|
14346 | cache.save(noPrune);
|
14347 | }
|
14348 | };
|
14349 | }
|
14350 | };
|
14351 | }
|
14352 | });
|
14353 | var require_format_results_cache = __commonJS2({
|
14354 | "src/cli/format-results-cache.js"(exports2, module2) {
|
14355 | "use strict";
|
14356 | var fileEntryCache = require_cache2();
|
14357 | var stringify2 = require_fast_json_stable_stringify();
|
14358 | var {
|
14359 | version: prettierVersion
|
14360 | } = require("./index.js");
|
14361 | var {
|
14362 | createHash
|
14363 | } = require_utils();
|
14364 | var optionsHashCache = new WeakMap();
|
14365 | var nodeVersion = process && process.version;
|
14366 | function getHashOfOptions(options) {
|
14367 | if (optionsHashCache.has(options)) {
|
14368 | return optionsHashCache.get(options);
|
14369 | }
|
14370 | const hash = createHash(`${prettierVersion}_${nodeVersion}_${stringify2(options)}`);
|
14371 | optionsHashCache.set(options, hash);
|
14372 | return hash;
|
14373 | }
|
14374 | function getMetadataFromFileDescriptor(fileDescriptor) {
|
14375 | return fileDescriptor.meta;
|
14376 | }
|
14377 | var FormatResultsCache = class {
|
14378 | constructor(cacheFileLocation, cacheStrategy) {
|
14379 | const useChecksum = cacheStrategy === "content";
|
14380 | this.cacheFileLocation = cacheFileLocation;
|
14381 | this.fileEntryCache = fileEntryCache.create(cacheFileLocation, void 0, useChecksum);
|
14382 | }
|
14383 | existsAvailableFormatResultsCache(filePath, options) {
|
14384 | const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
|
14385 | if (fileDescriptor.notFound) {
|
14386 | return false;
|
14387 | }
|
14388 | const hashOfOptions = getHashOfOptions(options);
|
14389 | const meta = getMetadataFromFileDescriptor(fileDescriptor);
|
14390 | const changed = fileDescriptor.changed || meta.hashOfOptions !== hashOfOptions;
|
14391 | return !changed;
|
14392 | }
|
14393 | setFormatResultsCache(filePath, options) {
|
14394 | const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
|
14395 | const meta = getMetadataFromFileDescriptor(fileDescriptor);
|
14396 | if (fileDescriptor && !fileDescriptor.notFound) {
|
14397 | meta.hashOfOptions = getHashOfOptions(options);
|
14398 | }
|
14399 | }
|
14400 | removeFormatResultsCache(filePath) {
|
14401 | this.fileEntryCache.removeEntry(filePath);
|
14402 | }
|
14403 | reconcile() {
|
14404 | this.fileEntryCache.reconcile();
|
14405 | }
|
14406 | };
|
14407 | module2.exports = FormatResultsCache;
|
14408 | }
|
14409 | });
|
14410 | var require_base = __commonJS2({
|
14411 | "node_modules/diff/lib/diff/base.js"(exports2) {
|
14412 | "use strict";
|
14413 | Object.defineProperty(exports2, "__esModule", {
|
14414 | value: true
|
14415 | });
|
14416 | exports2["default"] = Diff;
|
14417 | function Diff() {
|
14418 | }
|
14419 | Diff.prototype = {
|
14420 | diff: function diff(oldString, newString) {
|
14421 | var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
14422 | var callback = options.callback;
|
14423 | if (typeof options === "function") {
|
14424 | callback = options;
|
14425 | options = {};
|
14426 | }
|
14427 | this.options = options;
|
14428 | var self2 = this;
|
14429 | function done(value) {
|
14430 | if (callback) {
|
14431 | setTimeout(function() {
|
14432 | callback(void 0, value);
|
14433 | }, 0);
|
14434 | return true;
|
14435 | } else {
|
14436 | return value;
|
14437 | }
|
14438 | }
|
14439 | oldString = this.castInput(oldString);
|
14440 | newString = this.castInput(newString);
|
14441 | oldString = this.removeEmpty(this.tokenize(oldString));
|
14442 | newString = this.removeEmpty(this.tokenize(newString));
|
14443 | var newLen = newString.length, oldLen = oldString.length;
|
14444 | var editLength = 1;
|
14445 | var maxEditLength = newLen + oldLen;
|
14446 | var bestPath = [{
|
14447 | newPos: -1,
|
14448 | components: []
|
14449 | }];
|
14450 | var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
14451 | if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
|
14452 | return done([{
|
14453 | value: this.join(newString),
|
14454 | count: newString.length
|
14455 | }]);
|
14456 | }
|
14457 | function execEditLength() {
|
14458 | for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
|
14459 | var basePath = void 0;
|
14460 | var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
|
14461 | if (addPath) {
|
14462 | bestPath[diagonalPath - 1] = void 0;
|
14463 | }
|
14464 | var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
|
14465 | if (!canAdd && !canRemove) {
|
14466 | bestPath[diagonalPath] = void 0;
|
14467 | continue;
|
14468 | }
|
14469 | if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
|
14470 | basePath = clonePath(removePath);
|
14471 | self2.pushComponent(basePath.components, void 0, true);
|
14472 | } else {
|
14473 | basePath = addPath;
|
14474 | basePath.newPos++;
|
14475 | self2.pushComponent(basePath.components, true, void 0);
|
14476 | }
|
14477 | _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath);
|
14478 | if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
|
14479 | return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken));
|
14480 | } else {
|
14481 | bestPath[diagonalPath] = basePath;
|
14482 | }
|
14483 | }
|
14484 | editLength++;
|
14485 | }
|
14486 | if (callback) {
|
14487 | (function exec() {
|
14488 | setTimeout(function() {
|
14489 | if (editLength > maxEditLength) {
|
14490 | return callback();
|
14491 | }
|
14492 | if (!execEditLength()) {
|
14493 | exec();
|
14494 | }
|
14495 | }, 0);
|
14496 | })();
|
14497 | } else {
|
14498 | while (editLength <= maxEditLength) {
|
14499 | var ret = execEditLength();
|
14500 | if (ret) {
|
14501 | return ret;
|
14502 | }
|
14503 | }
|
14504 | }
|
14505 | },
|
14506 | pushComponent: function pushComponent(components, added, removed) {
|
14507 | var last = components[components.length - 1];
|
14508 | if (last && last.added === added && last.removed === removed) {
|
14509 | components[components.length - 1] = {
|
14510 | count: last.count + 1,
|
14511 | added,
|
14512 | removed
|
14513 | };
|
14514 | } else {
|
14515 | components.push({
|
14516 | count: 1,
|
14517 | added,
|
14518 | removed
|
14519 | });
|
14520 | }
|
14521 | },
|
14522 | extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
14523 | var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
|
14524 | while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
14525 | newPos++;
|
14526 | oldPos++;
|
14527 | commonCount++;
|
14528 | }
|
14529 | if (commonCount) {
|
14530 | basePath.components.push({
|
14531 | count: commonCount
|
14532 | });
|
14533 | }
|
14534 | basePath.newPos = newPos;
|
14535 | return oldPos;
|
14536 | },
|
14537 | equals: function equals(left, right) {
|
14538 | if (this.options.comparator) {
|
14539 | return this.options.comparator(left, right);
|
14540 | } else {
|
14541 | return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
14542 | }
|
14543 | },
|
14544 | removeEmpty: function removeEmpty(array2) {
|
14545 | var ret = [];
|
14546 | for (var i = 0; i < array2.length; i++) {
|
14547 | if (array2[i]) {
|
14548 | ret.push(array2[i]);
|
14549 | }
|
14550 | }
|
14551 | return ret;
|
14552 | },
|
14553 | castInput: function castInput(value) {
|
14554 | return value;
|
14555 | },
|
14556 | tokenize: function tokenize(value) {
|
14557 | return value.split("");
|
14558 | },
|
14559 | join: function join(chars) {
|
14560 | return chars.join("");
|
14561 | }
|
14562 | };
|
14563 | function buildValues(diff, components, newString, oldString, useLongestToken) {
|
14564 | var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
|
14565 | for (; componentPos < componentLen; componentPos++) {
|
14566 | var component = components[componentPos];
|
14567 | if (!component.removed) {
|
14568 | if (!component.added && useLongestToken) {
|
14569 | var value = newString.slice(newPos, newPos + component.count);
|
14570 | value = value.map(function(value2, i) {
|
14571 | var oldValue = oldString[oldPos + i];
|
14572 | return oldValue.length > value2.length ? oldValue : value2;
|
14573 | });
|
14574 | component.value = diff.join(value);
|
14575 | } else {
|
14576 | component.value = diff.join(newString.slice(newPos, newPos + component.count));
|
14577 | }
|
14578 | newPos += component.count;
|
14579 | if (!component.added) {
|
14580 | oldPos += component.count;
|
14581 | }
|
14582 | } else {
|
14583 | component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
|
14584 | oldPos += component.count;
|
14585 | if (componentPos && components[componentPos - 1].added) {
|
14586 | var tmp = components[componentPos - 1];
|
14587 | components[componentPos - 1] = components[componentPos];
|
14588 | components[componentPos] = tmp;
|
14589 | }
|
14590 | }
|
14591 | }
|
14592 | var lastComponent = components[componentLen - 1];
|
14593 | if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
|
14594 | components[componentLen - 2].value += lastComponent.value;
|
14595 | components.pop();
|
14596 | }
|
14597 | return components;
|
14598 | }
|
14599 | function clonePath(path) {
|
14600 | return {
|
14601 | newPos: path.newPos,
|
14602 | components: path.components.slice(0)
|
14603 | };
|
14604 | }
|
14605 | }
|
14606 | });
|
14607 | var require_params = __commonJS2({
|
14608 | "node_modules/diff/lib/util/params.js"(exports2) {
|
14609 | "use strict";
|
14610 | Object.defineProperty(exports2, "__esModule", {
|
14611 | value: true
|
14612 | });
|
14613 | exports2.generateOptions = generateOptions;
|
14614 | function generateOptions(options, defaults) {
|
14615 | if (typeof options === "function") {
|
14616 | defaults.callback = options;
|
14617 | } else if (options) {
|
14618 | for (var name in options) {
|
14619 | if (options.hasOwnProperty(name)) {
|
14620 | defaults[name] = options[name];
|
14621 | }
|
14622 | }
|
14623 | }
|
14624 | return defaults;
|
14625 | }
|
14626 | }
|
14627 | });
|
14628 | var require_line = __commonJS2({
|
14629 | "node_modules/diff/lib/diff/line.js"(exports2) {
|
14630 | "use strict";
|
14631 | Object.defineProperty(exports2, "__esModule", {
|
14632 | value: true
|
14633 | });
|
14634 | exports2.diffLines = diffLines;
|
14635 | exports2.diffTrimmedLines = diffTrimmedLines;
|
14636 | exports2.lineDiff = void 0;
|
14637 | var _base = _interopRequireDefault(require_base());
|
14638 | var _params = require_params();
|
14639 | function _interopRequireDefault(obj) {
|
14640 | return obj && obj.__esModule ? obj : {
|
14641 | "default": obj
|
14642 | };
|
14643 | }
|
14644 | var lineDiff = new _base["default"]();
|
14645 | exports2.lineDiff = lineDiff;
|
14646 | lineDiff.tokenize = function(value) {
|
14647 | var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
|
14648 | if (!linesAndNewlines[linesAndNewlines.length - 1]) {
|
14649 | linesAndNewlines.pop();
|
14650 | }
|
14651 | for (var i = 0; i < linesAndNewlines.length; i++) {
|
14652 | var line = linesAndNewlines[i];
|
14653 | if (i % 2 && !this.options.newlineIsToken) {
|
14654 | retLines[retLines.length - 1] += line;
|
14655 | } else {
|
14656 | if (this.options.ignoreWhitespace) {
|
14657 | line = line.trim();
|
14658 | }
|
14659 | retLines.push(line);
|
14660 | }
|
14661 | }
|
14662 | return retLines;
|
14663 | };
|
14664 | function diffLines(oldStr, newStr, callback) {
|
14665 | return lineDiff.diff(oldStr, newStr, callback);
|
14666 | }
|
14667 | function diffTrimmedLines(oldStr, newStr, callback) {
|
14668 | var options = (0, _params.generateOptions)(callback, {
|
14669 | ignoreWhitespace: true
|
14670 | });
|
14671 | return lineDiff.diff(oldStr, newStr, options);
|
14672 | }
|
14673 | }
|
14674 | });
|
14675 | var require_create = __commonJS2({
|
14676 | "node_modules/diff/lib/patch/create.js"(exports2) {
|
14677 | "use strict";
|
14678 | Object.defineProperty(exports2, "__esModule", {
|
14679 | value: true
|
14680 | });
|
14681 | exports2.structuredPatch = structuredPatch;
|
14682 | exports2.formatPatch = formatPatch;
|
14683 | exports2.createTwoFilesPatch = createTwoFilesPatch;
|
14684 | exports2.createPatch = createPatch;
|
14685 | var _line = require_line();
|
14686 | function _toConsumableArray(arr) {
|
14687 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
14688 | }
|
14689 | function _nonIterableSpread() {
|
14690 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
14691 | }
|
14692 | function _unsupportedIterableToArray(o, minLen) {
|
14693 | if (!o)
|
14694 | return;
|
14695 | if (typeof o === "string")
|
14696 | return _arrayLikeToArray(o, minLen);
|
14697 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
14698 | if (n === "Object" && o.constructor)
|
14699 | n = o.constructor.name;
|
14700 | if (n === "Map" || n === "Set")
|
14701 | return Array.from(o);
|
14702 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
14703 | return _arrayLikeToArray(o, minLen);
|
14704 | }
|
14705 | function _iterableToArray(iter) {
|
14706 | if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
|
14707 | return Array.from(iter);
|
14708 | }
|
14709 | function _arrayWithoutHoles(arr) {
|
14710 | if (Array.isArray(arr))
|
14711 | return _arrayLikeToArray(arr);
|
14712 | }
|
14713 | function _arrayLikeToArray(arr, len) {
|
14714 | if (len == null || len > arr.length)
|
14715 | len = arr.length;
|
14716 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
14717 | arr2[i] = arr[i];
|
14718 | }
|
14719 | return arr2;
|
14720 | }
|
14721 | function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
14722 | if (!options) {
|
14723 | options = {};
|
14724 | }
|
14725 | if (typeof options.context === "undefined") {
|
14726 | options.context = 4;
|
14727 | }
|
14728 | var diff = (0, _line.diffLines)(oldStr, newStr, options);
|
14729 | diff.push({
|
14730 | value: "",
|
14731 | lines: []
|
14732 | });
|
14733 | function contextLines(lines) {
|
14734 | return lines.map(function(entry) {
|
14735 | return " " + entry;
|
14736 | });
|
14737 | }
|
14738 | var hunks = [];
|
14739 | var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
|
14740 | var _loop = function _loop2(i2) {
|
14741 | var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
|
14742 | current.lines = lines;
|
14743 | if (current.added || current.removed) {
|
14744 | var _curRange;
|
14745 | if (!oldRangeStart) {
|
14746 | var prev = diff[i2 - 1];
|
14747 | oldRangeStart = oldLine;
|
14748 | newRangeStart = newLine;
|
14749 | if (prev) {
|
14750 | curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
|
14751 | oldRangeStart -= curRange.length;
|
14752 | newRangeStart -= curRange.length;
|
14753 | }
|
14754 | }
|
14755 | (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
|
14756 | return (current.added ? "+" : "-") + entry;
|
14757 | })));
|
14758 | if (current.added) {
|
14759 | newLine += lines.length;
|
14760 | } else {
|
14761 | oldLine += lines.length;
|
14762 | }
|
14763 | } else {
|
14764 | if (oldRangeStart) {
|
14765 | if (lines.length <= options.context * 2 && i2 < diff.length - 2) {
|
14766 | var _curRange2;
|
14767 | (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
|
14768 | } else {
|
14769 | var _curRange3;
|
14770 | var contextSize = Math.min(lines.length, options.context);
|
14771 | (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
|
14772 | var hunk = {
|
14773 | oldStart: oldRangeStart,
|
14774 | oldLines: oldLine - oldRangeStart + contextSize,
|
14775 | newStart: newRangeStart,
|
14776 | newLines: newLine - newRangeStart + contextSize,
|
14777 | lines: curRange
|
14778 | };
|
14779 | if (i2 >= diff.length - 2 && lines.length <= options.context) {
|
14780 | var oldEOFNewline = /\n$/.test(oldStr);
|
14781 | var newEOFNewline = /\n$/.test(newStr);
|
14782 | var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
|
14783 | if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
|
14784 | curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file");
|
14785 | }
|
14786 | if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
|
14787 | curRange.push("\\ No newline at end of file");
|
14788 | }
|
14789 | }
|
14790 | hunks.push(hunk);
|
14791 | oldRangeStart = 0;
|
14792 | newRangeStart = 0;
|
14793 | curRange = [];
|
14794 | }
|
14795 | }
|
14796 | oldLine += lines.length;
|
14797 | newLine += lines.length;
|
14798 | }
|
14799 | };
|
14800 | for (var i = 0; i < diff.length; i++) {
|
14801 | _loop(i);
|
14802 | }
|
14803 | return {
|
14804 | oldFileName,
|
14805 | newFileName,
|
14806 | oldHeader,
|
14807 | newHeader,
|
14808 | hunks
|
14809 | };
|
14810 | }
|
14811 | function formatPatch(diff) {
|
14812 | var ret = [];
|
14813 | if (diff.oldFileName == diff.newFileName) {
|
14814 | ret.push("Index: " + diff.oldFileName);
|
14815 | }
|
14816 | ret.push("===================================================================");
|
14817 | ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader));
|
14818 | ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader));
|
14819 | for (var i = 0; i < diff.hunks.length; i++) {
|
14820 | var hunk = diff.hunks[i];
|
14821 | if (hunk.oldLines === 0) {
|
14822 | hunk.oldStart -= 1;
|
14823 | }
|
14824 | if (hunk.newLines === 0) {
|
14825 | hunk.newStart -= 1;
|
14826 | }
|
14827 | ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
|
14828 | ret.push.apply(ret, hunk.lines);
|
14829 | }
|
14830 | return ret.join("\n") + "\n";
|
14831 | }
|
14832 | function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
14833 | return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
|
14834 | }
|
14835 | function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
|
14836 | return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
|
14837 | }
|
14838 | }
|
14839 | });
|
14840 | var require_format = __commonJS2({
|
14841 | "src/cli/format.js"(exports2, module2) {
|
14842 | "use strict";
|
14843 | var {
|
14844 | promises: fs
|
14845 | } = require("fs");
|
14846 | var path = require("path");
|
14847 | var {
|
14848 | default: chalk2
|
14849 | } = (init_source(), __toCommonJS(source_exports));
|
14850 | var prettier2 = require("./index.js");
|
14851 | var {
|
14852 | getStdin
|
14853 | } = require("./third-party.js");
|
14854 | var {
|
14855 | createIgnorer,
|
14856 | errors
|
14857 | } = require_prettier_internal();
|
14858 | var {
|
14859 | expandPatterns,
|
14860 | fixWindowsSlashes
|
14861 | } = require_expand_patterns();
|
14862 | var getOptionsForFile = require_get_options_for_file();
|
14863 | var isTTY = require_is_tty();
|
14864 | var findCacheFile = require_find_cache_file();
|
14865 | var FormatResultsCache = require_format_results_cache();
|
14866 | var {
|
14867 | statSafe
|
14868 | } = require_utils();
|
14869 | function diff(a, b) {
|
14870 | return require_create().createTwoFilesPatch("", "", a, b, "", "", {
|
14871 | context: 2
|
14872 | });
|
14873 | }
|
14874 | function handleError(context, filename, error, printedFilename) {
|
14875 | if (error instanceof errors.UndefinedParserError) {
|
14876 | if ((context.argv.write || context.argv.ignoreUnknown) && printedFilename) {
|
14877 | printedFilename.clear();
|
14878 | }
|
14879 | if (context.argv.ignoreUnknown) {
|
14880 | return;
|
14881 | }
|
14882 | if (!context.argv.check && !context.argv.listDifferent) {
|
14883 | process.exitCode = 2;
|
14884 | }
|
14885 | context.logger.error(error.message);
|
14886 | return;
|
14887 | }
|
14888 | if (context.argv.write) {
|
14889 | process.stdout.write("\n");
|
14890 | }
|
14891 | const isParseError = Boolean(error && error.loc);
|
14892 | const isValidationError = /^Invalid \S+ value\./.test(error && error.message);
|
14893 | if (isParseError) {
|
14894 | context.logger.error(`${filename}: ${String(error)}`);
|
14895 | } else if (isValidationError || error instanceof errors.ConfigError) {
|
14896 | context.logger.error(error.message);
|
14897 | process.exit(1);
|
14898 | } else if (error instanceof errors.DebugError) {
|
14899 | context.logger.error(`${filename}: ${error.message}`);
|
14900 | } else {
|
14901 | context.logger.error(filename + ": " + (error.stack || error));
|
14902 | }
|
14903 | process.exitCode = 2;
|
14904 | }
|
14905 | function writeOutput(context, result, options) {
|
14906 | process.stdout.write(context.argv.debugCheck ? result.filepath : result.formatted);
|
14907 | if (options && options.cursorOffset >= 0) {
|
14908 | process.stderr.write(result.cursorOffset + "\n");
|
14909 | }
|
14910 | }
|
14911 | function listDifferent(context, input, options, filename) {
|
14912 | if (!context.argv.check && !context.argv.listDifferent) {
|
14913 | return;
|
14914 | }
|
14915 | try {
|
14916 | if (!options.filepath && !options.parser) {
|
14917 | throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
|
14918 | }
|
14919 | if (!prettier2.check(input, options)) {
|
14920 | if (!context.argv.write) {
|
14921 | context.logger.log(filename);
|
14922 | process.exitCode = 1;
|
14923 | }
|
14924 | }
|
14925 | } catch (error) {
|
14926 | context.logger.error(error.message);
|
14927 | }
|
14928 | return true;
|
14929 | }
|
14930 | function format(context, input, opt) {
|
14931 | if (!opt.parser && !opt.filepath) {
|
14932 | throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
|
14933 | }
|
14934 | if (context.argv.debugPrintDoc) {
|
14935 | const doc = prettier2.__debug.printToDoc(input, opt);
|
14936 | return {
|
14937 | formatted: prettier2.__debug.formatDoc(doc) + "\n"
|
14938 | };
|
14939 | }
|
14940 | if (context.argv.debugPrintComments) {
|
14941 | return {
|
14942 | formatted: prettier2.format(JSON.stringify(prettier2.formatWithCursor(input, opt).comments || []), {
|
14943 | parser: "json"
|
14944 | })
|
14945 | };
|
14946 | }
|
14947 | if (context.argv.debugPrintAst) {
|
14948 | const {
|
14949 | ast
|
14950 | } = prettier2.__debug.parse(input, opt);
|
14951 | return {
|
14952 | formatted: JSON.stringify(ast)
|
14953 | };
|
14954 | }
|
14955 | if (context.argv.debugCheck) {
|
14956 | const pp = prettier2.format(input, opt);
|
14957 | const pppp = prettier2.format(pp, opt);
|
14958 | if (pp !== pppp) {
|
14959 | throw new errors.DebugError("prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp));
|
14960 | } else {
|
14961 | const stringify2 = (obj) => JSON.stringify(obj, null, 2);
|
14962 | const ast = stringify2(prettier2.__debug.parse(input, opt, true).ast);
|
14963 | const past = stringify2(prettier2.__debug.parse(pp, opt, true).ast);
|
14964 | if (ast !== past) {
|
14965 | const MAX_AST_SIZE = 2097152;
|
14966 | const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past);
|
14967 | throw new errors.DebugError("ast(input) !== ast(prettier(input))\n" + astDiff + "\n" + diff(input, pp));
|
14968 | }
|
14969 | }
|
14970 | return {
|
14971 | formatted: pp,
|
14972 | filepath: opt.filepath || "(stdin)\n"
|
14973 | };
|
14974 | }
|
14975 | const {
|
14976 | performanceTestFlag
|
14977 | } = context;
|
14978 | if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugBenchmark) {
|
14979 | let benchmark;
|
14980 | try {
|
14981 | benchmark = require("benchmark");
|
14982 | } catch {
|
14983 | context.logger.debug("'--debug-benchmark' requires the 'benchmark' package to be installed.");
|
14984 | process.exit(2);
|
14985 | }
|
14986 | context.logger.debug("'--debug-benchmark' option found, measuring formatWithCursor with 'benchmark' module.");
|
14987 | const suite = new benchmark.Suite();
|
14988 | suite.add("format", () => {
|
14989 | prettier2.formatWithCursor(input, opt);
|
14990 | }).on("cycle", (event) => {
|
14991 | const results = {
|
14992 | benchmark: String(event.target),
|
14993 | hz: event.target.hz,
|
14994 | ms: event.target.times.cycle * 1e3
|
14995 | };
|
14996 | context.logger.debug("'--debug-benchmark' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
|
14997 | }).run({
|
14998 | async: false
|
14999 | });
|
15000 | } else if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugRepeat) {
|
15001 | const repeat = context.argv.debugRepeat;
|
15002 | context.logger.debug("'--debug-repeat' option found, running formatWithCursor " + repeat + " times.");
|
15003 | let totalMs = 0;
|
15004 | for (let i = 0; i < repeat; ++i) {
|
15005 | const startMs = Date.now();
|
15006 | prettier2.formatWithCursor(input, opt);
|
15007 | totalMs += Date.now() - startMs;
|
15008 | }
|
15009 | const averageMs = totalMs / repeat;
|
15010 | const results = {
|
15011 | repeat,
|
15012 | hz: 1e3 / averageMs,
|
15013 | ms: averageMs
|
15014 | };
|
15015 | context.logger.debug("'--debug-repeat' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
|
15016 | }
|
15017 | return prettier2.formatWithCursor(input, opt);
|
15018 | }
|
15019 | async function createIgnorerFromContextOrDie(context) {
|
15020 | try {
|
15021 | return await createIgnorer(context.argv.ignorePath, context.argv.withNodeModules);
|
15022 | } catch (e) {
|
15023 | context.logger.error(e.message);
|
15024 | process.exit(2);
|
15025 | }
|
15026 | }
|
15027 | async function formatStdin2(context) {
|
15028 | const filepath = context.argv.filepath ? path.resolve(process.cwd(), context.argv.filepath) : process.cwd();
|
15029 | const ignorer = await createIgnorerFromContextOrDie(context);
|
15030 | const relativeFilepath = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filepath) : path.relative(process.cwd(), filepath);
|
15031 | try {
|
15032 | const input = await getStdin();
|
15033 | if (relativeFilepath && ignorer.ignores(fixWindowsSlashes(relativeFilepath))) {
|
15034 | writeOutput(context, {
|
15035 | formatted: input
|
15036 | });
|
15037 | return;
|
15038 | }
|
15039 | const options = await getOptionsForFile(context, filepath);
|
15040 | if (listDifferent(context, input, options, "(stdin)")) {
|
15041 | return;
|
15042 | }
|
15043 | const formatted = format(context, input, options);
|
15044 | const {
|
15045 | performanceTestFlag
|
15046 | } = context;
|
15047 | if (performanceTestFlag) {
|
15048 | context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code to screen.`);
|
15049 | return;
|
15050 | }
|
15051 | writeOutput(context, formatted, options);
|
15052 | } catch (error) {
|
15053 | handleError(context, relativeFilepath || "stdin", error);
|
15054 | }
|
15055 | }
|
15056 | async function formatFiles2(context) {
|
15057 | var _formatResultsCache4;
|
15058 | const ignorer = await createIgnorerFromContextOrDie(context);
|
15059 | let numberOfUnformattedFilesFound = 0;
|
15060 | const {
|
15061 | performanceTestFlag
|
15062 | } = context;
|
15063 | if (context.argv.check && !performanceTestFlag) {
|
15064 | context.logger.log("Checking formatting...");
|
15065 | }
|
15066 | let formatResultsCache;
|
15067 | const cacheFilePath = await findCacheFile(context.argv.cacheLocation);
|
15068 | if (context.argv.cache) {
|
15069 | formatResultsCache = new FormatResultsCache(cacheFilePath, context.argv.cacheStrategy || "content");
|
15070 | } else {
|
15071 | if (context.argv.cacheStrategy) {
|
15072 | context.logger.error("`--cache-strategy` cannot be used without `--cache`.");
|
15073 | process.exit(2);
|
15074 | }
|
15075 | if (!context.argv.cacheLocation) {
|
15076 | const stat = await statSafe(cacheFilePath);
|
15077 | if (stat) {
|
15078 | await fs.unlink(cacheFilePath);
|
15079 | }
|
15080 | }
|
15081 | }
|
15082 | for await (const pathOrError of expandPatterns(context)) {
|
15083 | var _formatResultsCache;
|
15084 | if (typeof pathOrError === "object") {
|
15085 | context.logger.error(pathOrError.error);
|
15086 | process.exitCode = 2;
|
15087 | continue;
|
15088 | }
|
15089 | const filename = pathOrError;
|
15090 | const ignoreFilename = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filename) : filename;
|
15091 | const fileIgnored = ignorer.ignores(fixWindowsSlashes(ignoreFilename));
|
15092 | if (fileIgnored && (context.argv.debugCheck || context.argv.write || context.argv.check || context.argv.listDifferent)) {
|
15093 | continue;
|
15094 | }
|
15095 | const options = Object.assign(Object.assign({}, await getOptionsForFile(context, filename)), {}, {
|
15096 | filepath: filename
|
15097 | });
|
15098 | let printedFilename;
|
15099 | if (isTTY()) {
|
15100 | printedFilename = context.logger.log(filename, {
|
15101 | newline: false,
|
15102 | clearable: true
|
15103 | });
|
15104 | }
|
15105 | let input;
|
15106 | try {
|
15107 | input = await fs.readFile(filename, "utf8");
|
15108 | } catch (error) {
|
15109 | context.logger.log("");
|
15110 | context.logger.error(`Unable to read file: ${filename}
|
15111 | ${error.message}`);
|
15112 | process.exitCode = 2;
|
15113 | continue;
|
15114 | }
|
15115 | if (fileIgnored) {
|
15116 | writeOutput(context, {
|
15117 | formatted: input
|
15118 | }, options);
|
15119 | continue;
|
15120 | }
|
15121 | const start = Date.now();
|
15122 | const isCacheExists = (_formatResultsCache = formatResultsCache) === null || _formatResultsCache === void 0 ? void 0 : _formatResultsCache.existsAvailableFormatResultsCache(filename, options);
|
15123 | let result;
|
15124 | let output;
|
15125 | try {
|
15126 | if (isCacheExists) {
|
15127 | result = {
|
15128 | formatted: input
|
15129 | };
|
15130 | } else {
|
15131 | result = format(context, input, options);
|
15132 | }
|
15133 | output = result.formatted;
|
15134 | } catch (error) {
|
15135 | handleError(context, filename, error, printedFilename);
|
15136 | continue;
|
15137 | }
|
15138 | const isDifferent = output !== input;
|
15139 | let shouldSetCache = !isDifferent;
|
15140 | if (printedFilename) {
|
15141 | printedFilename.clear();
|
15142 | }
|
15143 | if (performanceTestFlag) {
|
15144 | context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code or write files.`);
|
15145 | return;
|
15146 | }
|
15147 | if (context.argv.write) {
|
15148 | if (isDifferent) {
|
15149 | if (!context.argv.check && !context.argv.listDifferent) {
|
15150 | context.logger.log(`${filename} ${Date.now() - start}ms`);
|
15151 | }
|
15152 | try {
|
15153 | await fs.writeFile(filename, output, "utf8");
|
15154 | shouldSetCache = true;
|
15155 | } catch (error) {
|
15156 | context.logger.error(`Unable to write file: ${filename}
|
15157 | ${error.message}`);
|
15158 | process.exitCode = 2;
|
15159 | }
|
15160 | } else if (!context.argv.check && !context.argv.listDifferent) {
|
15161 | const message = `${chalk2.grey(filename)} ${Date.now() - start}ms`;
|
15162 | if (isCacheExists) {
|
15163 | context.logger.log(`${message} (cached)`);
|
15164 | } else {
|
15165 | context.logger.log(message);
|
15166 | }
|
15167 | }
|
15168 | } else if (context.argv.debugCheck) {
|
15169 | if (result.filepath) {
|
15170 | context.logger.log(result.filepath);
|
15171 | } else {
|
15172 | process.exitCode = 2;
|
15173 | }
|
15174 | } else if (!context.argv.check && !context.argv.listDifferent) {
|
15175 | writeOutput(context, result, options);
|
15176 | }
|
15177 | if (shouldSetCache) {
|
15178 | var _formatResultsCache2;
|
15179 | (_formatResultsCache2 = formatResultsCache) === null || _formatResultsCache2 === void 0 ? void 0 : _formatResultsCache2.setFormatResultsCache(filename, options);
|
15180 | } else {
|
15181 | var _formatResultsCache3;
|
15182 | (_formatResultsCache3 = formatResultsCache) === null || _formatResultsCache3 === void 0 ? void 0 : _formatResultsCache3.removeFormatResultsCache(filename);
|
15183 | }
|
15184 | if (isDifferent) {
|
15185 | if (context.argv.check) {
|
15186 | context.logger.warn(filename);
|
15187 | } else if (context.argv.listDifferent) {
|
15188 | context.logger.log(filename);
|
15189 | }
|
15190 | numberOfUnformattedFilesFound += 1;
|
15191 | }
|
15192 | }
|
15193 | (_formatResultsCache4 = formatResultsCache) === null || _formatResultsCache4 === void 0 ? void 0 : _formatResultsCache4.reconcile();
|
15194 | if (context.argv.check) {
|
15195 | if (numberOfUnformattedFilesFound === 0) {
|
15196 | context.logger.log("All matched files use Prettier code style!");
|
15197 | } else if (numberOfUnformattedFilesFound === 1) {
|
15198 | context.logger.warn(context.argv.write ? "Code style issues fixed in the above file." : "Code style issues found in the above file. Forgot to run Prettier?");
|
15199 | } else {
|
15200 | context.logger.warn(context.argv.write ? "Code style issues found in " + numberOfUnformattedFilesFound + " files." : "Code style issues found in " + numberOfUnformattedFilesFound + " files. Forgot to run Prettier?");
|
15201 | }
|
15202 | }
|
15203 | if ((context.argv.check || context.argv.listDifferent) && numberOfUnformattedFilesFound > 0 && !process.exitCode && !context.argv.write) {
|
15204 | process.exitCode = 1;
|
15205 | }
|
15206 | }
|
15207 | module2.exports = {
|
15208 | formatStdin: formatStdin2,
|
15209 | formatFiles: formatFiles2
|
15210 | };
|
15211 | }
|
15212 | });
|
15213 | var require_file_info = __commonJS2({
|
15214 | "src/cli/file-info.js"(exports2, module2) {
|
15215 | "use strict";
|
15216 | var stringify2 = require_fast_json_stable_stringify();
|
15217 | var prettier2 = require("./index.js");
|
15218 | var {
|
15219 | printToScreen: printToScreen2
|
15220 | } = require_utils();
|
15221 | async function logFileInfoOrDie2(context) {
|
15222 | const {
|
15223 | fileInfo: file,
|
15224 | ignorePath,
|
15225 | withNodeModules,
|
15226 | plugins,
|
15227 | pluginSearchDirs,
|
15228 | config
|
15229 | } = context.argv;
|
15230 | const fileInfo = await prettier2.getFileInfo(file, {
|
15231 | ignorePath,
|
15232 | withNodeModules,
|
15233 | plugins,
|
15234 | pluginSearchDirs,
|
15235 | resolveConfig: config !== false
|
15236 | });
|
15237 | printToScreen2(prettier2.format(stringify2(fileInfo), {
|
15238 | parser: "json"
|
15239 | }));
|
15240 | }
|
15241 | module2.exports = logFileInfoOrDie2;
|
15242 | }
|
15243 | });
|
15244 | var require_find_config_path = __commonJS2({
|
15245 | "src/cli/find-config-path.js"(exports2, module2) {
|
15246 | "use strict";
|
15247 | var path = require("path");
|
15248 | var prettier2 = require("./index.js");
|
15249 | var {
|
15250 | printToScreen: printToScreen2
|
15251 | } = require_utils();
|
15252 | async function logResolvedConfigPathOrDie2(context) {
|
15253 | const file = context.argv.findConfigPath;
|
15254 | const configFile = await prettier2.resolveConfigFile(file);
|
15255 | if (configFile) {
|
15256 | printToScreen2(path.relative(process.cwd(), configFile));
|
15257 | } else {
|
15258 | throw new Error(`Can not find configure file for "${file}"`);
|
15259 | }
|
15260 | }
|
15261 | module2.exports = logResolvedConfigPathOrDie2;
|
15262 | }
|
15263 | });
|
15264 | var stringify = require_fast_json_stable_stringify();
|
15265 | var prettier = require("./index.js");
|
15266 | var createLogger = require_logger();
|
15267 | var Context = require_context();
|
15268 | var {
|
15269 | parseArgvWithoutPlugins
|
15270 | } = require_parse_cli_arguments();
|
15271 | var {
|
15272 | createDetailedUsage,
|
15273 | createUsage
|
15274 | } = require_usage();
|
15275 | var {
|
15276 | formatStdin,
|
15277 | formatFiles
|
15278 | } = require_format();
|
15279 | var logFileInfoOrDie = require_file_info();
|
15280 | var logResolvedConfigPathOrDie = require_find_config_path();
|
15281 | var {
|
15282 | utils: {
|
15283 | isNonEmptyArray
|
15284 | }
|
15285 | } = require_prettier_internal();
|
15286 | var {
|
15287 | printToScreen
|
15288 | } = require_utils();
|
15289 | async function run(rawArguments) {
|
15290 | let logger = createLogger();
|
15291 | try {
|
15292 | const logLevel = parseArgvWithoutPlugins(rawArguments, logger, "loglevel").loglevel;
|
15293 | if (logLevel !== logger.logLevel) {
|
15294 | logger = createLogger(logLevel);
|
15295 | }
|
15296 | const context = new Context({
|
15297 | rawArguments,
|
15298 | logger
|
15299 | });
|
15300 | if (logger.logLevel !== "debug" && context.performanceTestFlag) {
|
15301 | context.logger = createLogger("debug");
|
15302 | }
|
15303 | await main(context);
|
15304 | } catch (error) {
|
15305 | logger.error(error.message);
|
15306 | process.exitCode = 1;
|
15307 | }
|
15308 | }
|
15309 | async function main(context) {
|
15310 | context.logger.debug(`normalized argv: ${JSON.stringify(context.argv)}`);
|
15311 | if (context.argv.pluginSearch === false) {
|
15312 | const rawPluginSearchDirs = context.argv.__raw["plugin-search-dir"];
|
15313 | if (typeof rawPluginSearchDirs === "string" || isNonEmptyArray(rawPluginSearchDirs)) {
|
15314 | throw new Error("Cannot use --no-plugin-search and --plugin-search-dir together.");
|
15315 | }
|
15316 | }
|
15317 | if (context.argv.check && context.argv.listDifferent) {
|
15318 | throw new Error("Cannot use --check and --list-different together.");
|
15319 | }
|
15320 | if (context.argv.write && context.argv.debugCheck) {
|
15321 | throw new Error("Cannot use --write and --debug-check together.");
|
15322 | }
|
15323 | if (context.argv.findConfigPath && context.filePatterns.length > 0) {
|
15324 | throw new Error("Cannot use --find-config-path with multiple files");
|
15325 | }
|
15326 | if (context.argv.fileInfo && context.filePatterns.length > 0) {
|
15327 | throw new Error("Cannot use --file-info with multiple files");
|
15328 | }
|
15329 | if (context.argv.version) {
|
15330 | printToScreen(prettier.version);
|
15331 | return;
|
15332 | }
|
15333 | if (context.argv.help !== void 0) {
|
15334 | printToScreen(typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context));
|
15335 | return;
|
15336 | }
|
15337 | if (context.argv.supportInfo) {
|
15338 | printToScreen(prettier.format(stringify(prettier.getSupportInfo()), {
|
15339 | parser: "json"
|
15340 | }));
|
15341 | return;
|
15342 | }
|
15343 | const hasFilePatterns = context.filePatterns.length > 0;
|
15344 | const useStdin = !hasFilePatterns && (!process.stdin.isTTY || context.argv.filePath);
|
15345 | if (context.argv.findConfigPath) {
|
15346 | await logResolvedConfigPathOrDie(context);
|
15347 | } else if (context.argv.fileInfo) {
|
15348 | await logFileInfoOrDie(context);
|
15349 | } else if (useStdin) {
|
15350 | if (context.argv.cache) {
|
15351 | context.logger.error("`--cache` cannot be used with stdin.");
|
15352 | process.exit(2);
|
15353 | }
|
15354 | await formatStdin(context);
|
15355 | } else if (hasFilePatterns) {
|
15356 | await formatFiles(context);
|
15357 | } else {
|
15358 | process.exitCode = 1;
|
15359 | printToScreen(createUsage(context));
|
15360 | }
|
15361 | }
|
15362 | module.exports = {
|
15363 | run
|
15364 | };
|