@qlover/scripts-context 0.0.11 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +1 -4897
  2. package/dist/index.js +1 -4890
  3. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -1,4890 +1 @@
1
- import { cosmiconfigSync } from 'cosmiconfig';
2
- import { Logger } from '@qlover/fe-corekit';
3
- import chalk from 'chalk';
4
- import { exec } from 'child_process';
5
-
6
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
7
-
8
- function getDefaultExportFromCjs (x) {
9
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
10
- }
11
-
12
- /**
13
- * A faster alternative to `Function#apply`, this function invokes `func`
14
- * with the `this` binding of `thisArg` and the arguments of `args`.
15
- *
16
- * @private
17
- * @param {Function} func The function to invoke.
18
- * @param {*} thisArg The `this` binding of `func`.
19
- * @param {Array} args The arguments to invoke `func` with.
20
- * @returns {*} Returns the result of `func`.
21
- */
22
-
23
- var _apply;
24
- var hasRequired_apply;
25
-
26
- function require_apply () {
27
- if (hasRequired_apply) return _apply;
28
- hasRequired_apply = 1;
29
- function apply(func, thisArg, args) {
30
- switch (args.length) {
31
- case 0: return func.call(thisArg);
32
- case 1: return func.call(thisArg, args[0]);
33
- case 2: return func.call(thisArg, args[0], args[1]);
34
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
35
- }
36
- return func.apply(thisArg, args);
37
- }
38
-
39
- _apply = apply;
40
- return _apply;
41
- }
42
-
43
- /**
44
- * This method returns the first argument it receives.
45
- *
46
- * @static
47
- * @since 0.1.0
48
- * @memberOf _
49
- * @category Util
50
- * @param {*} value Any value.
51
- * @returns {*} Returns `value`.
52
- * @example
53
- *
54
- * var object = { 'a': 1 };
55
- *
56
- * console.log(_.identity(object) === object);
57
- * // => true
58
- */
59
-
60
- var identity_1;
61
- var hasRequiredIdentity;
62
-
63
- function requireIdentity () {
64
- if (hasRequiredIdentity) return identity_1;
65
- hasRequiredIdentity = 1;
66
- function identity(value) {
67
- return value;
68
- }
69
-
70
- identity_1 = identity;
71
- return identity_1;
72
- }
73
-
74
- var _overRest;
75
- var hasRequired_overRest;
76
-
77
- function require_overRest () {
78
- if (hasRequired_overRest) return _overRest;
79
- hasRequired_overRest = 1;
80
- var apply = /*@__PURE__*/ require_apply();
81
-
82
- /* Built-in method references for those with the same name as other `lodash` methods. */
83
- var nativeMax = Math.max;
84
-
85
- /**
86
- * A specialized version of `baseRest` which transforms the rest array.
87
- *
88
- * @private
89
- * @param {Function} func The function to apply a rest parameter to.
90
- * @param {number} [start=func.length-1] The start position of the rest parameter.
91
- * @param {Function} transform The rest array transform.
92
- * @returns {Function} Returns the new function.
93
- */
94
- function overRest(func, start, transform) {
95
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
96
- return function() {
97
- var args = arguments,
98
- index = -1,
99
- length = nativeMax(args.length - start, 0),
100
- array = Array(length);
101
-
102
- while (++index < length) {
103
- array[index] = args[start + index];
104
- }
105
- index = -1;
106
- var otherArgs = Array(start + 1);
107
- while (++index < start) {
108
- otherArgs[index] = args[index];
109
- }
110
- otherArgs[start] = transform(array);
111
- return apply(func, this, otherArgs);
112
- };
113
- }
114
-
115
- _overRest = overRest;
116
- return _overRest;
117
- }
118
-
119
- /**
120
- * Creates a function that returns `value`.
121
- *
122
- * @static
123
- * @memberOf _
124
- * @since 2.4.0
125
- * @category Util
126
- * @param {*} value The value to return from the new function.
127
- * @returns {Function} Returns the new constant function.
128
- * @example
129
- *
130
- * var objects = _.times(2, _.constant({ 'a': 1 }));
131
- *
132
- * console.log(objects);
133
- * // => [{ 'a': 1 }, { 'a': 1 }]
134
- *
135
- * console.log(objects[0] === objects[1]);
136
- * // => true
137
- */
138
-
139
- var constant_1;
140
- var hasRequiredConstant;
141
-
142
- function requireConstant () {
143
- if (hasRequiredConstant) return constant_1;
144
- hasRequiredConstant = 1;
145
- function constant(value) {
146
- return function() {
147
- return value;
148
- };
149
- }
150
-
151
- constant_1 = constant;
152
- return constant_1;
153
- }
154
-
155
- /** Detect free variable `global` from Node.js. */
156
-
157
- var _freeGlobal;
158
- var hasRequired_freeGlobal;
159
-
160
- function require_freeGlobal () {
161
- if (hasRequired_freeGlobal) return _freeGlobal;
162
- hasRequired_freeGlobal = 1;
163
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
164
-
165
- _freeGlobal = freeGlobal;
166
- return _freeGlobal;
167
- }
168
-
169
- var _root;
170
- var hasRequired_root;
171
-
172
- function require_root () {
173
- if (hasRequired_root) return _root;
174
- hasRequired_root = 1;
175
- var freeGlobal = /*@__PURE__*/ require_freeGlobal();
176
-
177
- /** Detect free variable `self`. */
178
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
179
-
180
- /** Used as a reference to the global object. */
181
- var root = freeGlobal || freeSelf || Function('return this')();
182
-
183
- _root = root;
184
- return _root;
185
- }
186
-
187
- var _Symbol;
188
- var hasRequired_Symbol;
189
-
190
- function require_Symbol () {
191
- if (hasRequired_Symbol) return _Symbol;
192
- hasRequired_Symbol = 1;
193
- var root = /*@__PURE__*/ require_root();
194
-
195
- /** Built-in value references. */
196
- var Symbol = root.Symbol;
197
-
198
- _Symbol = Symbol;
199
- return _Symbol;
200
- }
201
-
202
- var _getRawTag;
203
- var hasRequired_getRawTag;
204
-
205
- function require_getRawTag () {
206
- if (hasRequired_getRawTag) return _getRawTag;
207
- hasRequired_getRawTag = 1;
208
- var Symbol = /*@__PURE__*/ require_Symbol();
209
-
210
- /** Used for built-in method references. */
211
- var objectProto = Object.prototype;
212
-
213
- /** Used to check objects for own properties. */
214
- var hasOwnProperty = objectProto.hasOwnProperty;
215
-
216
- /**
217
- * Used to resolve the
218
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
219
- * of values.
220
- */
221
- var nativeObjectToString = objectProto.toString;
222
-
223
- /** Built-in value references. */
224
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
225
-
226
- /**
227
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
228
- *
229
- * @private
230
- * @param {*} value The value to query.
231
- * @returns {string} Returns the raw `toStringTag`.
232
- */
233
- function getRawTag(value) {
234
- var isOwn = hasOwnProperty.call(value, symToStringTag),
235
- tag = value[symToStringTag];
236
-
237
- try {
238
- value[symToStringTag] = undefined;
239
- var unmasked = true;
240
- } catch (e) {}
241
-
242
- var result = nativeObjectToString.call(value);
243
- if (unmasked) {
244
- if (isOwn) {
245
- value[symToStringTag] = tag;
246
- } else {
247
- delete value[symToStringTag];
248
- }
249
- }
250
- return result;
251
- }
252
-
253
- _getRawTag = getRawTag;
254
- return _getRawTag;
255
- }
256
-
257
- /** Used for built-in method references. */
258
-
259
- var _objectToString;
260
- var hasRequired_objectToString;
261
-
262
- function require_objectToString () {
263
- if (hasRequired_objectToString) return _objectToString;
264
- hasRequired_objectToString = 1;
265
- var objectProto = Object.prototype;
266
-
267
- /**
268
- * Used to resolve the
269
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
270
- * of values.
271
- */
272
- var nativeObjectToString = objectProto.toString;
273
-
274
- /**
275
- * Converts `value` to a string using `Object.prototype.toString`.
276
- *
277
- * @private
278
- * @param {*} value The value to convert.
279
- * @returns {string} Returns the converted string.
280
- */
281
- function objectToString(value) {
282
- return nativeObjectToString.call(value);
283
- }
284
-
285
- _objectToString = objectToString;
286
- return _objectToString;
287
- }
288
-
289
- var _baseGetTag;
290
- var hasRequired_baseGetTag;
291
-
292
- function require_baseGetTag () {
293
- if (hasRequired_baseGetTag) return _baseGetTag;
294
- hasRequired_baseGetTag = 1;
295
- var Symbol = /*@__PURE__*/ require_Symbol(),
296
- getRawTag = /*@__PURE__*/ require_getRawTag(),
297
- objectToString = /*@__PURE__*/ require_objectToString();
298
-
299
- /** `Object#toString` result references. */
300
- var nullTag = '[object Null]',
301
- undefinedTag = '[object Undefined]';
302
-
303
- /** Built-in value references. */
304
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
305
-
306
- /**
307
- * The base implementation of `getTag` without fallbacks for buggy environments.
308
- *
309
- * @private
310
- * @param {*} value The value to query.
311
- * @returns {string} Returns the `toStringTag`.
312
- */
313
- function baseGetTag(value) {
314
- if (value == null) {
315
- return value === undefined ? undefinedTag : nullTag;
316
- }
317
- return (symToStringTag && symToStringTag in Object(value))
318
- ? getRawTag(value)
319
- : objectToString(value);
320
- }
321
-
322
- _baseGetTag = baseGetTag;
323
- return _baseGetTag;
324
- }
325
-
326
- /**
327
- * Checks if `value` is the
328
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
329
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
330
- *
331
- * @static
332
- * @memberOf _
333
- * @since 0.1.0
334
- * @category Lang
335
- * @param {*} value The value to check.
336
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
337
- * @example
338
- *
339
- * _.isObject({});
340
- * // => true
341
- *
342
- * _.isObject([1, 2, 3]);
343
- * // => true
344
- *
345
- * _.isObject(_.noop);
346
- * // => true
347
- *
348
- * _.isObject(null);
349
- * // => false
350
- */
351
-
352
- var isObject_1;
353
- var hasRequiredIsObject;
354
-
355
- function requireIsObject () {
356
- if (hasRequiredIsObject) return isObject_1;
357
- hasRequiredIsObject = 1;
358
- function isObject(value) {
359
- var type = typeof value;
360
- return value != null && (type == 'object' || type == 'function');
361
- }
362
-
363
- isObject_1 = isObject;
364
- return isObject_1;
365
- }
366
-
367
- var isFunction_1;
368
- var hasRequiredIsFunction;
369
-
370
- function requireIsFunction () {
371
- if (hasRequiredIsFunction) return isFunction_1;
372
- hasRequiredIsFunction = 1;
373
- var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
374
- isObject = /*@__PURE__*/ requireIsObject();
375
-
376
- /** `Object#toString` result references. */
377
- var asyncTag = '[object AsyncFunction]',
378
- funcTag = '[object Function]',
379
- genTag = '[object GeneratorFunction]',
380
- proxyTag = '[object Proxy]';
381
-
382
- /**
383
- * Checks if `value` is classified as a `Function` object.
384
- *
385
- * @static
386
- * @memberOf _
387
- * @since 0.1.0
388
- * @category Lang
389
- * @param {*} value The value to check.
390
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
391
- * @example
392
- *
393
- * _.isFunction(_);
394
- * // => true
395
- *
396
- * _.isFunction(/abc/);
397
- * // => false
398
- */
399
- function isFunction(value) {
400
- if (!isObject(value)) {
401
- return false;
402
- }
403
- // The use of `Object#toString` avoids issues with the `typeof` operator
404
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
405
- var tag = baseGetTag(value);
406
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
407
- }
408
-
409
- isFunction_1 = isFunction;
410
- return isFunction_1;
411
- }
412
-
413
- var _coreJsData;
414
- var hasRequired_coreJsData;
415
-
416
- function require_coreJsData () {
417
- if (hasRequired_coreJsData) return _coreJsData;
418
- hasRequired_coreJsData = 1;
419
- var root = /*@__PURE__*/ require_root();
420
-
421
- /** Used to detect overreaching core-js shims. */
422
- var coreJsData = root['__core-js_shared__'];
423
-
424
- _coreJsData = coreJsData;
425
- return _coreJsData;
426
- }
427
-
428
- var _isMasked;
429
- var hasRequired_isMasked;
430
-
431
- function require_isMasked () {
432
- if (hasRequired_isMasked) return _isMasked;
433
- hasRequired_isMasked = 1;
434
- var coreJsData = /*@__PURE__*/ require_coreJsData();
435
-
436
- /** Used to detect methods masquerading as native. */
437
- var maskSrcKey = (function() {
438
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
439
- return uid ? ('Symbol(src)_1.' + uid) : '';
440
- }());
441
-
442
- /**
443
- * Checks if `func` has its source masked.
444
- *
445
- * @private
446
- * @param {Function} func The function to check.
447
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
448
- */
449
- function isMasked(func) {
450
- return !!maskSrcKey && (maskSrcKey in func);
451
- }
452
-
453
- _isMasked = isMasked;
454
- return _isMasked;
455
- }
456
-
457
- /** Used for built-in method references. */
458
-
459
- var _toSource;
460
- var hasRequired_toSource;
461
-
462
- function require_toSource () {
463
- if (hasRequired_toSource) return _toSource;
464
- hasRequired_toSource = 1;
465
- var funcProto = Function.prototype;
466
-
467
- /** Used to resolve the decompiled source of functions. */
468
- var funcToString = funcProto.toString;
469
-
470
- /**
471
- * Converts `func` to its source code.
472
- *
473
- * @private
474
- * @param {Function} func The function to convert.
475
- * @returns {string} Returns the source code.
476
- */
477
- function toSource(func) {
478
- if (func != null) {
479
- try {
480
- return funcToString.call(func);
481
- } catch (e) {}
482
- try {
483
- return (func + '');
484
- } catch (e) {}
485
- }
486
- return '';
487
- }
488
-
489
- _toSource = toSource;
490
- return _toSource;
491
- }
492
-
493
- var _baseIsNative;
494
- var hasRequired_baseIsNative;
495
-
496
- function require_baseIsNative () {
497
- if (hasRequired_baseIsNative) return _baseIsNative;
498
- hasRequired_baseIsNative = 1;
499
- var isFunction = /*@__PURE__*/ requireIsFunction(),
500
- isMasked = /*@__PURE__*/ require_isMasked(),
501
- isObject = /*@__PURE__*/ requireIsObject(),
502
- toSource = /*@__PURE__*/ require_toSource();
503
-
504
- /**
505
- * Used to match `RegExp`
506
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
507
- */
508
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
509
-
510
- /** Used to detect host constructors (Safari). */
511
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
512
-
513
- /** Used for built-in method references. */
514
- var funcProto = Function.prototype,
515
- objectProto = Object.prototype;
516
-
517
- /** Used to resolve the decompiled source of functions. */
518
- var funcToString = funcProto.toString;
519
-
520
- /** Used to check objects for own properties. */
521
- var hasOwnProperty = objectProto.hasOwnProperty;
522
-
523
- /** Used to detect if a method is native. */
524
- var reIsNative = RegExp('^' +
525
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
526
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
527
- );
528
-
529
- /**
530
- * The base implementation of `_.isNative` without bad shim checks.
531
- *
532
- * @private
533
- * @param {*} value The value to check.
534
- * @returns {boolean} Returns `true` if `value` is a native function,
535
- * else `false`.
536
- */
537
- function baseIsNative(value) {
538
- if (!isObject(value) || isMasked(value)) {
539
- return false;
540
- }
541
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
542
- return pattern.test(toSource(value));
543
- }
544
-
545
- _baseIsNative = baseIsNative;
546
- return _baseIsNative;
547
- }
548
-
549
- /**
550
- * Gets the value at `key` of `object`.
551
- *
552
- * @private
553
- * @param {Object} [object] The object to query.
554
- * @param {string} key The key of the property to get.
555
- * @returns {*} Returns the property value.
556
- */
557
-
558
- var _getValue;
559
- var hasRequired_getValue;
560
-
561
- function require_getValue () {
562
- if (hasRequired_getValue) return _getValue;
563
- hasRequired_getValue = 1;
564
- function getValue(object, key) {
565
- return object == null ? undefined : object[key];
566
- }
567
-
568
- _getValue = getValue;
569
- return _getValue;
570
- }
571
-
572
- var _getNative;
573
- var hasRequired_getNative;
574
-
575
- function require_getNative () {
576
- if (hasRequired_getNative) return _getNative;
577
- hasRequired_getNative = 1;
578
- var baseIsNative = /*@__PURE__*/ require_baseIsNative(),
579
- getValue = /*@__PURE__*/ require_getValue();
580
-
581
- /**
582
- * Gets the native function at `key` of `object`.
583
- *
584
- * @private
585
- * @param {Object} object The object to query.
586
- * @param {string} key The key of the method to get.
587
- * @returns {*} Returns the function if it's native, else `undefined`.
588
- */
589
- function getNative(object, key) {
590
- var value = getValue(object, key);
591
- return baseIsNative(value) ? value : undefined;
592
- }
593
-
594
- _getNative = getNative;
595
- return _getNative;
596
- }
597
-
598
- var _defineProperty;
599
- var hasRequired_defineProperty;
600
-
601
- function require_defineProperty () {
602
- if (hasRequired_defineProperty) return _defineProperty;
603
- hasRequired_defineProperty = 1;
604
- var getNative = /*@__PURE__*/ require_getNative();
605
-
606
- var defineProperty = (function() {
607
- try {
608
- var func = getNative(Object, 'defineProperty');
609
- func({}, '', {});
610
- return func;
611
- } catch (e) {}
612
- }());
613
-
614
- _defineProperty = defineProperty;
615
- return _defineProperty;
616
- }
617
-
618
- var _baseSetToString;
619
- var hasRequired_baseSetToString;
620
-
621
- function require_baseSetToString () {
622
- if (hasRequired_baseSetToString) return _baseSetToString;
623
- hasRequired_baseSetToString = 1;
624
- var constant = /*@__PURE__*/ requireConstant(),
625
- defineProperty = /*@__PURE__*/ require_defineProperty(),
626
- identity = /*@__PURE__*/ requireIdentity();
627
-
628
- /**
629
- * The base implementation of `setToString` without support for hot loop shorting.
630
- *
631
- * @private
632
- * @param {Function} func The function to modify.
633
- * @param {Function} string The `toString` result.
634
- * @returns {Function} Returns `func`.
635
- */
636
- var baseSetToString = !defineProperty ? identity : function(func, string) {
637
- return defineProperty(func, 'toString', {
638
- 'configurable': true,
639
- 'enumerable': false,
640
- 'value': constant(string),
641
- 'writable': true
642
- });
643
- };
644
-
645
- _baseSetToString = baseSetToString;
646
- return _baseSetToString;
647
- }
648
-
649
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
650
-
651
- var _shortOut;
652
- var hasRequired_shortOut;
653
-
654
- function require_shortOut () {
655
- if (hasRequired_shortOut) return _shortOut;
656
- hasRequired_shortOut = 1;
657
- var HOT_COUNT = 800,
658
- HOT_SPAN = 16;
659
-
660
- /* Built-in method references for those with the same name as other `lodash` methods. */
661
- var nativeNow = Date.now;
662
-
663
- /**
664
- * Creates a function that'll short out and invoke `identity` instead
665
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
666
- * milliseconds.
667
- *
668
- * @private
669
- * @param {Function} func The function to restrict.
670
- * @returns {Function} Returns the new shortable function.
671
- */
672
- function shortOut(func) {
673
- var count = 0,
674
- lastCalled = 0;
675
-
676
- return function() {
677
- var stamp = nativeNow(),
678
- remaining = HOT_SPAN - (stamp - lastCalled);
679
-
680
- lastCalled = stamp;
681
- if (remaining > 0) {
682
- if (++count >= HOT_COUNT) {
683
- return arguments[0];
684
- }
685
- } else {
686
- count = 0;
687
- }
688
- return func.apply(undefined, arguments);
689
- };
690
- }
691
-
692
- _shortOut = shortOut;
693
- return _shortOut;
694
- }
695
-
696
- var _setToString;
697
- var hasRequired_setToString;
698
-
699
- function require_setToString () {
700
- if (hasRequired_setToString) return _setToString;
701
- hasRequired_setToString = 1;
702
- var baseSetToString = /*@__PURE__*/ require_baseSetToString(),
703
- shortOut = /*@__PURE__*/ require_shortOut();
704
-
705
- /**
706
- * Sets the `toString` method of `func` to return `string`.
707
- *
708
- * @private
709
- * @param {Function} func The function to modify.
710
- * @param {Function} string The `toString` result.
711
- * @returns {Function} Returns `func`.
712
- */
713
- var setToString = shortOut(baseSetToString);
714
-
715
- _setToString = setToString;
716
- return _setToString;
717
- }
718
-
719
- var _baseRest;
720
- var hasRequired_baseRest;
721
-
722
- function require_baseRest () {
723
- if (hasRequired_baseRest) return _baseRest;
724
- hasRequired_baseRest = 1;
725
- var identity = /*@__PURE__*/ requireIdentity(),
726
- overRest = /*@__PURE__*/ require_overRest(),
727
- setToString = /*@__PURE__*/ require_setToString();
728
-
729
- /**
730
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
731
- *
732
- * @private
733
- * @param {Function} func The function to apply a rest parameter to.
734
- * @param {number} [start=func.length-1] The start position of the rest parameter.
735
- * @returns {Function} Returns the new function.
736
- */
737
- function baseRest(func, start) {
738
- return setToString(overRest(func, start, identity), func + '');
739
- }
740
-
741
- _baseRest = baseRest;
742
- return _baseRest;
743
- }
744
-
745
- /**
746
- * Removes all key-value entries from the list cache.
747
- *
748
- * @private
749
- * @name clear
750
- * @memberOf ListCache
751
- */
752
-
753
- var _listCacheClear;
754
- var hasRequired_listCacheClear;
755
-
756
- function require_listCacheClear () {
757
- if (hasRequired_listCacheClear) return _listCacheClear;
758
- hasRequired_listCacheClear = 1;
759
- function listCacheClear() {
760
- this.__data__ = [];
761
- this.size = 0;
762
- }
763
-
764
- _listCacheClear = listCacheClear;
765
- return _listCacheClear;
766
- }
767
-
768
- /**
769
- * Performs a
770
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
771
- * comparison between two values to determine if they are equivalent.
772
- *
773
- * @static
774
- * @memberOf _
775
- * @since 4.0.0
776
- * @category Lang
777
- * @param {*} value The value to compare.
778
- * @param {*} other The other value to compare.
779
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
780
- * @example
781
- *
782
- * var object = { 'a': 1 };
783
- * var other = { 'a': 1 };
784
- *
785
- * _.eq(object, object);
786
- * // => true
787
- *
788
- * _.eq(object, other);
789
- * // => false
790
- *
791
- * _.eq('a', 'a');
792
- * // => true
793
- *
794
- * _.eq('a', Object('a'));
795
- * // => false
796
- *
797
- * _.eq(NaN, NaN);
798
- * // => true
799
- */
800
-
801
- var eq_1;
802
- var hasRequiredEq;
803
-
804
- function requireEq () {
805
- if (hasRequiredEq) return eq_1;
806
- hasRequiredEq = 1;
807
- function eq(value, other) {
808
- return value === other || (value !== value && other !== other);
809
- }
810
-
811
- eq_1 = eq;
812
- return eq_1;
813
- }
814
-
815
- var _assocIndexOf;
816
- var hasRequired_assocIndexOf;
817
-
818
- function require_assocIndexOf () {
819
- if (hasRequired_assocIndexOf) return _assocIndexOf;
820
- hasRequired_assocIndexOf = 1;
821
- var eq = /*@__PURE__*/ requireEq();
822
-
823
- /**
824
- * Gets the index at which the `key` is found in `array` of key-value pairs.
825
- *
826
- * @private
827
- * @param {Array} array The array to inspect.
828
- * @param {*} key The key to search for.
829
- * @returns {number} Returns the index of the matched value, else `-1`.
830
- */
831
- function assocIndexOf(array, key) {
832
- var length = array.length;
833
- while (length--) {
834
- if (eq(array[length][0], key)) {
835
- return length;
836
- }
837
- }
838
- return -1;
839
- }
840
-
841
- _assocIndexOf = assocIndexOf;
842
- return _assocIndexOf;
843
- }
844
-
845
- var _listCacheDelete;
846
- var hasRequired_listCacheDelete;
847
-
848
- function require_listCacheDelete () {
849
- if (hasRequired_listCacheDelete) return _listCacheDelete;
850
- hasRequired_listCacheDelete = 1;
851
- var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
852
-
853
- /** Used for built-in method references. */
854
- var arrayProto = Array.prototype;
855
-
856
- /** Built-in value references. */
857
- var splice = arrayProto.splice;
858
-
859
- /**
860
- * Removes `key` and its value from the list cache.
861
- *
862
- * @private
863
- * @name delete
864
- * @memberOf ListCache
865
- * @param {string} key The key of the value to remove.
866
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
867
- */
868
- function listCacheDelete(key) {
869
- var data = this.__data__,
870
- index = assocIndexOf(data, key);
871
-
872
- if (index < 0) {
873
- return false;
874
- }
875
- var lastIndex = data.length - 1;
876
- if (index == lastIndex) {
877
- data.pop();
878
- } else {
879
- splice.call(data, index, 1);
880
- }
881
- --this.size;
882
- return true;
883
- }
884
-
885
- _listCacheDelete = listCacheDelete;
886
- return _listCacheDelete;
887
- }
888
-
889
- var _listCacheGet;
890
- var hasRequired_listCacheGet;
891
-
892
- function require_listCacheGet () {
893
- if (hasRequired_listCacheGet) return _listCacheGet;
894
- hasRequired_listCacheGet = 1;
895
- var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
896
-
897
- /**
898
- * Gets the list cache value for `key`.
899
- *
900
- * @private
901
- * @name get
902
- * @memberOf ListCache
903
- * @param {string} key The key of the value to get.
904
- * @returns {*} Returns the entry value.
905
- */
906
- function listCacheGet(key) {
907
- var data = this.__data__,
908
- index = assocIndexOf(data, key);
909
-
910
- return index < 0 ? undefined : data[index][1];
911
- }
912
-
913
- _listCacheGet = listCacheGet;
914
- return _listCacheGet;
915
- }
916
-
917
- var _listCacheHas;
918
- var hasRequired_listCacheHas;
919
-
920
- function require_listCacheHas () {
921
- if (hasRequired_listCacheHas) return _listCacheHas;
922
- hasRequired_listCacheHas = 1;
923
- var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
924
-
925
- /**
926
- * Checks if a list cache value for `key` exists.
927
- *
928
- * @private
929
- * @name has
930
- * @memberOf ListCache
931
- * @param {string} key The key of the entry to check.
932
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
933
- */
934
- function listCacheHas(key) {
935
- return assocIndexOf(this.__data__, key) > -1;
936
- }
937
-
938
- _listCacheHas = listCacheHas;
939
- return _listCacheHas;
940
- }
941
-
942
- var _listCacheSet;
943
- var hasRequired_listCacheSet;
944
-
945
- function require_listCacheSet () {
946
- if (hasRequired_listCacheSet) return _listCacheSet;
947
- hasRequired_listCacheSet = 1;
948
- var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
949
-
950
- /**
951
- * Sets the list cache `key` to `value`.
952
- *
953
- * @private
954
- * @name set
955
- * @memberOf ListCache
956
- * @param {string} key The key of the value to set.
957
- * @param {*} value The value to set.
958
- * @returns {Object} Returns the list cache instance.
959
- */
960
- function listCacheSet(key, value) {
961
- var data = this.__data__,
962
- index = assocIndexOf(data, key);
963
-
964
- if (index < 0) {
965
- ++this.size;
966
- data.push([key, value]);
967
- } else {
968
- data[index][1] = value;
969
- }
970
- return this;
971
- }
972
-
973
- _listCacheSet = listCacheSet;
974
- return _listCacheSet;
975
- }
976
-
977
- var _ListCache;
978
- var hasRequired_ListCache;
979
-
980
- function require_ListCache () {
981
- if (hasRequired_ListCache) return _ListCache;
982
- hasRequired_ListCache = 1;
983
- var listCacheClear = /*@__PURE__*/ require_listCacheClear(),
984
- listCacheDelete = /*@__PURE__*/ require_listCacheDelete(),
985
- listCacheGet = /*@__PURE__*/ require_listCacheGet(),
986
- listCacheHas = /*@__PURE__*/ require_listCacheHas(),
987
- listCacheSet = /*@__PURE__*/ require_listCacheSet();
988
-
989
- /**
990
- * Creates an list cache object.
991
- *
992
- * @private
993
- * @constructor
994
- * @param {Array} [entries] The key-value pairs to cache.
995
- */
996
- function ListCache(entries) {
997
- var index = -1,
998
- length = entries == null ? 0 : entries.length;
999
-
1000
- this.clear();
1001
- while (++index < length) {
1002
- var entry = entries[index];
1003
- this.set(entry[0], entry[1]);
1004
- }
1005
- }
1006
-
1007
- // Add methods to `ListCache`.
1008
- ListCache.prototype.clear = listCacheClear;
1009
- ListCache.prototype['delete'] = listCacheDelete;
1010
- ListCache.prototype.get = listCacheGet;
1011
- ListCache.prototype.has = listCacheHas;
1012
- ListCache.prototype.set = listCacheSet;
1013
-
1014
- _ListCache = ListCache;
1015
- return _ListCache;
1016
- }
1017
-
1018
- var _stackClear;
1019
- var hasRequired_stackClear;
1020
-
1021
- function require_stackClear () {
1022
- if (hasRequired_stackClear) return _stackClear;
1023
- hasRequired_stackClear = 1;
1024
- var ListCache = /*@__PURE__*/ require_ListCache();
1025
-
1026
- /**
1027
- * Removes all key-value entries from the stack.
1028
- *
1029
- * @private
1030
- * @name clear
1031
- * @memberOf Stack
1032
- */
1033
- function stackClear() {
1034
- this.__data__ = new ListCache;
1035
- this.size = 0;
1036
- }
1037
-
1038
- _stackClear = stackClear;
1039
- return _stackClear;
1040
- }
1041
-
1042
- /**
1043
- * Removes `key` and its value from the stack.
1044
- *
1045
- * @private
1046
- * @name delete
1047
- * @memberOf Stack
1048
- * @param {string} key The key of the value to remove.
1049
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1050
- */
1051
-
1052
- var _stackDelete;
1053
- var hasRequired_stackDelete;
1054
-
1055
- function require_stackDelete () {
1056
- if (hasRequired_stackDelete) return _stackDelete;
1057
- hasRequired_stackDelete = 1;
1058
- function stackDelete(key) {
1059
- var data = this.__data__,
1060
- result = data['delete'](key);
1061
-
1062
- this.size = data.size;
1063
- return result;
1064
- }
1065
-
1066
- _stackDelete = stackDelete;
1067
- return _stackDelete;
1068
- }
1069
-
1070
- /**
1071
- * Gets the stack value for `key`.
1072
- *
1073
- * @private
1074
- * @name get
1075
- * @memberOf Stack
1076
- * @param {string} key The key of the value to get.
1077
- * @returns {*} Returns the entry value.
1078
- */
1079
-
1080
- var _stackGet;
1081
- var hasRequired_stackGet;
1082
-
1083
- function require_stackGet () {
1084
- if (hasRequired_stackGet) return _stackGet;
1085
- hasRequired_stackGet = 1;
1086
- function stackGet(key) {
1087
- return this.__data__.get(key);
1088
- }
1089
-
1090
- _stackGet = stackGet;
1091
- return _stackGet;
1092
- }
1093
-
1094
- /**
1095
- * Checks if a stack value for `key` exists.
1096
- *
1097
- * @private
1098
- * @name has
1099
- * @memberOf Stack
1100
- * @param {string} key The key of the entry to check.
1101
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1102
- */
1103
-
1104
- var _stackHas;
1105
- var hasRequired_stackHas;
1106
-
1107
- function require_stackHas () {
1108
- if (hasRequired_stackHas) return _stackHas;
1109
- hasRequired_stackHas = 1;
1110
- function stackHas(key) {
1111
- return this.__data__.has(key);
1112
- }
1113
-
1114
- _stackHas = stackHas;
1115
- return _stackHas;
1116
- }
1117
-
1118
- var _Map;
1119
- var hasRequired_Map;
1120
-
1121
- function require_Map () {
1122
- if (hasRequired_Map) return _Map;
1123
- hasRequired_Map = 1;
1124
- var getNative = /*@__PURE__*/ require_getNative(),
1125
- root = /*@__PURE__*/ require_root();
1126
-
1127
- /* Built-in method references that are verified to be native. */
1128
- var Map = getNative(root, 'Map');
1129
-
1130
- _Map = Map;
1131
- return _Map;
1132
- }
1133
-
1134
- var _nativeCreate;
1135
- var hasRequired_nativeCreate;
1136
-
1137
- function require_nativeCreate () {
1138
- if (hasRequired_nativeCreate) return _nativeCreate;
1139
- hasRequired_nativeCreate = 1;
1140
- var getNative = /*@__PURE__*/ require_getNative();
1141
-
1142
- /* Built-in method references that are verified to be native. */
1143
- var nativeCreate = getNative(Object, 'create');
1144
-
1145
- _nativeCreate = nativeCreate;
1146
- return _nativeCreate;
1147
- }
1148
-
1149
- var _hashClear;
1150
- var hasRequired_hashClear;
1151
-
1152
- function require_hashClear () {
1153
- if (hasRequired_hashClear) return _hashClear;
1154
- hasRequired_hashClear = 1;
1155
- var nativeCreate = /*@__PURE__*/ require_nativeCreate();
1156
-
1157
- /**
1158
- * Removes all key-value entries from the hash.
1159
- *
1160
- * @private
1161
- * @name clear
1162
- * @memberOf Hash
1163
- */
1164
- function hashClear() {
1165
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
1166
- this.size = 0;
1167
- }
1168
-
1169
- _hashClear = hashClear;
1170
- return _hashClear;
1171
- }
1172
-
1173
- /**
1174
- * Removes `key` and its value from the hash.
1175
- *
1176
- * @private
1177
- * @name delete
1178
- * @memberOf Hash
1179
- * @param {Object} hash The hash to modify.
1180
- * @param {string} key The key of the value to remove.
1181
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1182
- */
1183
-
1184
- var _hashDelete;
1185
- var hasRequired_hashDelete;
1186
-
1187
- function require_hashDelete () {
1188
- if (hasRequired_hashDelete) return _hashDelete;
1189
- hasRequired_hashDelete = 1;
1190
- function hashDelete(key) {
1191
- var result = this.has(key) && delete this.__data__[key];
1192
- this.size -= result ? 1 : 0;
1193
- return result;
1194
- }
1195
-
1196
- _hashDelete = hashDelete;
1197
- return _hashDelete;
1198
- }
1199
-
1200
- var _hashGet;
1201
- var hasRequired_hashGet;
1202
-
1203
- function require_hashGet () {
1204
- if (hasRequired_hashGet) return _hashGet;
1205
- hasRequired_hashGet = 1;
1206
- var nativeCreate = /*@__PURE__*/ require_nativeCreate();
1207
-
1208
- /** Used to stand-in for `undefined` hash values. */
1209
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1210
-
1211
- /** Used for built-in method references. */
1212
- var objectProto = Object.prototype;
1213
-
1214
- /** Used to check objects for own properties. */
1215
- var hasOwnProperty = objectProto.hasOwnProperty;
1216
-
1217
- /**
1218
- * Gets the hash value for `key`.
1219
- *
1220
- * @private
1221
- * @name get
1222
- * @memberOf Hash
1223
- * @param {string} key The key of the value to get.
1224
- * @returns {*} Returns the entry value.
1225
- */
1226
- function hashGet(key) {
1227
- var data = this.__data__;
1228
- if (nativeCreate) {
1229
- var result = data[key];
1230
- return result === HASH_UNDEFINED ? undefined : result;
1231
- }
1232
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
1233
- }
1234
-
1235
- _hashGet = hashGet;
1236
- return _hashGet;
1237
- }
1238
-
1239
- var _hashHas;
1240
- var hasRequired_hashHas;
1241
-
1242
- function require_hashHas () {
1243
- if (hasRequired_hashHas) return _hashHas;
1244
- hasRequired_hashHas = 1;
1245
- var nativeCreate = /*@__PURE__*/ require_nativeCreate();
1246
-
1247
- /** Used for built-in method references. */
1248
- var objectProto = Object.prototype;
1249
-
1250
- /** Used to check objects for own properties. */
1251
- var hasOwnProperty = objectProto.hasOwnProperty;
1252
-
1253
- /**
1254
- * Checks if a hash value for `key` exists.
1255
- *
1256
- * @private
1257
- * @name has
1258
- * @memberOf Hash
1259
- * @param {string} key The key of the entry to check.
1260
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1261
- */
1262
- function hashHas(key) {
1263
- var data = this.__data__;
1264
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
1265
- }
1266
-
1267
- _hashHas = hashHas;
1268
- return _hashHas;
1269
- }
1270
-
1271
- var _hashSet;
1272
- var hasRequired_hashSet;
1273
-
1274
- function require_hashSet () {
1275
- if (hasRequired_hashSet) return _hashSet;
1276
- hasRequired_hashSet = 1;
1277
- var nativeCreate = /*@__PURE__*/ require_nativeCreate();
1278
-
1279
- /** Used to stand-in for `undefined` hash values. */
1280
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1281
-
1282
- /**
1283
- * Sets the hash `key` to `value`.
1284
- *
1285
- * @private
1286
- * @name set
1287
- * @memberOf Hash
1288
- * @param {string} key The key of the value to set.
1289
- * @param {*} value The value to set.
1290
- * @returns {Object} Returns the hash instance.
1291
- */
1292
- function hashSet(key, value) {
1293
- var data = this.__data__;
1294
- this.size += this.has(key) ? 0 : 1;
1295
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1296
- return this;
1297
- }
1298
-
1299
- _hashSet = hashSet;
1300
- return _hashSet;
1301
- }
1302
-
1303
- var _Hash;
1304
- var hasRequired_Hash;
1305
-
1306
- function require_Hash () {
1307
- if (hasRequired_Hash) return _Hash;
1308
- hasRequired_Hash = 1;
1309
- var hashClear = /*@__PURE__*/ require_hashClear(),
1310
- hashDelete = /*@__PURE__*/ require_hashDelete(),
1311
- hashGet = /*@__PURE__*/ require_hashGet(),
1312
- hashHas = /*@__PURE__*/ require_hashHas(),
1313
- hashSet = /*@__PURE__*/ require_hashSet();
1314
-
1315
- /**
1316
- * Creates a hash object.
1317
- *
1318
- * @private
1319
- * @constructor
1320
- * @param {Array} [entries] The key-value pairs to cache.
1321
- */
1322
- function Hash(entries) {
1323
- var index = -1,
1324
- length = entries == null ? 0 : entries.length;
1325
-
1326
- this.clear();
1327
- while (++index < length) {
1328
- var entry = entries[index];
1329
- this.set(entry[0], entry[1]);
1330
- }
1331
- }
1332
-
1333
- // Add methods to `Hash`.
1334
- Hash.prototype.clear = hashClear;
1335
- Hash.prototype['delete'] = hashDelete;
1336
- Hash.prototype.get = hashGet;
1337
- Hash.prototype.has = hashHas;
1338
- Hash.prototype.set = hashSet;
1339
-
1340
- _Hash = Hash;
1341
- return _Hash;
1342
- }
1343
-
1344
- var _mapCacheClear;
1345
- var hasRequired_mapCacheClear;
1346
-
1347
- function require_mapCacheClear () {
1348
- if (hasRequired_mapCacheClear) return _mapCacheClear;
1349
- hasRequired_mapCacheClear = 1;
1350
- var Hash = /*@__PURE__*/ require_Hash(),
1351
- ListCache = /*@__PURE__*/ require_ListCache(),
1352
- Map = /*@__PURE__*/ require_Map();
1353
-
1354
- /**
1355
- * Removes all key-value entries from the map.
1356
- *
1357
- * @private
1358
- * @name clear
1359
- * @memberOf MapCache
1360
- */
1361
- function mapCacheClear() {
1362
- this.size = 0;
1363
- this.__data__ = {
1364
- 'hash': new Hash,
1365
- 'map': new (Map || ListCache),
1366
- 'string': new Hash
1367
- };
1368
- }
1369
-
1370
- _mapCacheClear = mapCacheClear;
1371
- return _mapCacheClear;
1372
- }
1373
-
1374
- /**
1375
- * Checks if `value` is suitable for use as unique object key.
1376
- *
1377
- * @private
1378
- * @param {*} value The value to check.
1379
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1380
- */
1381
-
1382
- var _isKeyable;
1383
- var hasRequired_isKeyable;
1384
-
1385
- function require_isKeyable () {
1386
- if (hasRequired_isKeyable) return _isKeyable;
1387
- hasRequired_isKeyable = 1;
1388
- function isKeyable(value) {
1389
- var type = typeof value;
1390
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1391
- ? (value !== '__proto__')
1392
- : (value === null);
1393
- }
1394
-
1395
- _isKeyable = isKeyable;
1396
- return _isKeyable;
1397
- }
1398
-
1399
- var _getMapData;
1400
- var hasRequired_getMapData;
1401
-
1402
- function require_getMapData () {
1403
- if (hasRequired_getMapData) return _getMapData;
1404
- hasRequired_getMapData = 1;
1405
- var isKeyable = /*@__PURE__*/ require_isKeyable();
1406
-
1407
- /**
1408
- * Gets the data for `map`.
1409
- *
1410
- * @private
1411
- * @param {Object} map The map to query.
1412
- * @param {string} key The reference key.
1413
- * @returns {*} Returns the map data.
1414
- */
1415
- function getMapData(map, key) {
1416
- var data = map.__data__;
1417
- return isKeyable(key)
1418
- ? data[typeof key == 'string' ? 'string' : 'hash']
1419
- : data.map;
1420
- }
1421
-
1422
- _getMapData = getMapData;
1423
- return _getMapData;
1424
- }
1425
-
1426
- var _mapCacheDelete;
1427
- var hasRequired_mapCacheDelete;
1428
-
1429
- function require_mapCacheDelete () {
1430
- if (hasRequired_mapCacheDelete) return _mapCacheDelete;
1431
- hasRequired_mapCacheDelete = 1;
1432
- var getMapData = /*@__PURE__*/ require_getMapData();
1433
-
1434
- /**
1435
- * Removes `key` and its value from the map.
1436
- *
1437
- * @private
1438
- * @name delete
1439
- * @memberOf MapCache
1440
- * @param {string} key The key of the value to remove.
1441
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1442
- */
1443
- function mapCacheDelete(key) {
1444
- var result = getMapData(this, key)['delete'](key);
1445
- this.size -= result ? 1 : 0;
1446
- return result;
1447
- }
1448
-
1449
- _mapCacheDelete = mapCacheDelete;
1450
- return _mapCacheDelete;
1451
- }
1452
-
1453
- var _mapCacheGet;
1454
- var hasRequired_mapCacheGet;
1455
-
1456
- function require_mapCacheGet () {
1457
- if (hasRequired_mapCacheGet) return _mapCacheGet;
1458
- hasRequired_mapCacheGet = 1;
1459
- var getMapData = /*@__PURE__*/ require_getMapData();
1460
-
1461
- /**
1462
- * Gets the map value for `key`.
1463
- *
1464
- * @private
1465
- * @name get
1466
- * @memberOf MapCache
1467
- * @param {string} key The key of the value to get.
1468
- * @returns {*} Returns the entry value.
1469
- */
1470
- function mapCacheGet(key) {
1471
- return getMapData(this, key).get(key);
1472
- }
1473
-
1474
- _mapCacheGet = mapCacheGet;
1475
- return _mapCacheGet;
1476
- }
1477
-
1478
- var _mapCacheHas;
1479
- var hasRequired_mapCacheHas;
1480
-
1481
- function require_mapCacheHas () {
1482
- if (hasRequired_mapCacheHas) return _mapCacheHas;
1483
- hasRequired_mapCacheHas = 1;
1484
- var getMapData = /*@__PURE__*/ require_getMapData();
1485
-
1486
- /**
1487
- * Checks if a map value for `key` exists.
1488
- *
1489
- * @private
1490
- * @name has
1491
- * @memberOf MapCache
1492
- * @param {string} key The key of the entry to check.
1493
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1494
- */
1495
- function mapCacheHas(key) {
1496
- return getMapData(this, key).has(key);
1497
- }
1498
-
1499
- _mapCacheHas = mapCacheHas;
1500
- return _mapCacheHas;
1501
- }
1502
-
1503
- var _mapCacheSet;
1504
- var hasRequired_mapCacheSet;
1505
-
1506
- function require_mapCacheSet () {
1507
- if (hasRequired_mapCacheSet) return _mapCacheSet;
1508
- hasRequired_mapCacheSet = 1;
1509
- var getMapData = /*@__PURE__*/ require_getMapData();
1510
-
1511
- /**
1512
- * Sets the map `key` to `value`.
1513
- *
1514
- * @private
1515
- * @name set
1516
- * @memberOf MapCache
1517
- * @param {string} key The key of the value to set.
1518
- * @param {*} value The value to set.
1519
- * @returns {Object} Returns the map cache instance.
1520
- */
1521
- function mapCacheSet(key, value) {
1522
- var data = getMapData(this, key),
1523
- size = data.size;
1524
-
1525
- data.set(key, value);
1526
- this.size += data.size == size ? 0 : 1;
1527
- return this;
1528
- }
1529
-
1530
- _mapCacheSet = mapCacheSet;
1531
- return _mapCacheSet;
1532
- }
1533
-
1534
- var _MapCache;
1535
- var hasRequired_MapCache;
1536
-
1537
- function require_MapCache () {
1538
- if (hasRequired_MapCache) return _MapCache;
1539
- hasRequired_MapCache = 1;
1540
- var mapCacheClear = /*@__PURE__*/ require_mapCacheClear(),
1541
- mapCacheDelete = /*@__PURE__*/ require_mapCacheDelete(),
1542
- mapCacheGet = /*@__PURE__*/ require_mapCacheGet(),
1543
- mapCacheHas = /*@__PURE__*/ require_mapCacheHas(),
1544
- mapCacheSet = /*@__PURE__*/ require_mapCacheSet();
1545
-
1546
- /**
1547
- * Creates a map cache object to store key-value pairs.
1548
- *
1549
- * @private
1550
- * @constructor
1551
- * @param {Array} [entries] The key-value pairs to cache.
1552
- */
1553
- function MapCache(entries) {
1554
- var index = -1,
1555
- length = entries == null ? 0 : entries.length;
1556
-
1557
- this.clear();
1558
- while (++index < length) {
1559
- var entry = entries[index];
1560
- this.set(entry[0], entry[1]);
1561
- }
1562
- }
1563
-
1564
- // Add methods to `MapCache`.
1565
- MapCache.prototype.clear = mapCacheClear;
1566
- MapCache.prototype['delete'] = mapCacheDelete;
1567
- MapCache.prototype.get = mapCacheGet;
1568
- MapCache.prototype.has = mapCacheHas;
1569
- MapCache.prototype.set = mapCacheSet;
1570
-
1571
- _MapCache = MapCache;
1572
- return _MapCache;
1573
- }
1574
-
1575
- var _stackSet;
1576
- var hasRequired_stackSet;
1577
-
1578
- function require_stackSet () {
1579
- if (hasRequired_stackSet) return _stackSet;
1580
- hasRequired_stackSet = 1;
1581
- var ListCache = /*@__PURE__*/ require_ListCache(),
1582
- Map = /*@__PURE__*/ require_Map(),
1583
- MapCache = /*@__PURE__*/ require_MapCache();
1584
-
1585
- /** Used as the size to enable large array optimizations. */
1586
- var LARGE_ARRAY_SIZE = 200;
1587
-
1588
- /**
1589
- * Sets the stack `key` to `value`.
1590
- *
1591
- * @private
1592
- * @name set
1593
- * @memberOf Stack
1594
- * @param {string} key The key of the value to set.
1595
- * @param {*} value The value to set.
1596
- * @returns {Object} Returns the stack cache instance.
1597
- */
1598
- function stackSet(key, value) {
1599
- var data = this.__data__;
1600
- if (data instanceof ListCache) {
1601
- var pairs = data.__data__;
1602
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1603
- pairs.push([key, value]);
1604
- this.size = ++data.size;
1605
- return this;
1606
- }
1607
- data = this.__data__ = new MapCache(pairs);
1608
- }
1609
- data.set(key, value);
1610
- this.size = data.size;
1611
- return this;
1612
- }
1613
-
1614
- _stackSet = stackSet;
1615
- return _stackSet;
1616
- }
1617
-
1618
- var _Stack;
1619
- var hasRequired_Stack;
1620
-
1621
- function require_Stack () {
1622
- if (hasRequired_Stack) return _Stack;
1623
- hasRequired_Stack = 1;
1624
- var ListCache = /*@__PURE__*/ require_ListCache(),
1625
- stackClear = /*@__PURE__*/ require_stackClear(),
1626
- stackDelete = /*@__PURE__*/ require_stackDelete(),
1627
- stackGet = /*@__PURE__*/ require_stackGet(),
1628
- stackHas = /*@__PURE__*/ require_stackHas(),
1629
- stackSet = /*@__PURE__*/ require_stackSet();
1630
-
1631
- /**
1632
- * Creates a stack cache object to store key-value pairs.
1633
- *
1634
- * @private
1635
- * @constructor
1636
- * @param {Array} [entries] The key-value pairs to cache.
1637
- */
1638
- function Stack(entries) {
1639
- var data = this.__data__ = new ListCache(entries);
1640
- this.size = data.size;
1641
- }
1642
-
1643
- // Add methods to `Stack`.
1644
- Stack.prototype.clear = stackClear;
1645
- Stack.prototype['delete'] = stackDelete;
1646
- Stack.prototype.get = stackGet;
1647
- Stack.prototype.has = stackHas;
1648
- Stack.prototype.set = stackSet;
1649
-
1650
- _Stack = Stack;
1651
- return _Stack;
1652
- }
1653
-
1654
- var _baseAssignValue;
1655
- var hasRequired_baseAssignValue;
1656
-
1657
- function require_baseAssignValue () {
1658
- if (hasRequired_baseAssignValue) return _baseAssignValue;
1659
- hasRequired_baseAssignValue = 1;
1660
- var defineProperty = /*@__PURE__*/ require_defineProperty();
1661
-
1662
- /**
1663
- * The base implementation of `assignValue` and `assignMergeValue` without
1664
- * value checks.
1665
- *
1666
- * @private
1667
- * @param {Object} object The object to modify.
1668
- * @param {string} key The key of the property to assign.
1669
- * @param {*} value The value to assign.
1670
- */
1671
- function baseAssignValue(object, key, value) {
1672
- if (key == '__proto__' && defineProperty) {
1673
- defineProperty(object, key, {
1674
- 'configurable': true,
1675
- 'enumerable': true,
1676
- 'value': value,
1677
- 'writable': true
1678
- });
1679
- } else {
1680
- object[key] = value;
1681
- }
1682
- }
1683
-
1684
- _baseAssignValue = baseAssignValue;
1685
- return _baseAssignValue;
1686
- }
1687
-
1688
- var _assignMergeValue;
1689
- var hasRequired_assignMergeValue;
1690
-
1691
- function require_assignMergeValue () {
1692
- if (hasRequired_assignMergeValue) return _assignMergeValue;
1693
- hasRequired_assignMergeValue = 1;
1694
- var baseAssignValue = /*@__PURE__*/ require_baseAssignValue(),
1695
- eq = /*@__PURE__*/ requireEq();
1696
-
1697
- /**
1698
- * This function is like `assignValue` except that it doesn't assign
1699
- * `undefined` values.
1700
- *
1701
- * @private
1702
- * @param {Object} object The object to modify.
1703
- * @param {string} key The key of the property to assign.
1704
- * @param {*} value The value to assign.
1705
- */
1706
- function assignMergeValue(object, key, value) {
1707
- if ((value !== undefined && !eq(object[key], value)) ||
1708
- (value === undefined && !(key in object))) {
1709
- baseAssignValue(object, key, value);
1710
- }
1711
- }
1712
-
1713
- _assignMergeValue = assignMergeValue;
1714
- return _assignMergeValue;
1715
- }
1716
-
1717
- /**
1718
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
1719
- *
1720
- * @private
1721
- * @param {boolean} [fromRight] Specify iterating from right to left.
1722
- * @returns {Function} Returns the new base function.
1723
- */
1724
-
1725
- var _createBaseFor;
1726
- var hasRequired_createBaseFor;
1727
-
1728
- function require_createBaseFor () {
1729
- if (hasRequired_createBaseFor) return _createBaseFor;
1730
- hasRequired_createBaseFor = 1;
1731
- function createBaseFor(fromRight) {
1732
- return function(object, iteratee, keysFunc) {
1733
- var index = -1,
1734
- iterable = Object(object),
1735
- props = keysFunc(object),
1736
- length = props.length;
1737
-
1738
- while (length--) {
1739
- var key = props[fromRight ? length : ++index];
1740
- if (iteratee(iterable[key], key, iterable) === false) {
1741
- break;
1742
- }
1743
- }
1744
- return object;
1745
- };
1746
- }
1747
-
1748
- _createBaseFor = createBaseFor;
1749
- return _createBaseFor;
1750
- }
1751
-
1752
- var _baseFor;
1753
- var hasRequired_baseFor;
1754
-
1755
- function require_baseFor () {
1756
- if (hasRequired_baseFor) return _baseFor;
1757
- hasRequired_baseFor = 1;
1758
- var createBaseFor = /*@__PURE__*/ require_createBaseFor();
1759
-
1760
- /**
1761
- * The base implementation of `baseForOwn` which iterates over `object`
1762
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
1763
- * Iteratee functions may exit iteration early by explicitly returning `false`.
1764
- *
1765
- * @private
1766
- * @param {Object} object The object to iterate over.
1767
- * @param {Function} iteratee The function invoked per iteration.
1768
- * @param {Function} keysFunc The function to get the keys of `object`.
1769
- * @returns {Object} Returns `object`.
1770
- */
1771
- var baseFor = createBaseFor();
1772
-
1773
- _baseFor = baseFor;
1774
- return _baseFor;
1775
- }
1776
-
1777
- var _cloneBuffer = {exports: {}};
1778
-
1779
- var hasRequired_cloneBuffer;
1780
-
1781
- function require_cloneBuffer () {
1782
- if (hasRequired_cloneBuffer) return _cloneBuffer.exports;
1783
- hasRequired_cloneBuffer = 1;
1784
- (function (module, exports) {
1785
- var root = /*@__PURE__*/ require_root();
1786
-
1787
- /** Detect free variable `exports`. */
1788
- var freeExports = exports && !exports.nodeType && exports;
1789
-
1790
- /** Detect free variable `module`. */
1791
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1792
-
1793
- /** Detect the popular CommonJS extension `module.exports`. */
1794
- var moduleExports = freeModule && freeModule.exports === freeExports;
1795
-
1796
- /** Built-in value references. */
1797
- var Buffer = moduleExports ? root.Buffer : undefined,
1798
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1799
-
1800
- /**
1801
- * Creates a clone of `buffer`.
1802
- *
1803
- * @private
1804
- * @param {Buffer} buffer The buffer to clone.
1805
- * @param {boolean} [isDeep] Specify a deep clone.
1806
- * @returns {Buffer} Returns the cloned buffer.
1807
- */
1808
- function cloneBuffer(buffer, isDeep) {
1809
- if (isDeep) {
1810
- return buffer.slice();
1811
- }
1812
- var length = buffer.length,
1813
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1814
-
1815
- buffer.copy(result);
1816
- return result;
1817
- }
1818
-
1819
- module.exports = cloneBuffer;
1820
- } (_cloneBuffer, _cloneBuffer.exports));
1821
- return _cloneBuffer.exports;
1822
- }
1823
-
1824
- var _Uint8Array;
1825
- var hasRequired_Uint8Array;
1826
-
1827
- function require_Uint8Array () {
1828
- if (hasRequired_Uint8Array) return _Uint8Array;
1829
- hasRequired_Uint8Array = 1;
1830
- var root = /*@__PURE__*/ require_root();
1831
-
1832
- /** Built-in value references. */
1833
- var Uint8Array = root.Uint8Array;
1834
-
1835
- _Uint8Array = Uint8Array;
1836
- return _Uint8Array;
1837
- }
1838
-
1839
- var _cloneArrayBuffer;
1840
- var hasRequired_cloneArrayBuffer;
1841
-
1842
- function require_cloneArrayBuffer () {
1843
- if (hasRequired_cloneArrayBuffer) return _cloneArrayBuffer;
1844
- hasRequired_cloneArrayBuffer = 1;
1845
- var Uint8Array = /*@__PURE__*/ require_Uint8Array();
1846
-
1847
- /**
1848
- * Creates a clone of `arrayBuffer`.
1849
- *
1850
- * @private
1851
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1852
- * @returns {ArrayBuffer} Returns the cloned array buffer.
1853
- */
1854
- function cloneArrayBuffer(arrayBuffer) {
1855
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1856
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
1857
- return result;
1858
- }
1859
-
1860
- _cloneArrayBuffer = cloneArrayBuffer;
1861
- return _cloneArrayBuffer;
1862
- }
1863
-
1864
- var _cloneTypedArray;
1865
- var hasRequired_cloneTypedArray;
1866
-
1867
- function require_cloneTypedArray () {
1868
- if (hasRequired_cloneTypedArray) return _cloneTypedArray;
1869
- hasRequired_cloneTypedArray = 1;
1870
- var cloneArrayBuffer = /*@__PURE__*/ require_cloneArrayBuffer();
1871
-
1872
- /**
1873
- * Creates a clone of `typedArray`.
1874
- *
1875
- * @private
1876
- * @param {Object} typedArray The typed array to clone.
1877
- * @param {boolean} [isDeep] Specify a deep clone.
1878
- * @returns {Object} Returns the cloned typed array.
1879
- */
1880
- function cloneTypedArray(typedArray, isDeep) {
1881
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1882
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1883
- }
1884
-
1885
- _cloneTypedArray = cloneTypedArray;
1886
- return _cloneTypedArray;
1887
- }
1888
-
1889
- /**
1890
- * Copies the values of `source` to `array`.
1891
- *
1892
- * @private
1893
- * @param {Array} source The array to copy values from.
1894
- * @param {Array} [array=[]] The array to copy values to.
1895
- * @returns {Array} Returns `array`.
1896
- */
1897
-
1898
- var _copyArray;
1899
- var hasRequired_copyArray;
1900
-
1901
- function require_copyArray () {
1902
- if (hasRequired_copyArray) return _copyArray;
1903
- hasRequired_copyArray = 1;
1904
- function copyArray(source, array) {
1905
- var index = -1,
1906
- length = source.length;
1907
-
1908
- array || (array = Array(length));
1909
- while (++index < length) {
1910
- array[index] = source[index];
1911
- }
1912
- return array;
1913
- }
1914
-
1915
- _copyArray = copyArray;
1916
- return _copyArray;
1917
- }
1918
-
1919
- var _baseCreate;
1920
- var hasRequired_baseCreate;
1921
-
1922
- function require_baseCreate () {
1923
- if (hasRequired_baseCreate) return _baseCreate;
1924
- hasRequired_baseCreate = 1;
1925
- var isObject = /*@__PURE__*/ requireIsObject();
1926
-
1927
- /** Built-in value references. */
1928
- var objectCreate = Object.create;
1929
-
1930
- /**
1931
- * The base implementation of `_.create` without support for assigning
1932
- * properties to the created object.
1933
- *
1934
- * @private
1935
- * @param {Object} proto The object to inherit from.
1936
- * @returns {Object} Returns the new object.
1937
- */
1938
- var baseCreate = (function() {
1939
- function object() {}
1940
- return function(proto) {
1941
- if (!isObject(proto)) {
1942
- return {};
1943
- }
1944
- if (objectCreate) {
1945
- return objectCreate(proto);
1946
- }
1947
- object.prototype = proto;
1948
- var result = new object;
1949
- object.prototype = undefined;
1950
- return result;
1951
- };
1952
- }());
1953
-
1954
- _baseCreate = baseCreate;
1955
- return _baseCreate;
1956
- }
1957
-
1958
- /**
1959
- * Creates a unary function that invokes `func` with its argument transformed.
1960
- *
1961
- * @private
1962
- * @param {Function} func The function to wrap.
1963
- * @param {Function} transform The argument transform.
1964
- * @returns {Function} Returns the new function.
1965
- */
1966
-
1967
- var _overArg;
1968
- var hasRequired_overArg;
1969
-
1970
- function require_overArg () {
1971
- if (hasRequired_overArg) return _overArg;
1972
- hasRequired_overArg = 1;
1973
- function overArg(func, transform) {
1974
- return function(arg) {
1975
- return func(transform(arg));
1976
- };
1977
- }
1978
-
1979
- _overArg = overArg;
1980
- return _overArg;
1981
- }
1982
-
1983
- var _getPrototype;
1984
- var hasRequired_getPrototype;
1985
-
1986
- function require_getPrototype () {
1987
- if (hasRequired_getPrototype) return _getPrototype;
1988
- hasRequired_getPrototype = 1;
1989
- var overArg = /*@__PURE__*/ require_overArg();
1990
-
1991
- /** Built-in value references. */
1992
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1993
-
1994
- _getPrototype = getPrototype;
1995
- return _getPrototype;
1996
- }
1997
-
1998
- /** Used for built-in method references. */
1999
-
2000
- var _isPrototype;
2001
- var hasRequired_isPrototype;
2002
-
2003
- function require_isPrototype () {
2004
- if (hasRequired_isPrototype) return _isPrototype;
2005
- hasRequired_isPrototype = 1;
2006
- var objectProto = Object.prototype;
2007
-
2008
- /**
2009
- * Checks if `value` is likely a prototype object.
2010
- *
2011
- * @private
2012
- * @param {*} value The value to check.
2013
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
2014
- */
2015
- function isPrototype(value) {
2016
- var Ctor = value && value.constructor,
2017
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
2018
-
2019
- return value === proto;
2020
- }
2021
-
2022
- _isPrototype = isPrototype;
2023
- return _isPrototype;
2024
- }
2025
-
2026
- var _initCloneObject;
2027
- var hasRequired_initCloneObject;
2028
-
2029
- function require_initCloneObject () {
2030
- if (hasRequired_initCloneObject) return _initCloneObject;
2031
- hasRequired_initCloneObject = 1;
2032
- var baseCreate = /*@__PURE__*/ require_baseCreate(),
2033
- getPrototype = /*@__PURE__*/ require_getPrototype(),
2034
- isPrototype = /*@__PURE__*/ require_isPrototype();
2035
-
2036
- /**
2037
- * Initializes an object clone.
2038
- *
2039
- * @private
2040
- * @param {Object} object The object to clone.
2041
- * @returns {Object} Returns the initialized clone.
2042
- */
2043
- function initCloneObject(object) {
2044
- return (typeof object.constructor == 'function' && !isPrototype(object))
2045
- ? baseCreate(getPrototype(object))
2046
- : {};
2047
- }
2048
-
2049
- _initCloneObject = initCloneObject;
2050
- return _initCloneObject;
2051
- }
2052
-
2053
- /**
2054
- * Checks if `value` is object-like. A value is object-like if it's not `null`
2055
- * and has a `typeof` result of "object".
2056
- *
2057
- * @static
2058
- * @memberOf _
2059
- * @since 4.0.0
2060
- * @category Lang
2061
- * @param {*} value The value to check.
2062
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2063
- * @example
2064
- *
2065
- * _.isObjectLike({});
2066
- * // => true
2067
- *
2068
- * _.isObjectLike([1, 2, 3]);
2069
- * // => true
2070
- *
2071
- * _.isObjectLike(_.noop);
2072
- * // => false
2073
- *
2074
- * _.isObjectLike(null);
2075
- * // => false
2076
- */
2077
-
2078
- var isObjectLike_1;
2079
- var hasRequiredIsObjectLike;
2080
-
2081
- function requireIsObjectLike () {
2082
- if (hasRequiredIsObjectLike) return isObjectLike_1;
2083
- hasRequiredIsObjectLike = 1;
2084
- function isObjectLike(value) {
2085
- return value != null && typeof value == 'object';
2086
- }
2087
-
2088
- isObjectLike_1 = isObjectLike;
2089
- return isObjectLike_1;
2090
- }
2091
-
2092
- var _baseIsArguments;
2093
- var hasRequired_baseIsArguments;
2094
-
2095
- function require_baseIsArguments () {
2096
- if (hasRequired_baseIsArguments) return _baseIsArguments;
2097
- hasRequired_baseIsArguments = 1;
2098
- var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
2099
- isObjectLike = /*@__PURE__*/ requireIsObjectLike();
2100
-
2101
- /** `Object#toString` result references. */
2102
- var argsTag = '[object Arguments]';
2103
-
2104
- /**
2105
- * The base implementation of `_.isArguments`.
2106
- *
2107
- * @private
2108
- * @param {*} value The value to check.
2109
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2110
- */
2111
- function baseIsArguments(value) {
2112
- return isObjectLike(value) && baseGetTag(value) == argsTag;
2113
- }
2114
-
2115
- _baseIsArguments = baseIsArguments;
2116
- return _baseIsArguments;
2117
- }
2118
-
2119
- var isArguments_1;
2120
- var hasRequiredIsArguments;
2121
-
2122
- function requireIsArguments () {
2123
- if (hasRequiredIsArguments) return isArguments_1;
2124
- hasRequiredIsArguments = 1;
2125
- var baseIsArguments = /*@__PURE__*/ require_baseIsArguments(),
2126
- isObjectLike = /*@__PURE__*/ requireIsObjectLike();
2127
-
2128
- /** Used for built-in method references. */
2129
- var objectProto = Object.prototype;
2130
-
2131
- /** Used to check objects for own properties. */
2132
- var hasOwnProperty = objectProto.hasOwnProperty;
2133
-
2134
- /** Built-in value references. */
2135
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2136
-
2137
- /**
2138
- * Checks if `value` is likely an `arguments` object.
2139
- *
2140
- * @static
2141
- * @memberOf _
2142
- * @since 0.1.0
2143
- * @category Lang
2144
- * @param {*} value The value to check.
2145
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2146
- * else `false`.
2147
- * @example
2148
- *
2149
- * _.isArguments(function() { return arguments; }());
2150
- * // => true
2151
- *
2152
- * _.isArguments([1, 2, 3]);
2153
- * // => false
2154
- */
2155
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
2156
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
2157
- !propertyIsEnumerable.call(value, 'callee');
2158
- };
2159
-
2160
- isArguments_1 = isArguments;
2161
- return isArguments_1;
2162
- }
2163
-
2164
- /**
2165
- * Checks if `value` is classified as an `Array` object.
2166
- *
2167
- * @static
2168
- * @memberOf _
2169
- * @since 0.1.0
2170
- * @category Lang
2171
- * @param {*} value The value to check.
2172
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
2173
- * @example
2174
- *
2175
- * _.isArray([1, 2, 3]);
2176
- * // => true
2177
- *
2178
- * _.isArray(document.body.children);
2179
- * // => false
2180
- *
2181
- * _.isArray('abc');
2182
- * // => false
2183
- *
2184
- * _.isArray(_.noop);
2185
- * // => false
2186
- */
2187
-
2188
- var isArray_1;
2189
- var hasRequiredIsArray;
2190
-
2191
- function requireIsArray () {
2192
- if (hasRequiredIsArray) return isArray_1;
2193
- hasRequiredIsArray = 1;
2194
- var isArray = Array.isArray;
2195
-
2196
- isArray_1 = isArray;
2197
- return isArray_1;
2198
- }
2199
-
2200
- /** Used as references for various `Number` constants. */
2201
-
2202
- var isLength_1;
2203
- var hasRequiredIsLength;
2204
-
2205
- function requireIsLength () {
2206
- if (hasRequiredIsLength) return isLength_1;
2207
- hasRequiredIsLength = 1;
2208
- var MAX_SAFE_INTEGER = 9007199254740991;
2209
-
2210
- /**
2211
- * Checks if `value` is a valid array-like length.
2212
- *
2213
- * **Note:** This method is loosely based on
2214
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2215
- *
2216
- * @static
2217
- * @memberOf _
2218
- * @since 4.0.0
2219
- * @category Lang
2220
- * @param {*} value The value to check.
2221
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2222
- * @example
2223
- *
2224
- * _.isLength(3);
2225
- * // => true
2226
- *
2227
- * _.isLength(Number.MIN_VALUE);
2228
- * // => false
2229
- *
2230
- * _.isLength(Infinity);
2231
- * // => false
2232
- *
2233
- * _.isLength('3');
2234
- * // => false
2235
- */
2236
- function isLength(value) {
2237
- return typeof value == 'number' &&
2238
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2239
- }
2240
-
2241
- isLength_1 = isLength;
2242
- return isLength_1;
2243
- }
2244
-
2245
- var isArrayLike_1;
2246
- var hasRequiredIsArrayLike;
2247
-
2248
- function requireIsArrayLike () {
2249
- if (hasRequiredIsArrayLike) return isArrayLike_1;
2250
- hasRequiredIsArrayLike = 1;
2251
- var isFunction = /*@__PURE__*/ requireIsFunction(),
2252
- isLength = /*@__PURE__*/ requireIsLength();
2253
-
2254
- /**
2255
- * Checks if `value` is array-like. A value is considered array-like if it's
2256
- * not a function and has a `value.length` that's an integer greater than or
2257
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2258
- *
2259
- * @static
2260
- * @memberOf _
2261
- * @since 4.0.0
2262
- * @category Lang
2263
- * @param {*} value The value to check.
2264
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2265
- * @example
2266
- *
2267
- * _.isArrayLike([1, 2, 3]);
2268
- * // => true
2269
- *
2270
- * _.isArrayLike(document.body.children);
2271
- * // => true
2272
- *
2273
- * _.isArrayLike('abc');
2274
- * // => true
2275
- *
2276
- * _.isArrayLike(_.noop);
2277
- * // => false
2278
- */
2279
- function isArrayLike(value) {
2280
- return value != null && isLength(value.length) && !isFunction(value);
2281
- }
2282
-
2283
- isArrayLike_1 = isArrayLike;
2284
- return isArrayLike_1;
2285
- }
2286
-
2287
- var isArrayLikeObject_1;
2288
- var hasRequiredIsArrayLikeObject;
2289
-
2290
- function requireIsArrayLikeObject () {
2291
- if (hasRequiredIsArrayLikeObject) return isArrayLikeObject_1;
2292
- hasRequiredIsArrayLikeObject = 1;
2293
- var isArrayLike = /*@__PURE__*/ requireIsArrayLike(),
2294
- isObjectLike = /*@__PURE__*/ requireIsObjectLike();
2295
-
2296
- /**
2297
- * This method is like `_.isArrayLike` except that it also checks if `value`
2298
- * is an object.
2299
- *
2300
- * @static
2301
- * @memberOf _
2302
- * @since 4.0.0
2303
- * @category Lang
2304
- * @param {*} value The value to check.
2305
- * @returns {boolean} Returns `true` if `value` is an array-like object,
2306
- * else `false`.
2307
- * @example
2308
- *
2309
- * _.isArrayLikeObject([1, 2, 3]);
2310
- * // => true
2311
- *
2312
- * _.isArrayLikeObject(document.body.children);
2313
- * // => true
2314
- *
2315
- * _.isArrayLikeObject('abc');
2316
- * // => false
2317
- *
2318
- * _.isArrayLikeObject(_.noop);
2319
- * // => false
2320
- */
2321
- function isArrayLikeObject(value) {
2322
- return isObjectLike(value) && isArrayLike(value);
2323
- }
2324
-
2325
- isArrayLikeObject_1 = isArrayLikeObject;
2326
- return isArrayLikeObject_1;
2327
- }
2328
-
2329
- var isBuffer = {exports: {}};
2330
-
2331
- /**
2332
- * This method returns `false`.
2333
- *
2334
- * @static
2335
- * @memberOf _
2336
- * @since 4.13.0
2337
- * @category Util
2338
- * @returns {boolean} Returns `false`.
2339
- * @example
2340
- *
2341
- * _.times(2, _.stubFalse);
2342
- * // => [false, false]
2343
- */
2344
-
2345
- var stubFalse_1;
2346
- var hasRequiredStubFalse;
2347
-
2348
- function requireStubFalse () {
2349
- if (hasRequiredStubFalse) return stubFalse_1;
2350
- hasRequiredStubFalse = 1;
2351
- function stubFalse() {
2352
- return false;
2353
- }
2354
-
2355
- stubFalse_1 = stubFalse;
2356
- return stubFalse_1;
2357
- }
2358
-
2359
- var hasRequiredIsBuffer;
2360
-
2361
- function requireIsBuffer () {
2362
- if (hasRequiredIsBuffer) return isBuffer.exports;
2363
- hasRequiredIsBuffer = 1;
2364
- (function (module, exports) {
2365
- var root = /*@__PURE__*/ require_root(),
2366
- stubFalse = /*@__PURE__*/ requireStubFalse();
2367
-
2368
- /** Detect free variable `exports`. */
2369
- var freeExports = exports && !exports.nodeType && exports;
2370
-
2371
- /** Detect free variable `module`. */
2372
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2373
-
2374
- /** Detect the popular CommonJS extension `module.exports`. */
2375
- var moduleExports = freeModule && freeModule.exports === freeExports;
2376
-
2377
- /** Built-in value references. */
2378
- var Buffer = moduleExports ? root.Buffer : undefined;
2379
-
2380
- /* Built-in method references for those with the same name as other `lodash` methods. */
2381
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
2382
-
2383
- /**
2384
- * Checks if `value` is a buffer.
2385
- *
2386
- * @static
2387
- * @memberOf _
2388
- * @since 4.3.0
2389
- * @category Lang
2390
- * @param {*} value The value to check.
2391
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
2392
- * @example
2393
- *
2394
- * _.isBuffer(new Buffer(2));
2395
- * // => true
2396
- *
2397
- * _.isBuffer(new Uint8Array(2));
2398
- * // => false
2399
- */
2400
- var isBuffer = nativeIsBuffer || stubFalse;
2401
-
2402
- module.exports = isBuffer;
2403
- } (isBuffer, isBuffer.exports));
2404
- return isBuffer.exports;
2405
- }
2406
-
2407
- var isPlainObject_1;
2408
- var hasRequiredIsPlainObject;
2409
-
2410
- function requireIsPlainObject () {
2411
- if (hasRequiredIsPlainObject) return isPlainObject_1;
2412
- hasRequiredIsPlainObject = 1;
2413
- var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
2414
- getPrototype = /*@__PURE__*/ require_getPrototype(),
2415
- isObjectLike = /*@__PURE__*/ requireIsObjectLike();
2416
-
2417
- /** `Object#toString` result references. */
2418
- var objectTag = '[object Object]';
2419
-
2420
- /** Used for built-in method references. */
2421
- var funcProto = Function.prototype,
2422
- objectProto = Object.prototype;
2423
-
2424
- /** Used to resolve the decompiled source of functions. */
2425
- var funcToString = funcProto.toString;
2426
-
2427
- /** Used to check objects for own properties. */
2428
- var hasOwnProperty = objectProto.hasOwnProperty;
2429
-
2430
- /** Used to infer the `Object` constructor. */
2431
- var objectCtorString = funcToString.call(Object);
2432
-
2433
- /**
2434
- * Checks if `value` is a plain object, that is, an object created by the
2435
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
2436
- *
2437
- * @static
2438
- * @memberOf _
2439
- * @since 0.8.0
2440
- * @category Lang
2441
- * @param {*} value The value to check.
2442
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
2443
- * @example
2444
- *
2445
- * function Foo() {
2446
- * this.a = 1;
2447
- * }
2448
- *
2449
- * _.isPlainObject(new Foo);
2450
- * // => false
2451
- *
2452
- * _.isPlainObject([1, 2, 3]);
2453
- * // => false
2454
- *
2455
- * _.isPlainObject({ 'x': 0, 'y': 0 });
2456
- * // => true
2457
- *
2458
- * _.isPlainObject(Object.create(null));
2459
- * // => true
2460
- */
2461
- function isPlainObject(value) {
2462
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
2463
- return false;
2464
- }
2465
- var proto = getPrototype(value);
2466
- if (proto === null) {
2467
- return true;
2468
- }
2469
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
2470
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
2471
- funcToString.call(Ctor) == objectCtorString;
2472
- }
2473
-
2474
- isPlainObject_1 = isPlainObject;
2475
- return isPlainObject_1;
2476
- }
2477
-
2478
- var _baseIsTypedArray;
2479
- var hasRequired_baseIsTypedArray;
2480
-
2481
- function require_baseIsTypedArray () {
2482
- if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
2483
- hasRequired_baseIsTypedArray = 1;
2484
- var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
2485
- isLength = /*@__PURE__*/ requireIsLength(),
2486
- isObjectLike = /*@__PURE__*/ requireIsObjectLike();
2487
-
2488
- /** `Object#toString` result references. */
2489
- var argsTag = '[object Arguments]',
2490
- arrayTag = '[object Array]',
2491
- boolTag = '[object Boolean]',
2492
- dateTag = '[object Date]',
2493
- errorTag = '[object Error]',
2494
- funcTag = '[object Function]',
2495
- mapTag = '[object Map]',
2496
- numberTag = '[object Number]',
2497
- objectTag = '[object Object]',
2498
- regexpTag = '[object RegExp]',
2499
- setTag = '[object Set]',
2500
- stringTag = '[object String]',
2501
- weakMapTag = '[object WeakMap]';
2502
-
2503
- var arrayBufferTag = '[object ArrayBuffer]',
2504
- dataViewTag = '[object DataView]',
2505
- float32Tag = '[object Float32Array]',
2506
- float64Tag = '[object Float64Array]',
2507
- int8Tag = '[object Int8Array]',
2508
- int16Tag = '[object Int16Array]',
2509
- int32Tag = '[object Int32Array]',
2510
- uint8Tag = '[object Uint8Array]',
2511
- uint8ClampedTag = '[object Uint8ClampedArray]',
2512
- uint16Tag = '[object Uint16Array]',
2513
- uint32Tag = '[object Uint32Array]';
2514
-
2515
- /** Used to identify `toStringTag` values of typed arrays. */
2516
- var typedArrayTags = {};
2517
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
2518
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
2519
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
2520
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
2521
- typedArrayTags[uint32Tag] = true;
2522
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
2523
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
2524
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
2525
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
2526
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
2527
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
2528
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
2529
- typedArrayTags[weakMapTag] = false;
2530
-
2531
- /**
2532
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
2533
- *
2534
- * @private
2535
- * @param {*} value The value to check.
2536
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2537
- */
2538
- function baseIsTypedArray(value) {
2539
- return isObjectLike(value) &&
2540
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2541
- }
2542
-
2543
- _baseIsTypedArray = baseIsTypedArray;
2544
- return _baseIsTypedArray;
2545
- }
2546
-
2547
- /**
2548
- * The base implementation of `_.unary` without support for storing metadata.
2549
- *
2550
- * @private
2551
- * @param {Function} func The function to cap arguments for.
2552
- * @returns {Function} Returns the new capped function.
2553
- */
2554
-
2555
- var _baseUnary;
2556
- var hasRequired_baseUnary;
2557
-
2558
- function require_baseUnary () {
2559
- if (hasRequired_baseUnary) return _baseUnary;
2560
- hasRequired_baseUnary = 1;
2561
- function baseUnary(func) {
2562
- return function(value) {
2563
- return func(value);
2564
- };
2565
- }
2566
-
2567
- _baseUnary = baseUnary;
2568
- return _baseUnary;
2569
- }
2570
-
2571
- var _nodeUtil = {exports: {}};
2572
-
2573
- var hasRequired_nodeUtil;
2574
-
2575
- function require_nodeUtil () {
2576
- if (hasRequired_nodeUtil) return _nodeUtil.exports;
2577
- hasRequired_nodeUtil = 1;
2578
- (function (module, exports) {
2579
- var freeGlobal = /*@__PURE__*/ require_freeGlobal();
2580
-
2581
- /** Detect free variable `exports`. */
2582
- var freeExports = exports && !exports.nodeType && exports;
2583
-
2584
- /** Detect free variable `module`. */
2585
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2586
-
2587
- /** Detect the popular CommonJS extension `module.exports`. */
2588
- var moduleExports = freeModule && freeModule.exports === freeExports;
2589
-
2590
- /** Detect free variable `process` from Node.js. */
2591
- var freeProcess = moduleExports && freeGlobal.process;
2592
-
2593
- /** Used to access faster Node.js helpers. */
2594
- var nodeUtil = (function() {
2595
- try {
2596
- // Use `util.types` for Node.js 10+.
2597
- var types = freeModule && freeModule.require && freeModule.require('util').types;
2598
-
2599
- if (types) {
2600
- return types;
2601
- }
2602
-
2603
- // Legacy `process.binding('util')` for Node.js < 10.
2604
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
2605
- } catch (e) {}
2606
- }());
2607
-
2608
- module.exports = nodeUtil;
2609
- } (_nodeUtil, _nodeUtil.exports));
2610
- return _nodeUtil.exports;
2611
- }
2612
-
2613
- var isTypedArray_1;
2614
- var hasRequiredIsTypedArray;
2615
-
2616
- function requireIsTypedArray () {
2617
- if (hasRequiredIsTypedArray) return isTypedArray_1;
2618
- hasRequiredIsTypedArray = 1;
2619
- var baseIsTypedArray = /*@__PURE__*/ require_baseIsTypedArray(),
2620
- baseUnary = /*@__PURE__*/ require_baseUnary(),
2621
- nodeUtil = /*@__PURE__*/ require_nodeUtil();
2622
-
2623
- /* Node.js helper references. */
2624
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
2625
-
2626
- /**
2627
- * Checks if `value` is classified as a typed array.
2628
- *
2629
- * @static
2630
- * @memberOf _
2631
- * @since 3.0.0
2632
- * @category Lang
2633
- * @param {*} value The value to check.
2634
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2635
- * @example
2636
- *
2637
- * _.isTypedArray(new Uint8Array);
2638
- * // => true
2639
- *
2640
- * _.isTypedArray([]);
2641
- * // => false
2642
- */
2643
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2644
-
2645
- isTypedArray_1 = isTypedArray;
2646
- return isTypedArray_1;
2647
- }
2648
-
2649
- /**
2650
- * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
2651
- *
2652
- * @private
2653
- * @param {Object} object The object to query.
2654
- * @param {string} key The key of the property to get.
2655
- * @returns {*} Returns the property value.
2656
- */
2657
-
2658
- var _safeGet;
2659
- var hasRequired_safeGet;
2660
-
2661
- function require_safeGet () {
2662
- if (hasRequired_safeGet) return _safeGet;
2663
- hasRequired_safeGet = 1;
2664
- function safeGet(object, key) {
2665
- if (key === 'constructor' && typeof object[key] === 'function') {
2666
- return;
2667
- }
2668
-
2669
- if (key == '__proto__') {
2670
- return;
2671
- }
2672
-
2673
- return object[key];
2674
- }
2675
-
2676
- _safeGet = safeGet;
2677
- return _safeGet;
2678
- }
2679
-
2680
- var _assignValue;
2681
- var hasRequired_assignValue;
2682
-
2683
- function require_assignValue () {
2684
- if (hasRequired_assignValue) return _assignValue;
2685
- hasRequired_assignValue = 1;
2686
- var baseAssignValue = /*@__PURE__*/ require_baseAssignValue(),
2687
- eq = /*@__PURE__*/ requireEq();
2688
-
2689
- /** Used for built-in method references. */
2690
- var objectProto = Object.prototype;
2691
-
2692
- /** Used to check objects for own properties. */
2693
- var hasOwnProperty = objectProto.hasOwnProperty;
2694
-
2695
- /**
2696
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
2697
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2698
- * for equality comparisons.
2699
- *
2700
- * @private
2701
- * @param {Object} object The object to modify.
2702
- * @param {string} key The key of the property to assign.
2703
- * @param {*} value The value to assign.
2704
- */
2705
- function assignValue(object, key, value) {
2706
- var objValue = object[key];
2707
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
2708
- (value === undefined && !(key in object))) {
2709
- baseAssignValue(object, key, value);
2710
- }
2711
- }
2712
-
2713
- _assignValue = assignValue;
2714
- return _assignValue;
2715
- }
2716
-
2717
- var _copyObject;
2718
- var hasRequired_copyObject;
2719
-
2720
- function require_copyObject () {
2721
- if (hasRequired_copyObject) return _copyObject;
2722
- hasRequired_copyObject = 1;
2723
- var assignValue = /*@__PURE__*/ require_assignValue(),
2724
- baseAssignValue = /*@__PURE__*/ require_baseAssignValue();
2725
-
2726
- /**
2727
- * Copies properties of `source` to `object`.
2728
- *
2729
- * @private
2730
- * @param {Object} source The object to copy properties from.
2731
- * @param {Array} props The property identifiers to copy.
2732
- * @param {Object} [object={}] The object to copy properties to.
2733
- * @param {Function} [customizer] The function to customize copied values.
2734
- * @returns {Object} Returns `object`.
2735
- */
2736
- function copyObject(source, props, object, customizer) {
2737
- var isNew = !object;
2738
- object || (object = {});
2739
-
2740
- var index = -1,
2741
- length = props.length;
2742
-
2743
- while (++index < length) {
2744
- var key = props[index];
2745
-
2746
- var newValue = customizer
2747
- ? customizer(object[key], source[key], key, object, source)
2748
- : undefined;
2749
-
2750
- if (newValue === undefined) {
2751
- newValue = source[key];
2752
- }
2753
- if (isNew) {
2754
- baseAssignValue(object, key, newValue);
2755
- } else {
2756
- assignValue(object, key, newValue);
2757
- }
2758
- }
2759
- return object;
2760
- }
2761
-
2762
- _copyObject = copyObject;
2763
- return _copyObject;
2764
- }
2765
-
2766
- /**
2767
- * The base implementation of `_.times` without support for iteratee shorthands
2768
- * or max array length checks.
2769
- *
2770
- * @private
2771
- * @param {number} n The number of times to invoke `iteratee`.
2772
- * @param {Function} iteratee The function invoked per iteration.
2773
- * @returns {Array} Returns the array of results.
2774
- */
2775
-
2776
- var _baseTimes;
2777
- var hasRequired_baseTimes;
2778
-
2779
- function require_baseTimes () {
2780
- if (hasRequired_baseTimes) return _baseTimes;
2781
- hasRequired_baseTimes = 1;
2782
- function baseTimes(n, iteratee) {
2783
- var index = -1,
2784
- result = Array(n);
2785
-
2786
- while (++index < n) {
2787
- result[index] = iteratee(index);
2788
- }
2789
- return result;
2790
- }
2791
-
2792
- _baseTimes = baseTimes;
2793
- return _baseTimes;
2794
- }
2795
-
2796
- /** Used as references for various `Number` constants. */
2797
-
2798
- var _isIndex;
2799
- var hasRequired_isIndex;
2800
-
2801
- function require_isIndex () {
2802
- if (hasRequired_isIndex) return _isIndex;
2803
- hasRequired_isIndex = 1;
2804
- var MAX_SAFE_INTEGER = 9007199254740991;
2805
-
2806
- /** Used to detect unsigned integer values. */
2807
- var reIsUint = /^(?:0|[1-9]\d*)$/;
2808
-
2809
- /**
2810
- * Checks if `value` is a valid array-like index.
2811
- *
2812
- * @private
2813
- * @param {*} value The value to check.
2814
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2815
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2816
- */
2817
- function isIndex(value, length) {
2818
- var type = typeof value;
2819
- length = length == null ? MAX_SAFE_INTEGER : length;
2820
-
2821
- return !!length &&
2822
- (type == 'number' ||
2823
- (type != 'symbol' && reIsUint.test(value))) &&
2824
- (value > -1 && value % 1 == 0 && value < length);
2825
- }
2826
-
2827
- _isIndex = isIndex;
2828
- return _isIndex;
2829
- }
2830
-
2831
- var _arrayLikeKeys;
2832
- var hasRequired_arrayLikeKeys;
2833
-
2834
- function require_arrayLikeKeys () {
2835
- if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
2836
- hasRequired_arrayLikeKeys = 1;
2837
- var baseTimes = /*@__PURE__*/ require_baseTimes(),
2838
- isArguments = /*@__PURE__*/ requireIsArguments(),
2839
- isArray = /*@__PURE__*/ requireIsArray(),
2840
- isBuffer = /*@__PURE__*/ requireIsBuffer(),
2841
- isIndex = /*@__PURE__*/ require_isIndex(),
2842
- isTypedArray = /*@__PURE__*/ requireIsTypedArray();
2843
-
2844
- /** Used for built-in method references. */
2845
- var objectProto = Object.prototype;
2846
-
2847
- /** Used to check objects for own properties. */
2848
- var hasOwnProperty = objectProto.hasOwnProperty;
2849
-
2850
- /**
2851
- * Creates an array of the enumerable property names of the array-like `value`.
2852
- *
2853
- * @private
2854
- * @param {*} value The value to query.
2855
- * @param {boolean} inherited Specify returning inherited property names.
2856
- * @returns {Array} Returns the array of property names.
2857
- */
2858
- function arrayLikeKeys(value, inherited) {
2859
- var isArr = isArray(value),
2860
- isArg = !isArr && isArguments(value),
2861
- isBuff = !isArr && !isArg && isBuffer(value),
2862
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
2863
- skipIndexes = isArr || isArg || isBuff || isType,
2864
- result = skipIndexes ? baseTimes(value.length, String) : [],
2865
- length = result.length;
2866
-
2867
- for (var key in value) {
2868
- if ((inherited || hasOwnProperty.call(value, key)) &&
2869
- !(skipIndexes && (
2870
- // Safari 9 has enumerable `arguments.length` in strict mode.
2871
- key == 'length' ||
2872
- // Node.js 0.10 has enumerable non-index properties on buffers.
2873
- (isBuff && (key == 'offset' || key == 'parent')) ||
2874
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
2875
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2876
- // Skip index properties.
2877
- isIndex(key, length)
2878
- ))) {
2879
- result.push(key);
2880
- }
2881
- }
2882
- return result;
2883
- }
2884
-
2885
- _arrayLikeKeys = arrayLikeKeys;
2886
- return _arrayLikeKeys;
2887
- }
2888
-
2889
- /**
2890
- * This function is like
2891
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2892
- * except that it includes inherited enumerable properties.
2893
- *
2894
- * @private
2895
- * @param {Object} object The object to query.
2896
- * @returns {Array} Returns the array of property names.
2897
- */
2898
-
2899
- var _nativeKeysIn;
2900
- var hasRequired_nativeKeysIn;
2901
-
2902
- function require_nativeKeysIn () {
2903
- if (hasRequired_nativeKeysIn) return _nativeKeysIn;
2904
- hasRequired_nativeKeysIn = 1;
2905
- function nativeKeysIn(object) {
2906
- var result = [];
2907
- if (object != null) {
2908
- for (var key in Object(object)) {
2909
- result.push(key);
2910
- }
2911
- }
2912
- return result;
2913
- }
2914
-
2915
- _nativeKeysIn = nativeKeysIn;
2916
- return _nativeKeysIn;
2917
- }
2918
-
2919
- var _baseKeysIn;
2920
- var hasRequired_baseKeysIn;
2921
-
2922
- function require_baseKeysIn () {
2923
- if (hasRequired_baseKeysIn) return _baseKeysIn;
2924
- hasRequired_baseKeysIn = 1;
2925
- var isObject = /*@__PURE__*/ requireIsObject(),
2926
- isPrototype = /*@__PURE__*/ require_isPrototype(),
2927
- nativeKeysIn = /*@__PURE__*/ require_nativeKeysIn();
2928
-
2929
- /** Used for built-in method references. */
2930
- var objectProto = Object.prototype;
2931
-
2932
- /** Used to check objects for own properties. */
2933
- var hasOwnProperty = objectProto.hasOwnProperty;
2934
-
2935
- /**
2936
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
2937
- *
2938
- * @private
2939
- * @param {Object} object The object to query.
2940
- * @returns {Array} Returns the array of property names.
2941
- */
2942
- function baseKeysIn(object) {
2943
- if (!isObject(object)) {
2944
- return nativeKeysIn(object);
2945
- }
2946
- var isProto = isPrototype(object),
2947
- result = [];
2948
-
2949
- for (var key in object) {
2950
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
2951
- result.push(key);
2952
- }
2953
- }
2954
- return result;
2955
- }
2956
-
2957
- _baseKeysIn = baseKeysIn;
2958
- return _baseKeysIn;
2959
- }
2960
-
2961
- var keysIn_1;
2962
- var hasRequiredKeysIn;
2963
-
2964
- function requireKeysIn () {
2965
- if (hasRequiredKeysIn) return keysIn_1;
2966
- hasRequiredKeysIn = 1;
2967
- var arrayLikeKeys = /*@__PURE__*/ require_arrayLikeKeys(),
2968
- baseKeysIn = /*@__PURE__*/ require_baseKeysIn(),
2969
- isArrayLike = /*@__PURE__*/ requireIsArrayLike();
2970
-
2971
- /**
2972
- * Creates an array of the own and inherited enumerable property names of `object`.
2973
- *
2974
- * **Note:** Non-object values are coerced to objects.
2975
- *
2976
- * @static
2977
- * @memberOf _
2978
- * @since 3.0.0
2979
- * @category Object
2980
- * @param {Object} object The object to query.
2981
- * @returns {Array} Returns the array of property names.
2982
- * @example
2983
- *
2984
- * function Foo() {
2985
- * this.a = 1;
2986
- * this.b = 2;
2987
- * }
2988
- *
2989
- * Foo.prototype.c = 3;
2990
- *
2991
- * _.keysIn(new Foo);
2992
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
2993
- */
2994
- function keysIn(object) {
2995
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
2996
- }
2997
-
2998
- keysIn_1 = keysIn;
2999
- return keysIn_1;
3000
- }
3001
-
3002
- var toPlainObject_1;
3003
- var hasRequiredToPlainObject;
3004
-
3005
- function requireToPlainObject () {
3006
- if (hasRequiredToPlainObject) return toPlainObject_1;
3007
- hasRequiredToPlainObject = 1;
3008
- var copyObject = /*@__PURE__*/ require_copyObject(),
3009
- keysIn = /*@__PURE__*/ requireKeysIn();
3010
-
3011
- /**
3012
- * Converts `value` to a plain object flattening inherited enumerable string
3013
- * keyed properties of `value` to own properties of the plain object.
3014
- *
3015
- * @static
3016
- * @memberOf _
3017
- * @since 3.0.0
3018
- * @category Lang
3019
- * @param {*} value The value to convert.
3020
- * @returns {Object} Returns the converted plain object.
3021
- * @example
3022
- *
3023
- * function Foo() {
3024
- * this.b = 2;
3025
- * }
3026
- *
3027
- * Foo.prototype.c = 3;
3028
- *
3029
- * _.assign({ 'a': 1 }, new Foo);
3030
- * // => { 'a': 1, 'b': 2 }
3031
- *
3032
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
3033
- * // => { 'a': 1, 'b': 2, 'c': 3 }
3034
- */
3035
- function toPlainObject(value) {
3036
- return copyObject(value, keysIn(value));
3037
- }
3038
-
3039
- toPlainObject_1 = toPlainObject;
3040
- return toPlainObject_1;
3041
- }
3042
-
3043
- var _baseMergeDeep;
3044
- var hasRequired_baseMergeDeep;
3045
-
3046
- function require_baseMergeDeep () {
3047
- if (hasRequired_baseMergeDeep) return _baseMergeDeep;
3048
- hasRequired_baseMergeDeep = 1;
3049
- var assignMergeValue = /*@__PURE__*/ require_assignMergeValue(),
3050
- cloneBuffer = /*@__PURE__*/ require_cloneBuffer(),
3051
- cloneTypedArray = /*@__PURE__*/ require_cloneTypedArray(),
3052
- copyArray = /*@__PURE__*/ require_copyArray(),
3053
- initCloneObject = /*@__PURE__*/ require_initCloneObject(),
3054
- isArguments = /*@__PURE__*/ requireIsArguments(),
3055
- isArray = /*@__PURE__*/ requireIsArray(),
3056
- isArrayLikeObject = /*@__PURE__*/ requireIsArrayLikeObject(),
3057
- isBuffer = /*@__PURE__*/ requireIsBuffer(),
3058
- isFunction = /*@__PURE__*/ requireIsFunction(),
3059
- isObject = /*@__PURE__*/ requireIsObject(),
3060
- isPlainObject = /*@__PURE__*/ requireIsPlainObject(),
3061
- isTypedArray = /*@__PURE__*/ requireIsTypedArray(),
3062
- safeGet = /*@__PURE__*/ require_safeGet(),
3063
- toPlainObject = /*@__PURE__*/ requireToPlainObject();
3064
-
3065
- /**
3066
- * A specialized version of `baseMerge` for arrays and objects which performs
3067
- * deep merges and tracks traversed objects enabling objects with circular
3068
- * references to be merged.
3069
- *
3070
- * @private
3071
- * @param {Object} object The destination object.
3072
- * @param {Object} source The source object.
3073
- * @param {string} key The key of the value to merge.
3074
- * @param {number} srcIndex The index of `source`.
3075
- * @param {Function} mergeFunc The function to merge values.
3076
- * @param {Function} [customizer] The function to customize assigned values.
3077
- * @param {Object} [stack] Tracks traversed source values and their merged
3078
- * counterparts.
3079
- */
3080
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
3081
- var objValue = safeGet(object, key),
3082
- srcValue = safeGet(source, key),
3083
- stacked = stack.get(srcValue);
3084
-
3085
- if (stacked) {
3086
- assignMergeValue(object, key, stacked);
3087
- return;
3088
- }
3089
- var newValue = customizer
3090
- ? customizer(objValue, srcValue, (key + ''), object, source, stack)
3091
- : undefined;
3092
-
3093
- var isCommon = newValue === undefined;
3094
-
3095
- if (isCommon) {
3096
- var isArr = isArray(srcValue),
3097
- isBuff = !isArr && isBuffer(srcValue),
3098
- isTyped = !isArr && !isBuff && isTypedArray(srcValue);
3099
-
3100
- newValue = srcValue;
3101
- if (isArr || isBuff || isTyped) {
3102
- if (isArray(objValue)) {
3103
- newValue = objValue;
3104
- }
3105
- else if (isArrayLikeObject(objValue)) {
3106
- newValue = copyArray(objValue);
3107
- }
3108
- else if (isBuff) {
3109
- isCommon = false;
3110
- newValue = cloneBuffer(srcValue, true);
3111
- }
3112
- else if (isTyped) {
3113
- isCommon = false;
3114
- newValue = cloneTypedArray(srcValue, true);
3115
- }
3116
- else {
3117
- newValue = [];
3118
- }
3119
- }
3120
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
3121
- newValue = objValue;
3122
- if (isArguments(objValue)) {
3123
- newValue = toPlainObject(objValue);
3124
- }
3125
- else if (!isObject(objValue) || isFunction(objValue)) {
3126
- newValue = initCloneObject(srcValue);
3127
- }
3128
- }
3129
- else {
3130
- isCommon = false;
3131
- }
3132
- }
3133
- if (isCommon) {
3134
- // Recursively merge objects and arrays (susceptible to call stack limits).
3135
- stack.set(srcValue, newValue);
3136
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
3137
- stack['delete'](srcValue);
3138
- }
3139
- assignMergeValue(object, key, newValue);
3140
- }
3141
-
3142
- _baseMergeDeep = baseMergeDeep;
3143
- return _baseMergeDeep;
3144
- }
3145
-
3146
- var _baseMerge;
3147
- var hasRequired_baseMerge;
3148
-
3149
- function require_baseMerge () {
3150
- if (hasRequired_baseMerge) return _baseMerge;
3151
- hasRequired_baseMerge = 1;
3152
- var Stack = /*@__PURE__*/ require_Stack(),
3153
- assignMergeValue = /*@__PURE__*/ require_assignMergeValue(),
3154
- baseFor = /*@__PURE__*/ require_baseFor(),
3155
- baseMergeDeep = /*@__PURE__*/ require_baseMergeDeep(),
3156
- isObject = /*@__PURE__*/ requireIsObject(),
3157
- keysIn = /*@__PURE__*/ requireKeysIn(),
3158
- safeGet = /*@__PURE__*/ require_safeGet();
3159
-
3160
- /**
3161
- * The base implementation of `_.merge` without support for multiple sources.
3162
- *
3163
- * @private
3164
- * @param {Object} object The destination object.
3165
- * @param {Object} source The source object.
3166
- * @param {number} srcIndex The index of `source`.
3167
- * @param {Function} [customizer] The function to customize merged values.
3168
- * @param {Object} [stack] Tracks traversed source values and their merged
3169
- * counterparts.
3170
- */
3171
- function baseMerge(object, source, srcIndex, customizer, stack) {
3172
- if (object === source) {
3173
- return;
3174
- }
3175
- baseFor(source, function(srcValue, key) {
3176
- stack || (stack = new Stack);
3177
- if (isObject(srcValue)) {
3178
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
3179
- }
3180
- else {
3181
- var newValue = customizer
3182
- ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
3183
- : undefined;
3184
-
3185
- if (newValue === undefined) {
3186
- newValue = srcValue;
3187
- }
3188
- assignMergeValue(object, key, newValue);
3189
- }
3190
- }, keysIn);
3191
- }
3192
-
3193
- _baseMerge = baseMerge;
3194
- return _baseMerge;
3195
- }
3196
-
3197
- var _customDefaultsMerge;
3198
- var hasRequired_customDefaultsMerge;
3199
-
3200
- function require_customDefaultsMerge () {
3201
- if (hasRequired_customDefaultsMerge) return _customDefaultsMerge;
3202
- hasRequired_customDefaultsMerge = 1;
3203
- var baseMerge = /*@__PURE__*/ require_baseMerge(),
3204
- isObject = /*@__PURE__*/ requireIsObject();
3205
-
3206
- /**
3207
- * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
3208
- * objects into destination objects that are passed thru.
3209
- *
3210
- * @private
3211
- * @param {*} objValue The destination value.
3212
- * @param {*} srcValue The source value.
3213
- * @param {string} key The key of the property to merge.
3214
- * @param {Object} object The parent object of `objValue`.
3215
- * @param {Object} source The parent object of `srcValue`.
3216
- * @param {Object} [stack] Tracks traversed source values and their merged
3217
- * counterparts.
3218
- * @returns {*} Returns the value to assign.
3219
- */
3220
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
3221
- if (isObject(objValue) && isObject(srcValue)) {
3222
- // Recursively merge objects and arrays (susceptible to call stack limits).
3223
- stack.set(srcValue, objValue);
3224
- baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
3225
- stack['delete'](srcValue);
3226
- }
3227
- return objValue;
3228
- }
3229
-
3230
- _customDefaultsMerge = customDefaultsMerge;
3231
- return _customDefaultsMerge;
3232
- }
3233
-
3234
- var _isIterateeCall;
3235
- var hasRequired_isIterateeCall;
3236
-
3237
- function require_isIterateeCall () {
3238
- if (hasRequired_isIterateeCall) return _isIterateeCall;
3239
- hasRequired_isIterateeCall = 1;
3240
- var eq = /*@__PURE__*/ requireEq(),
3241
- isArrayLike = /*@__PURE__*/ requireIsArrayLike(),
3242
- isIndex = /*@__PURE__*/ require_isIndex(),
3243
- isObject = /*@__PURE__*/ requireIsObject();
3244
-
3245
- /**
3246
- * Checks if the given arguments are from an iteratee call.
3247
- *
3248
- * @private
3249
- * @param {*} value The potential iteratee value argument.
3250
- * @param {*} index The potential iteratee index or key argument.
3251
- * @param {*} object The potential iteratee object argument.
3252
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
3253
- * else `false`.
3254
- */
3255
- function isIterateeCall(value, index, object) {
3256
- if (!isObject(object)) {
3257
- return false;
3258
- }
3259
- var type = typeof index;
3260
- if (type == 'number'
3261
- ? (isArrayLike(object) && isIndex(index, object.length))
3262
- : (type == 'string' && index in object)
3263
- ) {
3264
- return eq(object[index], value);
3265
- }
3266
- return false;
3267
- }
3268
-
3269
- _isIterateeCall = isIterateeCall;
3270
- return _isIterateeCall;
3271
- }
3272
-
3273
- var _createAssigner;
3274
- var hasRequired_createAssigner;
3275
-
3276
- function require_createAssigner () {
3277
- if (hasRequired_createAssigner) return _createAssigner;
3278
- hasRequired_createAssigner = 1;
3279
- var baseRest = /*@__PURE__*/ require_baseRest(),
3280
- isIterateeCall = /*@__PURE__*/ require_isIterateeCall();
3281
-
3282
- /**
3283
- * Creates a function like `_.assign`.
3284
- *
3285
- * @private
3286
- * @param {Function} assigner The function to assign values.
3287
- * @returns {Function} Returns the new assigner function.
3288
- */
3289
- function createAssigner(assigner) {
3290
- return baseRest(function(object, sources) {
3291
- var index = -1,
3292
- length = sources.length,
3293
- customizer = length > 1 ? sources[length - 1] : undefined,
3294
- guard = length > 2 ? sources[2] : undefined;
3295
-
3296
- customizer = (assigner.length > 3 && typeof customizer == 'function')
3297
- ? (length--, customizer)
3298
- : undefined;
3299
-
3300
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
3301
- customizer = length < 3 ? undefined : customizer;
3302
- length = 1;
3303
- }
3304
- object = Object(object);
3305
- while (++index < length) {
3306
- var source = sources[index];
3307
- if (source) {
3308
- assigner(object, source, index, customizer);
3309
- }
3310
- }
3311
- return object;
3312
- });
3313
- }
3314
-
3315
- _createAssigner = createAssigner;
3316
- return _createAssigner;
3317
- }
3318
-
3319
- var mergeWith_1;
3320
- var hasRequiredMergeWith;
3321
-
3322
- function requireMergeWith () {
3323
- if (hasRequiredMergeWith) return mergeWith_1;
3324
- hasRequiredMergeWith = 1;
3325
- var baseMerge = /*@__PURE__*/ require_baseMerge(),
3326
- createAssigner = /*@__PURE__*/ require_createAssigner();
3327
-
3328
- /**
3329
- * This method is like `_.merge` except that it accepts `customizer` which
3330
- * is invoked to produce the merged values of the destination and source
3331
- * properties. If `customizer` returns `undefined`, merging is handled by the
3332
- * method instead. The `customizer` is invoked with six arguments:
3333
- * (objValue, srcValue, key, object, source, stack).
3334
- *
3335
- * **Note:** This method mutates `object`.
3336
- *
3337
- * @static
3338
- * @memberOf _
3339
- * @since 4.0.0
3340
- * @category Object
3341
- * @param {Object} object The destination object.
3342
- * @param {...Object} sources The source objects.
3343
- * @param {Function} customizer The function to customize assigned values.
3344
- * @returns {Object} Returns `object`.
3345
- * @example
3346
- *
3347
- * function customizer(objValue, srcValue) {
3348
- * if (_.isArray(objValue)) {
3349
- * return objValue.concat(srcValue);
3350
- * }
3351
- * }
3352
- *
3353
- * var object = { 'a': [1], 'b': [2] };
3354
- * var other = { 'a': [3], 'b': [4] };
3355
- *
3356
- * _.mergeWith(object, other, customizer);
3357
- * // => { 'a': [1, 3], 'b': [2, 4] }
3358
- */
3359
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
3360
- baseMerge(object, source, srcIndex, customizer);
3361
- });
3362
-
3363
- mergeWith_1 = mergeWith;
3364
- return mergeWith_1;
3365
- }
3366
-
3367
- var defaultsDeep_1;
3368
- var hasRequiredDefaultsDeep;
3369
-
3370
- function requireDefaultsDeep () {
3371
- if (hasRequiredDefaultsDeep) return defaultsDeep_1;
3372
- hasRequiredDefaultsDeep = 1;
3373
- var apply = /*@__PURE__*/ require_apply(),
3374
- baseRest = /*@__PURE__*/ require_baseRest(),
3375
- customDefaultsMerge = /*@__PURE__*/ require_customDefaultsMerge(),
3376
- mergeWith = /*@__PURE__*/ requireMergeWith();
3377
-
3378
- /**
3379
- * This method is like `_.defaults` except that it recursively assigns
3380
- * default properties.
3381
- *
3382
- * **Note:** This method mutates `object`.
3383
- *
3384
- * @static
3385
- * @memberOf _
3386
- * @since 3.10.0
3387
- * @category Object
3388
- * @param {Object} object The destination object.
3389
- * @param {...Object} [sources] The source objects.
3390
- * @returns {Object} Returns `object`.
3391
- * @see _.defaults
3392
- * @example
3393
- *
3394
- * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
3395
- * // => { 'a': { 'b': 2, 'c': 3 } }
3396
- */
3397
- var defaultsDeep = baseRest(function(args) {
3398
- args.push(undefined, customDefaultsMerge);
3399
- return apply(mergeWith, undefined, args);
3400
- });
3401
-
3402
- defaultsDeep_1 = defaultsDeep;
3403
- return defaultsDeep_1;
3404
- }
3405
-
3406
- var defaultsDeepExports = /*@__PURE__*/ requireDefaultsDeep();
3407
- var defaultsDeep = /*@__PURE__*/getDefaultExportFromCjs(defaultsDeepExports);
3408
-
3409
- var isPlainObjectExports = /*@__PURE__*/ requireIsPlainObject();
3410
- var isPlainObject = /*@__PURE__*/getDefaultExportFromCjs(isPlainObjectExports);
3411
-
3412
- /**
3413
- * Utility function to generate default search locations
3414
- * @param name - Base name for configuration files
3415
- * @returns Array of default search locations
3416
- * @description
3417
- * Significance: Provides standard configuration file patterns
3418
- * Core idea: Generate common configuration file patterns
3419
- * Main function: Create search paths for different file types
3420
- * Main purpose: Standardize configuration file discovery
3421
- * Example:
3422
- * ```typescript
3423
- * const places = getDefaultSearchPlaces('myapp');
3424
- * // ['package.json', 'myapp.json', 'myapp.js', ...]
3425
- * ```
3426
- */
3427
- function getDefaultSearchPlaces(name) {
3428
- const exts = ['json', 'js', 'ts', 'cjs', 'yaml', 'yml'];
3429
- return [
3430
- 'package.json',
3431
- ...exts.map((ext) => `${name}.${ext}`),
3432
- ...exts.map((ext) => `.${name}.${ext}`)
3433
- ];
3434
- }
3435
- /**
3436
- * Configuration search utility class
3437
- * @class
3438
- * @description
3439
- * Significance: Manages configuration file discovery and loading
3440
- * Core idea: Unified configuration management
3441
- * Main function: Search and load configuration from various sources
3442
- * Main purpose: Provide consistent configuration access
3443
- * Example:
3444
- * ```typescript
3445
- * const configSearch = new ConfigSearch({
3446
- * name: 'myapp',
3447
- * defaultConfig: { port: 3000 }
3448
- * });
3449
- * const config = configSearch.config;
3450
- * ```
3451
- */
3452
- class ConfigSearch {
3453
- name;
3454
- searchPlaces;
3455
- _config;
3456
- loaders;
3457
- searchCache;
3458
- /**
3459
- * Creates a ConfigSearch instance
3460
- * @param options - Configuration search options
3461
- * @throws Error if neither name nor searchPlaces is provided
3462
- * @description
3463
- * Significance: Initializes configuration search environment
3464
- * Core idea: Setup configuration search parameters
3465
- * Main function: Create search instance with options
3466
- * Main purpose: Prepare for configuration discovery
3467
- * Example:
3468
- * ```typescript
3469
- * const search = new ConfigSearch({
3470
- * name: 'myapp',
3471
- * defaultConfig: { debug: true }
3472
- * });
3473
- * ```
3474
- */
3475
- constructor(options) {
3476
- const { name, searchPlaces, defaultConfig, loaders } = options;
3477
- if (!name && !searchPlaces) {
3478
- throw new Error('searchPlaces or name is required');
3479
- }
3480
- this.name = name;
3481
- this.searchPlaces = searchPlaces || getDefaultSearchPlaces(name);
3482
- this._config = defaultConfig || {};
3483
- this.loaders = loaders;
3484
- }
3485
- /**
3486
- * Get effective configuration
3487
- * @returns Merged configuration object
3488
- * @description
3489
- * Significance: Provides access to final configuration
3490
- * Core idea: Merge default and discovered configurations
3491
- * Main function: Retrieve effective configuration
3492
- * Main purpose: Access complete configuration
3493
- * Example:
3494
- * ```typescript
3495
- * const config = configSearch.config;
3496
- * console.log(config.debug); // true
3497
- * ```
3498
- */
3499
- get config() {
3500
- return defaultsDeep({}, this.search(), this._config);
3501
- }
3502
- /**
3503
- * Get search locations
3504
- * @returns Array of search locations
3505
- * @description
3506
- * Significance: Exposes configuration search paths
3507
- * Core idea: Provide transparency in search process
3508
- * Main function: Return search locations
3509
- * Main purpose: Debug and verify search paths
3510
- * Example:
3511
- * ```typescript
3512
- * const places = configSearch.getSearchPlaces();
3513
- * // ['package.json', 'myapp.config.js', ...]
3514
- * ```
3515
- */
3516
- getSearchPlaces() {
3517
- return this.searchPlaces;
3518
- }
3519
- /**
3520
- * Get configuration from specific location
3521
- * @param options - Search options
3522
- * @returns Configuration object
3523
- * @throws Error if configuration file is invalid
3524
- * @description
3525
- * Significance: Load configuration from specific location
3526
- * Core idea: Flexible configuration loading
3527
- * Main function: Load and validate configuration
3528
- * Main purpose: Custom configuration loading
3529
- * Example:
3530
- * ```typescript
3531
- * const config = configSearch.get({
3532
- * file: 'custom.config.js',
3533
- * dir: process.cwd()
3534
- * });
3535
- * ```
3536
- */
3537
- get(options = {}) {
3538
- const { file, dir = process.cwd() } = options;
3539
- const localConfig = {};
3540
- if (file === false)
3541
- return localConfig;
3542
- const explorer = cosmiconfigSync(this.name, {
3543
- searchPlaces: this.searchPlaces,
3544
- loaders: this.loaders
3545
- });
3546
- const result = file ? explorer.load(file) : explorer.search(dir);
3547
- if (result && typeof result.config === 'string') {
3548
- throw new Error(`Invalid configuration file at ${result.filepath}`);
3549
- }
3550
- return result && isPlainObject(result.config) ? result.config : localConfig;
3551
- }
3552
- /**
3553
- * Search for configuration with caching
3554
- * @returns Cached configuration object
3555
- * @description
3556
- * Significance: Provides cached configuration access
3557
- * Core idea: Cache configuration for performance
3558
- * Main function: Search and cache configuration
3559
- * Main purpose: Optimize repeated access
3560
- * Example:
3561
- * ```typescript
3562
- * const config = configSearch.search();
3563
- * // Subsequent calls use cached result
3564
- * ```
3565
- */
3566
- search() {
3567
- if (this.searchCache) {
3568
- return this.searchCache;
3569
- }
3570
- return (this.searchCache = this.get({}));
3571
- }
3572
- }
3573
-
3574
- const defaultFeConfig = {
3575
- protectedBranches: ['master', 'develop', 'main'],
3576
- cleanFiles: [
3577
- 'dist',
3578
- 'node_modules',
3579
- 'yarn.lock',
3580
- 'package-lock.json',
3581
- '.eslintcache',
3582
- '*.log'
3583
- ],
3584
- commitlint: {
3585
- extends: ['@commitlint/config-conventional']
3586
- },
3587
- release: {
3588
- publishPath: '',
3589
- autoMergeReleasePR: false,
3590
- autoMergeType: 'squash',
3591
- branchName: 'release-${pkgName}-${tagName}',
3592
- PRTitle: '[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}',
3593
- PRBody: '## Publish Details\n\n- 🏷️ Version: ${tagName}\n- 🌲 Branch: ${branch}\n- 🔧 Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.',
3594
- label: {
3595
- color: '1A7F37',
3596
- description: 'Release PR',
3597
- name: 'CI-Release'
3598
- },
3599
- packagesDirectories: [],
3600
- changePackagesLabel: 'changes:${name}'
3601
- },
3602
- envOrder: ['.env.local', '.env.production', '.env']
3603
- };
3604
-
3605
- var assignInWith_1;
3606
- var hasRequiredAssignInWith;
3607
-
3608
- function requireAssignInWith () {
3609
- if (hasRequiredAssignInWith) return assignInWith_1;
3610
- hasRequiredAssignInWith = 1;
3611
- var copyObject = /*@__PURE__*/ require_copyObject(),
3612
- createAssigner = /*@__PURE__*/ require_createAssigner(),
3613
- keysIn = /*@__PURE__*/ requireKeysIn();
3614
-
3615
- /**
3616
- * This method is like `_.assignIn` except that it accepts `customizer`
3617
- * which is invoked to produce the assigned values. If `customizer` returns
3618
- * `undefined`, assignment is handled by the method instead. The `customizer`
3619
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
3620
- *
3621
- * **Note:** This method mutates `object`.
3622
- *
3623
- * @static
3624
- * @memberOf _
3625
- * @since 4.0.0
3626
- * @alias extendWith
3627
- * @category Object
3628
- * @param {Object} object The destination object.
3629
- * @param {...Object} sources The source objects.
3630
- * @param {Function} [customizer] The function to customize assigned values.
3631
- * @returns {Object} Returns `object`.
3632
- * @see _.assignWith
3633
- * @example
3634
- *
3635
- * function customizer(objValue, srcValue) {
3636
- * return _.isUndefined(objValue) ? srcValue : objValue;
3637
- * }
3638
- *
3639
- * var defaults = _.partialRight(_.assignInWith, customizer);
3640
- *
3641
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
3642
- * // => { 'a': 1, 'b': 2 }
3643
- */
3644
- var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
3645
- copyObject(source, keysIn(source), object, customizer);
3646
- });
3647
-
3648
- assignInWith_1 = assignInWith;
3649
- return assignInWith_1;
3650
- }
3651
-
3652
- var isError_1;
3653
- var hasRequiredIsError;
3654
-
3655
- function requireIsError () {
3656
- if (hasRequiredIsError) return isError_1;
3657
- hasRequiredIsError = 1;
3658
- var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
3659
- isObjectLike = /*@__PURE__*/ requireIsObjectLike(),
3660
- isPlainObject = /*@__PURE__*/ requireIsPlainObject();
3661
-
3662
- /** `Object#toString` result references. */
3663
- var domExcTag = '[object DOMException]',
3664
- errorTag = '[object Error]';
3665
-
3666
- /**
3667
- * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
3668
- * `SyntaxError`, `TypeError`, or `URIError` object.
3669
- *
3670
- * @static
3671
- * @memberOf _
3672
- * @since 3.0.0
3673
- * @category Lang
3674
- * @param {*} value The value to check.
3675
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
3676
- * @example
3677
- *
3678
- * _.isError(new Error);
3679
- * // => true
3680
- *
3681
- * _.isError(Error);
3682
- * // => false
3683
- */
3684
- function isError(value) {
3685
- if (!isObjectLike(value)) {
3686
- return false;
3687
- }
3688
- var tag = baseGetTag(value);
3689
- return tag == errorTag || tag == domExcTag ||
3690
- (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
3691
- }
3692
-
3693
- isError_1 = isError;
3694
- return isError_1;
3695
- }
3696
-
3697
- var attempt_1;
3698
- var hasRequiredAttempt;
3699
-
3700
- function requireAttempt () {
3701
- if (hasRequiredAttempt) return attempt_1;
3702
- hasRequiredAttempt = 1;
3703
- var apply = /*@__PURE__*/ require_apply(),
3704
- baseRest = /*@__PURE__*/ require_baseRest(),
3705
- isError = /*@__PURE__*/ requireIsError();
3706
-
3707
- /**
3708
- * Attempts to invoke `func`, returning either the result or the caught error
3709
- * object. Any additional arguments are provided to `func` when it's invoked.
3710
- *
3711
- * @static
3712
- * @memberOf _
3713
- * @since 3.0.0
3714
- * @category Util
3715
- * @param {Function} func The function to attempt.
3716
- * @param {...*} [args] The arguments to invoke `func` with.
3717
- * @returns {*} Returns the `func` result or error object.
3718
- * @example
3719
- *
3720
- * // Avoid throwing errors for invalid selectors.
3721
- * var elements = _.attempt(function(selector) {
3722
- * return document.querySelectorAll(selector);
3723
- * }, '>_>');
3724
- *
3725
- * if (_.isError(elements)) {
3726
- * elements = [];
3727
- * }
3728
- */
3729
- var attempt = baseRest(function(func, args) {
3730
- try {
3731
- return apply(func, undefined, args);
3732
- } catch (e) {
3733
- return isError(e) ? e : new Error(e);
3734
- }
3735
- });
3736
-
3737
- attempt_1 = attempt;
3738
- return attempt_1;
3739
- }
3740
-
3741
- /**
3742
- * A specialized version of `_.map` for arrays without support for iteratee
3743
- * shorthands.
3744
- *
3745
- * @private
3746
- * @param {Array} [array] The array to iterate over.
3747
- * @param {Function} iteratee The function invoked per iteration.
3748
- * @returns {Array} Returns the new mapped array.
3749
- */
3750
-
3751
- var _arrayMap;
3752
- var hasRequired_arrayMap;
3753
-
3754
- function require_arrayMap () {
3755
- if (hasRequired_arrayMap) return _arrayMap;
3756
- hasRequired_arrayMap = 1;
3757
- function arrayMap(array, iteratee) {
3758
- var index = -1,
3759
- length = array == null ? 0 : array.length,
3760
- result = Array(length);
3761
-
3762
- while (++index < length) {
3763
- result[index] = iteratee(array[index], index, array);
3764
- }
3765
- return result;
3766
- }
3767
-
3768
- _arrayMap = arrayMap;
3769
- return _arrayMap;
3770
- }
3771
-
3772
- var _baseValues;
3773
- var hasRequired_baseValues;
3774
-
3775
- function require_baseValues () {
3776
- if (hasRequired_baseValues) return _baseValues;
3777
- hasRequired_baseValues = 1;
3778
- var arrayMap = /*@__PURE__*/ require_arrayMap();
3779
-
3780
- /**
3781
- * The base implementation of `_.values` and `_.valuesIn` which creates an
3782
- * array of `object` property values corresponding to the property names
3783
- * of `props`.
3784
- *
3785
- * @private
3786
- * @param {Object} object The object to query.
3787
- * @param {Array} props The property names to get values for.
3788
- * @returns {Object} Returns the array of property values.
3789
- */
3790
- function baseValues(object, props) {
3791
- return arrayMap(props, function(key) {
3792
- return object[key];
3793
- });
3794
- }
3795
-
3796
- _baseValues = baseValues;
3797
- return _baseValues;
3798
- }
3799
-
3800
- var _customDefaultsAssignIn;
3801
- var hasRequired_customDefaultsAssignIn;
3802
-
3803
- function require_customDefaultsAssignIn () {
3804
- if (hasRequired_customDefaultsAssignIn) return _customDefaultsAssignIn;
3805
- hasRequired_customDefaultsAssignIn = 1;
3806
- var eq = /*@__PURE__*/ requireEq();
3807
-
3808
- /** Used for built-in method references. */
3809
- var objectProto = Object.prototype;
3810
-
3811
- /** Used to check objects for own properties. */
3812
- var hasOwnProperty = objectProto.hasOwnProperty;
3813
-
3814
- /**
3815
- * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
3816
- * of source objects to the destination object for all destination properties
3817
- * that resolve to `undefined`.
3818
- *
3819
- * @private
3820
- * @param {*} objValue The destination value.
3821
- * @param {*} srcValue The source value.
3822
- * @param {string} key The key of the property to assign.
3823
- * @param {Object} object The parent object of `objValue`.
3824
- * @returns {*} Returns the value to assign.
3825
- */
3826
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
3827
- if (objValue === undefined ||
3828
- (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
3829
- return srcValue;
3830
- }
3831
- return objValue;
3832
- }
3833
-
3834
- _customDefaultsAssignIn = customDefaultsAssignIn;
3835
- return _customDefaultsAssignIn;
3836
- }
3837
-
3838
- /** Used to escape characters for inclusion in compiled string literals. */
3839
-
3840
- var _escapeStringChar;
3841
- var hasRequired_escapeStringChar;
3842
-
3843
- function require_escapeStringChar () {
3844
- if (hasRequired_escapeStringChar) return _escapeStringChar;
3845
- hasRequired_escapeStringChar = 1;
3846
- var stringEscapes = {
3847
- '\\': '\\',
3848
- "'": "'",
3849
- '\n': 'n',
3850
- '\r': 'r',
3851
- '\u2028': 'u2028',
3852
- '\u2029': 'u2029'
3853
- };
3854
-
3855
- /**
3856
- * Used by `_.template` to escape characters for inclusion in compiled string literals.
3857
- *
3858
- * @private
3859
- * @param {string} chr The matched character to escape.
3860
- * @returns {string} Returns the escaped character.
3861
- */
3862
- function escapeStringChar(chr) {
3863
- return '\\' + stringEscapes[chr];
3864
- }
3865
-
3866
- _escapeStringChar = escapeStringChar;
3867
- return _escapeStringChar;
3868
- }
3869
-
3870
- var _nativeKeys;
3871
- var hasRequired_nativeKeys;
3872
-
3873
- function require_nativeKeys () {
3874
- if (hasRequired_nativeKeys) return _nativeKeys;
3875
- hasRequired_nativeKeys = 1;
3876
- var overArg = /*@__PURE__*/ require_overArg();
3877
-
3878
- /* Built-in method references for those with the same name as other `lodash` methods. */
3879
- var nativeKeys = overArg(Object.keys, Object);
3880
-
3881
- _nativeKeys = nativeKeys;
3882
- return _nativeKeys;
3883
- }
3884
-
3885
- var _baseKeys;
3886
- var hasRequired_baseKeys;
3887
-
3888
- function require_baseKeys () {
3889
- if (hasRequired_baseKeys) return _baseKeys;
3890
- hasRequired_baseKeys = 1;
3891
- var isPrototype = /*@__PURE__*/ require_isPrototype(),
3892
- nativeKeys = /*@__PURE__*/ require_nativeKeys();
3893
-
3894
- /** Used for built-in method references. */
3895
- var objectProto = Object.prototype;
3896
-
3897
- /** Used to check objects for own properties. */
3898
- var hasOwnProperty = objectProto.hasOwnProperty;
3899
-
3900
- /**
3901
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
3902
- *
3903
- * @private
3904
- * @param {Object} object The object to query.
3905
- * @returns {Array} Returns the array of property names.
3906
- */
3907
- function baseKeys(object) {
3908
- if (!isPrototype(object)) {
3909
- return nativeKeys(object);
3910
- }
3911
- var result = [];
3912
- for (var key in Object(object)) {
3913
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
3914
- result.push(key);
3915
- }
3916
- }
3917
- return result;
3918
- }
3919
-
3920
- _baseKeys = baseKeys;
3921
- return _baseKeys;
3922
- }
3923
-
3924
- var keys_1;
3925
- var hasRequiredKeys;
3926
-
3927
- function requireKeys () {
3928
- if (hasRequiredKeys) return keys_1;
3929
- hasRequiredKeys = 1;
3930
- var arrayLikeKeys = /*@__PURE__*/ require_arrayLikeKeys(),
3931
- baseKeys = /*@__PURE__*/ require_baseKeys(),
3932
- isArrayLike = /*@__PURE__*/ requireIsArrayLike();
3933
-
3934
- /**
3935
- * Creates an array of the own enumerable property names of `object`.
3936
- *
3937
- * **Note:** Non-object values are coerced to objects. See the
3938
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
3939
- * for more details.
3940
- *
3941
- * @static
3942
- * @since 0.1.0
3943
- * @memberOf _
3944
- * @category Object
3945
- * @param {Object} object The object to query.
3946
- * @returns {Array} Returns the array of property names.
3947
- * @example
3948
- *
3949
- * function Foo() {
3950
- * this.a = 1;
3951
- * this.b = 2;
3952
- * }
3953
- *
3954
- * Foo.prototype.c = 3;
3955
- *
3956
- * _.keys(new Foo);
3957
- * // => ['a', 'b'] (iteration order is not guaranteed)
3958
- *
3959
- * _.keys('hi');
3960
- * // => ['0', '1']
3961
- */
3962
- function keys(object) {
3963
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
3964
- }
3965
-
3966
- keys_1 = keys;
3967
- return keys_1;
3968
- }
3969
-
3970
- /** Used to match template delimiters. */
3971
-
3972
- var _reInterpolate;
3973
- var hasRequired_reInterpolate;
3974
-
3975
- function require_reInterpolate () {
3976
- if (hasRequired_reInterpolate) return _reInterpolate;
3977
- hasRequired_reInterpolate = 1;
3978
- var reInterpolate = /<%=([\s\S]+?)%>/g;
3979
-
3980
- _reInterpolate = reInterpolate;
3981
- return _reInterpolate;
3982
- }
3983
-
3984
- /**
3985
- * The base implementation of `_.propertyOf` without support for deep paths.
3986
- *
3987
- * @private
3988
- * @param {Object} object The object to query.
3989
- * @returns {Function} Returns the new accessor function.
3990
- */
3991
-
3992
- var _basePropertyOf;
3993
- var hasRequired_basePropertyOf;
3994
-
3995
- function require_basePropertyOf () {
3996
- if (hasRequired_basePropertyOf) return _basePropertyOf;
3997
- hasRequired_basePropertyOf = 1;
3998
- function basePropertyOf(object) {
3999
- return function(key) {
4000
- return object == null ? undefined : object[key];
4001
- };
4002
- }
4003
-
4004
- _basePropertyOf = basePropertyOf;
4005
- return _basePropertyOf;
4006
- }
4007
-
4008
- var _escapeHtmlChar;
4009
- var hasRequired_escapeHtmlChar;
4010
-
4011
- function require_escapeHtmlChar () {
4012
- if (hasRequired_escapeHtmlChar) return _escapeHtmlChar;
4013
- hasRequired_escapeHtmlChar = 1;
4014
- var basePropertyOf = /*@__PURE__*/ require_basePropertyOf();
4015
-
4016
- /** Used to map characters to HTML entities. */
4017
- var htmlEscapes = {
4018
- '&': '&amp;',
4019
- '<': '&lt;',
4020
- '>': '&gt;',
4021
- '"': '&quot;',
4022
- "'": '&#39;'
4023
- };
4024
-
4025
- /**
4026
- * Used by `_.escape` to convert characters to HTML entities.
4027
- *
4028
- * @private
4029
- * @param {string} chr The matched character to escape.
4030
- * @returns {string} Returns the escaped character.
4031
- */
4032
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
4033
-
4034
- _escapeHtmlChar = escapeHtmlChar;
4035
- return _escapeHtmlChar;
4036
- }
4037
-
4038
- var isSymbol_1;
4039
- var hasRequiredIsSymbol;
4040
-
4041
- function requireIsSymbol () {
4042
- if (hasRequiredIsSymbol) return isSymbol_1;
4043
- hasRequiredIsSymbol = 1;
4044
- var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
4045
- isObjectLike = /*@__PURE__*/ requireIsObjectLike();
4046
-
4047
- /** `Object#toString` result references. */
4048
- var symbolTag = '[object Symbol]';
4049
-
4050
- /**
4051
- * Checks if `value` is classified as a `Symbol` primitive or object.
4052
- *
4053
- * @static
4054
- * @memberOf _
4055
- * @since 4.0.0
4056
- * @category Lang
4057
- * @param {*} value The value to check.
4058
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
4059
- * @example
4060
- *
4061
- * _.isSymbol(Symbol.iterator);
4062
- * // => true
4063
- *
4064
- * _.isSymbol('abc');
4065
- * // => false
4066
- */
4067
- function isSymbol(value) {
4068
- return typeof value == 'symbol' ||
4069
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
4070
- }
4071
-
4072
- isSymbol_1 = isSymbol;
4073
- return isSymbol_1;
4074
- }
4075
-
4076
- var _baseToString;
4077
- var hasRequired_baseToString;
4078
-
4079
- function require_baseToString () {
4080
- if (hasRequired_baseToString) return _baseToString;
4081
- hasRequired_baseToString = 1;
4082
- var Symbol = /*@__PURE__*/ require_Symbol(),
4083
- arrayMap = /*@__PURE__*/ require_arrayMap(),
4084
- isArray = /*@__PURE__*/ requireIsArray(),
4085
- isSymbol = /*@__PURE__*/ requireIsSymbol();
4086
-
4087
- /** Used to convert symbols to primitives and strings. */
4088
- var symbolProto = Symbol ? Symbol.prototype : undefined,
4089
- symbolToString = symbolProto ? symbolProto.toString : undefined;
4090
-
4091
- /**
4092
- * The base implementation of `_.toString` which doesn't convert nullish
4093
- * values to empty strings.
4094
- *
4095
- * @private
4096
- * @param {*} value The value to process.
4097
- * @returns {string} Returns the string.
4098
- */
4099
- function baseToString(value) {
4100
- // Exit early for strings to avoid a performance hit in some environments.
4101
- if (typeof value == 'string') {
4102
- return value;
4103
- }
4104
- if (isArray(value)) {
4105
- // Recursively convert values (susceptible to call stack limits).
4106
- return arrayMap(value, baseToString) + '';
4107
- }
4108
- if (isSymbol(value)) {
4109
- return symbolToString ? symbolToString.call(value) : '';
4110
- }
4111
- var result = (value + '');
4112
- return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
4113
- }
4114
-
4115
- _baseToString = baseToString;
4116
- return _baseToString;
4117
- }
4118
-
4119
- var toString_1;
4120
- var hasRequiredToString;
4121
-
4122
- function requireToString () {
4123
- if (hasRequiredToString) return toString_1;
4124
- hasRequiredToString = 1;
4125
- var baseToString = /*@__PURE__*/ require_baseToString();
4126
-
4127
- /**
4128
- * Converts `value` to a string. An empty string is returned for `null`
4129
- * and `undefined` values. The sign of `-0` is preserved.
4130
- *
4131
- * @static
4132
- * @memberOf _
4133
- * @since 4.0.0
4134
- * @category Lang
4135
- * @param {*} value The value to convert.
4136
- * @returns {string} Returns the converted string.
4137
- * @example
4138
- *
4139
- * _.toString(null);
4140
- * // => ''
4141
- *
4142
- * _.toString(-0);
4143
- * // => '-0'
4144
- *
4145
- * _.toString([1, 2, 3]);
4146
- * // => '1,2,3'
4147
- */
4148
- function toString(value) {
4149
- return value == null ? '' : baseToString(value);
4150
- }
4151
-
4152
- toString_1 = toString;
4153
- return toString_1;
4154
- }
4155
-
4156
- var _escape;
4157
- var hasRequired_escape;
4158
-
4159
- function require_escape () {
4160
- if (hasRequired_escape) return _escape;
4161
- hasRequired_escape = 1;
4162
- var escapeHtmlChar = /*@__PURE__*/ require_escapeHtmlChar(),
4163
- toString = /*@__PURE__*/ requireToString();
4164
-
4165
- /** Used to match HTML entities and HTML characters. */
4166
- var reUnescapedHtml = /[&<>"']/g,
4167
- reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
4168
-
4169
- /**
4170
- * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
4171
- * corresponding HTML entities.
4172
- *
4173
- * **Note:** No other characters are escaped. To escape additional
4174
- * characters use a third-party library like [_he_](https://mths.be/he).
4175
- *
4176
- * Though the ">" character is escaped for symmetry, characters like
4177
- * ">" and "/" don't need escaping in HTML and have no special meaning
4178
- * unless they're part of a tag or unquoted attribute value. See
4179
- * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
4180
- * (under "semi-related fun fact") for more details.
4181
- *
4182
- * When working with HTML you should always
4183
- * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
4184
- * XSS vectors.
4185
- *
4186
- * @static
4187
- * @since 0.1.0
4188
- * @memberOf _
4189
- * @category String
4190
- * @param {string} [string=''] The string to escape.
4191
- * @returns {string} Returns the escaped string.
4192
- * @example
4193
- *
4194
- * _.escape('fred, barney, & pebbles');
4195
- * // => 'fred, barney, &amp; pebbles'
4196
- */
4197
- function escape(string) {
4198
- string = toString(string);
4199
- return (string && reHasUnescapedHtml.test(string))
4200
- ? string.replace(reUnescapedHtml, escapeHtmlChar)
4201
- : string;
4202
- }
4203
-
4204
- _escape = escape;
4205
- return _escape;
4206
- }
4207
-
4208
- /** Used to match template delimiters. */
4209
-
4210
- var _reEscape;
4211
- var hasRequired_reEscape;
4212
-
4213
- function require_reEscape () {
4214
- if (hasRequired_reEscape) return _reEscape;
4215
- hasRequired_reEscape = 1;
4216
- var reEscape = /<%-([\s\S]+?)%>/g;
4217
-
4218
- _reEscape = reEscape;
4219
- return _reEscape;
4220
- }
4221
-
4222
- /** Used to match template delimiters. */
4223
-
4224
- var _reEvaluate;
4225
- var hasRequired_reEvaluate;
4226
-
4227
- function require_reEvaluate () {
4228
- if (hasRequired_reEvaluate) return _reEvaluate;
4229
- hasRequired_reEvaluate = 1;
4230
- var reEvaluate = /<%([\s\S]+?)%>/g;
4231
-
4232
- _reEvaluate = reEvaluate;
4233
- return _reEvaluate;
4234
- }
4235
-
4236
- var templateSettings_1;
4237
- var hasRequiredTemplateSettings;
4238
-
4239
- function requireTemplateSettings () {
4240
- if (hasRequiredTemplateSettings) return templateSettings_1;
4241
- hasRequiredTemplateSettings = 1;
4242
- var escape = /*@__PURE__*/ require_escape(),
4243
- reEscape = /*@__PURE__*/ require_reEscape(),
4244
- reEvaluate = /*@__PURE__*/ require_reEvaluate(),
4245
- reInterpolate = /*@__PURE__*/ require_reInterpolate();
4246
-
4247
- /**
4248
- * By default, the template delimiters used by lodash are like those in
4249
- * embedded Ruby (ERB) as well as ES2015 template strings. Change the
4250
- * following template settings to use alternative delimiters.
4251
- *
4252
- * @static
4253
- * @memberOf _
4254
- * @type {Object}
4255
- */
4256
- var templateSettings = {
4257
-
4258
- /**
4259
- * Used to detect `data` property values to be HTML-escaped.
4260
- *
4261
- * @memberOf _.templateSettings
4262
- * @type {RegExp}
4263
- */
4264
- 'escape': reEscape,
4265
-
4266
- /**
4267
- * Used to detect code to be evaluated.
4268
- *
4269
- * @memberOf _.templateSettings
4270
- * @type {RegExp}
4271
- */
4272
- 'evaluate': reEvaluate,
4273
-
4274
- /**
4275
- * Used to detect `data` property values to inject.
4276
- *
4277
- * @memberOf _.templateSettings
4278
- * @type {RegExp}
4279
- */
4280
- 'interpolate': reInterpolate,
4281
-
4282
- /**
4283
- * Used to reference the data object in the template text.
4284
- *
4285
- * @memberOf _.templateSettings
4286
- * @type {string}
4287
- */
4288
- 'variable': '',
4289
-
4290
- /**
4291
- * Used to import variables into the compiled template.
4292
- *
4293
- * @memberOf _.templateSettings
4294
- * @type {Object}
4295
- */
4296
- 'imports': {
4297
-
4298
- /**
4299
- * A reference to the `lodash` function.
4300
- *
4301
- * @memberOf _.templateSettings.imports
4302
- * @type {Function}
4303
- */
4304
- '_': { 'escape': escape }
4305
- }
4306
- };
4307
-
4308
- templateSettings_1 = templateSettings;
4309
- return templateSettings_1;
4310
- }
4311
-
4312
- var template_1;
4313
- var hasRequiredTemplate;
4314
-
4315
- function requireTemplate () {
4316
- if (hasRequiredTemplate) return template_1;
4317
- hasRequiredTemplate = 1;
4318
- var assignInWith = /*@__PURE__*/ requireAssignInWith(),
4319
- attempt = /*@__PURE__*/ requireAttempt(),
4320
- baseValues = /*@__PURE__*/ require_baseValues(),
4321
- customDefaultsAssignIn = /*@__PURE__*/ require_customDefaultsAssignIn(),
4322
- escapeStringChar = /*@__PURE__*/ require_escapeStringChar(),
4323
- isError = /*@__PURE__*/ requireIsError(),
4324
- isIterateeCall = /*@__PURE__*/ require_isIterateeCall(),
4325
- keys = /*@__PURE__*/ requireKeys(),
4326
- reInterpolate = /*@__PURE__*/ require_reInterpolate(),
4327
- templateSettings = /*@__PURE__*/ requireTemplateSettings(),
4328
- toString = /*@__PURE__*/ requireToString();
4329
-
4330
- /** Error message constants. */
4331
- var INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
4332
-
4333
- /** Used to match empty string literals in compiled template source. */
4334
- var reEmptyStringLeading = /\b__p \+= '';/g,
4335
- reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
4336
- reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
4337
-
4338
- /**
4339
- * Used to validate the `validate` option in `_.template` variable.
4340
- *
4341
- * Forbids characters which could potentially change the meaning of the function argument definition:
4342
- * - "()," (modification of function parameters)
4343
- * - "=" (default value)
4344
- * - "[]{}" (destructuring of function parameters)
4345
- * - "/" (beginning of a comment)
4346
- * - whitespace
4347
- */
4348
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
4349
-
4350
- /**
4351
- * Used to match
4352
- * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
4353
- */
4354
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
4355
-
4356
- /** Used to ensure capturing order of template delimiters. */
4357
- var reNoMatch = /($^)/;
4358
-
4359
- /** Used to match unescaped characters in compiled string literals. */
4360
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
4361
-
4362
- /** Used for built-in method references. */
4363
- var objectProto = Object.prototype;
4364
-
4365
- /** Used to check objects for own properties. */
4366
- var hasOwnProperty = objectProto.hasOwnProperty;
4367
-
4368
- /**
4369
- * Creates a compiled template function that can interpolate data properties
4370
- * in "interpolate" delimiters, HTML-escape interpolated data properties in
4371
- * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
4372
- * properties may be accessed as free variables in the template. If a setting
4373
- * object is given, it takes precedence over `_.templateSettings` values.
4374
- *
4375
- * **Note:** In the development build `_.template` utilizes
4376
- * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
4377
- * for easier debugging.
4378
- *
4379
- * For more information on precompiling templates see
4380
- * [lodash's custom builds documentation](https://lodash.com/custom-builds).
4381
- *
4382
- * For more information on Chrome extension sandboxes see
4383
- * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
4384
- *
4385
- * @static
4386
- * @since 0.1.0
4387
- * @memberOf _
4388
- * @category String
4389
- * @param {string} [string=''] The template string.
4390
- * @param {Object} [options={}] The options object.
4391
- * @param {RegExp} [options.escape=_.templateSettings.escape]
4392
- * The HTML "escape" delimiter.
4393
- * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
4394
- * The "evaluate" delimiter.
4395
- * @param {Object} [options.imports=_.templateSettings.imports]
4396
- * An object to import into the template as free variables.
4397
- * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
4398
- * The "interpolate" delimiter.
4399
- * @param {string} [options.sourceURL='templateSources[n]']
4400
- * The sourceURL of the compiled template.
4401
- * @param {string} [options.variable='obj']
4402
- * The data object variable name.
4403
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
4404
- * @returns {Function} Returns the compiled template function.
4405
- * @example
4406
- *
4407
- * // Use the "interpolate" delimiter to create a compiled template.
4408
- * var compiled = _.template('hello <%= user %>!');
4409
- * compiled({ 'user': 'fred' });
4410
- * // => 'hello fred!'
4411
- *
4412
- * // Use the HTML "escape" delimiter to escape data property values.
4413
- * var compiled = _.template('<b><%- value %></b>');
4414
- * compiled({ 'value': '<script>' });
4415
- * // => '<b>&lt;script&gt;</b>'
4416
- *
4417
- * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
4418
- * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
4419
- * compiled({ 'users': ['fred', 'barney'] });
4420
- * // => '<li>fred</li><li>barney</li>'
4421
- *
4422
- * // Use the internal `print` function in "evaluate" delimiters.
4423
- * var compiled = _.template('<% print("hello " + user); %>!');
4424
- * compiled({ 'user': 'barney' });
4425
- * // => 'hello barney!'
4426
- *
4427
- * // Use the ES template literal delimiter as an "interpolate" delimiter.
4428
- * // Disable support by replacing the "interpolate" delimiter.
4429
- * var compiled = _.template('hello ${ user }!');
4430
- * compiled({ 'user': 'pebbles' });
4431
- * // => 'hello pebbles!'
4432
- *
4433
- * // Use backslashes to treat delimiters as plain text.
4434
- * var compiled = _.template('<%= "\\<%- value %\\>" %>');
4435
- * compiled({ 'value': 'ignored' });
4436
- * // => '<%- value %>'
4437
- *
4438
- * // Use the `imports` option to import `jQuery` as `jq`.
4439
- * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
4440
- * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
4441
- * compiled({ 'users': ['fred', 'barney'] });
4442
- * // => '<li>fred</li><li>barney</li>'
4443
- *
4444
- * // Use the `sourceURL` option to specify a custom sourceURL for the template.
4445
- * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
4446
- * compiled(data);
4447
- * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
4448
- *
4449
- * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
4450
- * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
4451
- * compiled.source;
4452
- * // => function(data) {
4453
- * // var __t, __p = '';
4454
- * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
4455
- * // return __p;
4456
- * // }
4457
- *
4458
- * // Use custom template delimiters.
4459
- * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
4460
- * var compiled = _.template('hello {{ user }}!');
4461
- * compiled({ 'user': 'mustache' });
4462
- * // => 'hello mustache!'
4463
- *
4464
- * // Use the `source` property to inline compiled templates for meaningful
4465
- * // line numbers in error messages and stack traces.
4466
- * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
4467
- * var JST = {\
4468
- * "main": ' + _.template(mainText).source + '\
4469
- * };\
4470
- * ');
4471
- */
4472
- function template(string, options, guard) {
4473
- // Based on John Resig's `tmpl` implementation
4474
- // (http://ejohn.org/blog/javascript-micro-templating/)
4475
- // and Laura Doktorova's doT.js (https://github.com/olado/doT).
4476
- var settings = templateSettings.imports._.templateSettings || templateSettings;
4477
-
4478
- if (guard && isIterateeCall(string, options, guard)) {
4479
- options = undefined;
4480
- }
4481
- string = toString(string);
4482
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
4483
-
4484
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
4485
- importsKeys = keys(imports),
4486
- importsValues = baseValues(imports, importsKeys);
4487
-
4488
- var isEscaping,
4489
- isEvaluating,
4490
- index = 0,
4491
- interpolate = options.interpolate || reNoMatch,
4492
- source = "__p += '";
4493
-
4494
- // Compile the regexp to match each delimiter.
4495
- var reDelimiters = RegExp(
4496
- (options.escape || reNoMatch).source + '|' +
4497
- interpolate.source + '|' +
4498
- (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
4499
- (options.evaluate || reNoMatch).source + '|$'
4500
- , 'g');
4501
-
4502
- // Use a sourceURL for easier debugging.
4503
- // The sourceURL gets injected into the source that's eval-ed, so be careful
4504
- // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
4505
- // and escape the comment, thus injecting code that gets evaled.
4506
- var sourceURL = hasOwnProperty.call(options, 'sourceURL')
4507
- ? ('//# sourceURL=' +
4508
- (options.sourceURL + '').replace(/\s/g, ' ') +
4509
- '\n')
4510
- : '';
4511
-
4512
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
4513
- interpolateValue || (interpolateValue = esTemplateValue);
4514
-
4515
- // Escape characters that can't be included in string literals.
4516
- source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
4517
-
4518
- // Replace delimiters with snippets.
4519
- if (escapeValue) {
4520
- isEscaping = true;
4521
- source += "' +\n__e(" + escapeValue + ") +\n'";
4522
- }
4523
- if (evaluateValue) {
4524
- isEvaluating = true;
4525
- source += "';\n" + evaluateValue + ";\n__p += '";
4526
- }
4527
- if (interpolateValue) {
4528
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
4529
- }
4530
- index = offset + match.length;
4531
-
4532
- // The JS engine embedded in Adobe products needs `match` returned in
4533
- // order to produce the correct `offset` value.
4534
- return match;
4535
- });
4536
-
4537
- source += "';\n";
4538
-
4539
- // If `variable` is not specified wrap a with-statement around the generated
4540
- // code to add the data object to the top of the scope chain.
4541
- var variable = hasOwnProperty.call(options, 'variable') && options.variable;
4542
- if (!variable) {
4543
- source = 'with (obj) {\n' + source + '\n}\n';
4544
- }
4545
- // Throw an error if a forbidden character was found in `variable`, to prevent
4546
- // potential command injection attacks.
4547
- else if (reForbiddenIdentifierChars.test(variable)) {
4548
- throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
4549
- }
4550
-
4551
- // Cleanup code by stripping empty strings.
4552
- source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
4553
- .replace(reEmptyStringMiddle, '$1')
4554
- .replace(reEmptyStringTrailing, '$1;');
4555
-
4556
- // Frame code as the function body.
4557
- source = 'function(' + (variable || 'obj') + ') {\n' +
4558
- (variable
4559
- ? ''
4560
- : 'obj || (obj = {});\n'
4561
- ) +
4562
- "var __t, __p = ''" +
4563
- (isEscaping
4564
- ? ', __e = _.escape'
4565
- : ''
4566
- ) +
4567
- (isEvaluating
4568
- ? ', __j = Array.prototype.join;\n' +
4569
- "function print() { __p += __j.call(arguments, '') }\n"
4570
- : ';\n'
4571
- ) +
4572
- source +
4573
- 'return __p\n}';
4574
-
4575
- var result = attempt(function() {
4576
- return Function(importsKeys, sourceURL + 'return ' + source)
4577
- .apply(undefined, importsValues);
4578
- });
4579
-
4580
- // Provide the compiled function's source by its `toString` method or
4581
- // the `source` property as a convenience for inlining compiled templates.
4582
- result.source = source;
4583
- if (isError(result)) {
4584
- throw result;
4585
- }
4586
- return result;
4587
- }
4588
-
4589
- template_1 = template;
4590
- return template_1;
4591
- }
4592
-
4593
- var templateExports = /*@__PURE__*/ requireTemplate();
4594
- var lodashTemplate = /*@__PURE__*/getDefaultExportFromCjs(templateExports);
4595
-
4596
- /**
4597
- * Shell class for command execution
4598
- * @class
4599
- * @description Provides methods for executing shell commands with caching and templating support
4600
- */
4601
- class Shell {
4602
- config;
4603
- cache;
4604
- /**
4605
- * Creates a new Shell instance
4606
- * @param config - Shell configuration
4607
- * @param cache - Command cache map
4608
- */
4609
- constructor(config, cache = new Map()) {
4610
- this.config = config;
4611
- this.cache = cache;
4612
- }
4613
- /**
4614
- * Gets the logger instance
4615
- */
4616
- get logger() {
4617
- return this.config.logger;
4618
- }
4619
- /**
4620
- * Formats a template string with context
4621
- * @param template - Template string
4622
- * @param context - Context object for template interpolation
4623
- * @returns Formatted string
4624
- */
4625
- static format(template = '', context = {}) {
4626
- return lodashTemplate(template)(context);
4627
- }
4628
- /**
4629
- * Formats a template string with context and error handling
4630
- * @param template - Template string
4631
- * @param context - Context object for template interpolation
4632
- * @returns Formatted string
4633
- * @throws Error if template formatting fails
4634
- */
4635
- format(template = '', context = {}) {
4636
- try {
4637
- return Shell.format(template, context);
4638
- }
4639
- catch (error) {
4640
- this.logger.error(`Unable to render template with context:\n${template}\n${JSON.stringify(context)}`);
4641
- this.logger.error(error);
4642
- throw error;
4643
- }
4644
- }
4645
- /**
4646
- * Executes a command with options
4647
- * @param command - Command string or array
4648
- * @param options - Execution options
4649
- * @returns Promise resolving to command output
4650
- */
4651
- exec(command, options = {}) {
4652
- const { context, ...execOptions } = options;
4653
- return typeof command === 'string'
4654
- ? this.execFormattedCommand(this.format(command, context || {}), execOptions)
4655
- : this.execFormattedCommand(command, execOptions);
4656
- }
4657
- /**
4658
- * Executes a command silently
4659
- * @param command - Command string or array
4660
- * @param options - Execution options
4661
- * @returns Promise resolving to command output
4662
- * @deprecated Use `exec` instead
4663
- */
4664
- run(command, options = {}) {
4665
- return this.exec(command, { silent: true, ...options });
4666
- }
4667
- /**
4668
- * Executes a formatted command with caching
4669
- * @param command - Formatted command string or array
4670
- * @param options - Execution options
4671
- * @returns Promise resolving to command output
4672
- */
4673
- async execFormattedCommand(command, options = {}) {
4674
- const execPromise = this.config.execPromise;
4675
- if (!execPromise) {
4676
- throw new Error('execPromise is not defined');
4677
- }
4678
- const { dryRunResult, silent, dryRun, isCache } = options;
4679
- const isDryRun = dryRun !== undefined ? dryRun : this.config.dryRun;
4680
- const _isCache = isCache !== undefined ? !!isCache : !!this.config.isCache;
4681
- const cacheKey = typeof command === 'string' ? command : command.join(' ');
4682
- const isCached = _isCache && this.cache.has(cacheKey);
4683
- if (!silent) {
4684
- this.logger.exec(command, { isCached });
4685
- }
4686
- if (isDryRun) {
4687
- return Promise.resolve(dryRunResult);
4688
- }
4689
- if (isCached) {
4690
- return this.cache.get(cacheKey);
4691
- }
4692
- const result = execPromise(command, options);
4693
- if (!this.cache.has(cacheKey)) {
4694
- this.cache.set(cacheKey, result);
4695
- }
4696
- return result;
4697
- }
4698
- }
4699
-
4700
- var merge_1;
4701
- var hasRequiredMerge;
4702
-
4703
- function requireMerge () {
4704
- if (hasRequiredMerge) return merge_1;
4705
- hasRequiredMerge = 1;
4706
- var baseMerge = /*@__PURE__*/ require_baseMerge(),
4707
- createAssigner = /*@__PURE__*/ require_createAssigner();
4708
-
4709
- /**
4710
- * This method is like `_.assign` except that it recursively merges own and
4711
- * inherited enumerable string keyed properties of source objects into the
4712
- * destination object. Source properties that resolve to `undefined` are
4713
- * skipped if a destination value exists. Array and plain object properties
4714
- * are merged recursively. Other objects and value types are overridden by
4715
- * assignment. Source objects are applied from left to right. Subsequent
4716
- * sources overwrite property assignments of previous sources.
4717
- *
4718
- * **Note:** This method mutates `object`.
4719
- *
4720
- * @static
4721
- * @memberOf _
4722
- * @since 0.5.0
4723
- * @category Object
4724
- * @param {Object} object The destination object.
4725
- * @param {...Object} [sources] The source objects.
4726
- * @returns {Object} Returns `object`.
4727
- * @example
4728
- *
4729
- * var object = {
4730
- * 'a': [{ 'b': 2 }, { 'd': 4 }]
4731
- * };
4732
- *
4733
- * var other = {
4734
- * 'a': [{ 'c': 3 }, { 'e': 5 }]
4735
- * };
4736
- *
4737
- * _.merge(object, other);
4738
- * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
4739
- */
4740
- var merge = createAssigner(function(object, source, srcIndex) {
4741
- baseMerge(object, source, srcIndex);
4742
- });
4743
-
4744
- merge_1 = merge;
4745
- return merge_1;
4746
- }
4747
-
4748
- var mergeExports = /*@__PURE__*/ requireMerge();
4749
- var merge = /*@__PURE__*/getDefaultExportFromCjs(mergeExports);
4750
-
4751
- class ScriptsLogger extends Logger {
4752
- /**
4753
- * @override
4754
- * @param {string} value
4755
- * @returns {string}
4756
- */
4757
- prefix(value) {
4758
- switch (value) {
4759
- case 'INFO':
4760
- return chalk.blue(value);
4761
- case 'WARN':
4762
- return chalk.yellow(value);
4763
- case 'ERROR':
4764
- return chalk.red(value);
4765
- case 'DEBUG':
4766
- return chalk.gray(value);
4767
- default:
4768
- return value;
4769
- }
4770
- }
4771
- obtrusive(title) {
4772
- const header = chalk.bold(title);
4773
- super.obtrusive(header);
4774
- }
4775
- }
4776
-
4777
- const execPromise = (command, options) => {
4778
- const commandString = Array.isArray(command) ? command.join(' ') : command;
4779
- return new Promise((resolve, reject) => {
4780
- exec(commandString, {
4781
- encoding: 'utf-8',
4782
- ...options
4783
- }, (err, stdout, stderr) => {
4784
- let code;
4785
- if (!err) {
4786
- code = 0;
4787
- }
4788
- else if (err.code === undefined) {
4789
- code = 1;
4790
- }
4791
- else {
4792
- code = err.code;
4793
- }
4794
- if (code === 0) {
4795
- resolve(stdout.trim());
4796
- }
4797
- else {
4798
- reject(new Error(stderr || stdout));
4799
- }
4800
- });
4801
- });
4802
- };
4803
-
4804
- /**
4805
- * Create a new ConfigSearch instance with fe configuration
4806
- * @param feConfig - Custom fe configuration
4807
- * @returns ConfigSearch instance
4808
- * @description
4809
- * Significance: Creates configuration search utility
4810
- * Core idea: Merge default and custom configurations
4811
- * Main function: Initialize configuration search
4812
- * Main purpose: Provide configuration discovery
4813
- *
4814
- * @example
4815
- * ```typescript
4816
- * const configSearch = getFeConfigSearch({ debug: true });
4817
- * ```
4818
- */
4819
- function getFeConfigSearch(feConfig) {
4820
- return new ConfigSearch({
4821
- name: 'fe-config',
4822
- defaultConfig: merge({}, defaultFeConfig, feConfig)
4823
- });
4824
- }
4825
- /**
4826
- * Script execution context class
4827
- * @class
4828
- * @description
4829
- * Significance: Manages script execution environment
4830
- * Core idea: Provide unified context for script execution
4831
- * Main function: Initialize and maintain script context
4832
- * Main purpose: Standardize script execution environment
4833
- *
4834
- * @example
4835
- * ```typescript
4836
- * const context = new FeScriptContext<MyOptions>({
4837
- * dryRun: true,
4838
- * verbose: true
4839
- * });
4840
- * ```
4841
- */
4842
- class FeScriptContext {
4843
- /** Logger instance */
4844
- logger;
4845
- /** Shell instance */
4846
- shell;
4847
- /** Fe configuration */
4848
- feConfig;
4849
- /** Dry run flag */
4850
- dryRun;
4851
- /** Verbose logging flag */
4852
- verbose;
4853
- /** Script-specific options */
4854
- options;
4855
- /**
4856
- * Creates a FeScriptContext instance
4857
- *
4858
- * @description
4859
- * Significance: Initializes script execution context
4860
- * Core idea: Setup execution environment
4861
- * Main function: Create context with options
4862
- * Main purpose: Prepare script execution environment
4863
- *
4864
- * @example
4865
- * ```typescript
4866
- * const context = new FeScriptContext({
4867
- * dryRun: true,
4868
- * options: { branch: 'main' }
4869
- * });
4870
- * ```
4871
- */
4872
- constructor(scriptsOptions) {
4873
- const { logger, shell, feConfig, dryRun, verbose, options } = scriptsOptions || {};
4874
- const _options = options || {};
4875
- this.logger = logger || new ScriptsLogger({ debug: verbose, dryRun });
4876
- this.shell =
4877
- shell ||
4878
- new Shell({
4879
- logger: this.logger,
4880
- dryRun: dryRun,
4881
- execPromise: _options.execPromise || execPromise
4882
- });
4883
- this.feConfig = getFeConfigSearch(feConfig).config;
4884
- this.dryRun = !!dryRun;
4885
- this.verbose = !!verbose;
4886
- this.options = _options;
4887
- }
4888
- }
4889
-
4890
- export { ConfigSearch, FeScriptContext, ScriptsLogger, Shell, defaultFeConfig, getFeConfigSearch };
1
+ import{cosmiconfigSync as r}from"cosmiconfig";import{Logger as t}from"@qlover/fe-corekit";import n from"chalk";import{exec as e}from"child_process";var o,u,i,c,a,f,s,l,p,v,h,d,y,g,_,b,m,j,w,O,P,x,R,$,A,S,z,C,E,F,k,T,N,U,B,I,M,q,D,L,G,V,W,J,H,K,Q,X,Y,Z,rr,tr,nr,er,or,ur,ir,cr,ar,fr,sr,lr,pr,vr,hr,dr,yr,gr,_r,br,mr,jr,wr,Or,Pr,xr,Rr,$r,Ar,Sr,zr,Cr,Er,Fr,kr,Tr,Nr,Ur,Br,Ir,Mr,qr,Dr,Lr,Gr,Vr,Wr,Jr,Hr,Kr,Qr,Xr,Yr,Zr,rt,tt,nt,et,ot,ut,it,ct,at,ft,st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function lt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function pt(){if(u)return o;return u=1,o=function(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}}function vt(){if(c)return i;return c=1,i=function(r){return r}}function ht(){if(f)return a;f=1;var r=pt(),t=Math.max;return a=function(n,e,o){return e=t(void 0===e?n.length-1:e,0),function(){for(var u=arguments,i=-1,c=t(u.length-e,0),a=Array(c);++i<c;)a[i]=u[e+i];i=-1;for(var f=Array(e+1);++i<e;)f[i]=u[i];return f[e]=o(a),r(n,this,f)}},a}function dt(){if(l)return s;return l=1,s=function(r){return function(){return r}}}function yt(){if(v)return p;v=1;var r="object"==typeof st&&st&&st.Object===Object&&st;return p=r}function gt(){if(d)return h;d=1;var r=yt(),t="object"==typeof self&&self&&self.Object===Object&&self,n=r||t||Function("return this")();return h=n}function _t(){if(g)return y;g=1;var r=gt().Symbol;return y=r}function bt(){if(b)return _;b=1;var r=_t(),t=Object.prototype,n=t.hasOwnProperty,e=t.toString,o=r?r.toStringTag:void 0;return _=function(r){var t=n.call(r,o),u=r[o];try{r[o]=void 0;var i=!0}catch(r){}var c=e.call(r);return i&&(t?r[o]=u:delete r[o]),c}}function mt(){if(j)return m;j=1;var r=Object.prototype.toString;return m=function(t){return r.call(t)}}function jt(){if(O)return w;O=1;var r=_t(),t=bt(),n=mt(),e=r?r.toStringTag:void 0;return w=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?t(r):n(r)}}function wt(){if(x)return P;return x=1,P=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)}}function Ot(){if($)return R;$=1;var r=jt(),t=wt();return R=function(n){if(!t(n))return!1;var e=r(n);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}function Pt(){if(S)return A;S=1;var r=gt()["__core-js_shared__"];return A=r}function xt(){if(C)return z;C=1;var r,t=Pt(),n=(r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return z=function(r){return!!n&&n in r}}function Rt(){if(F)return E;F=1;var r=Function.prototype.toString;return E=function(t){if(null!=t){try{return r.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}function $t(){if(T)return k;T=1;var r=Ot(),t=xt(),n=wt(),e=Rt(),o=/^\[object .+?Constructor\]$/,u=Function.prototype,i=Object.prototype,c=u.toString,a=i.hasOwnProperty,f=RegExp("^"+c.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return k=function(u){return!(!n(u)||t(u))&&(r(u)?f:o).test(e(u))}}function At(){if(U)return N;return U=1,N=function(r,t){return null==r?void 0:r[t]}}function St(){if(I)return B;I=1;var r=$t(),t=At();return B=function(n,e){var o=t(n,e);return r(o)?o:void 0}}function zt(){if(q)return M;q=1;var r=St(),t=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return M=t}function Ct(){if(L)return D;L=1;var r=dt(),t=zt();return D=t?function(n,e){return t(n,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:vt()}function Et(){if(V)return G;V=1;var r=Date.now;return G=function(t){var n=0,e=0;return function(){var o=r(),u=16-(o-e);if(e=o,u>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},G}function Ft(){if(J)return W;J=1;var r=Ct(),t=Et()(r);return W=t}function kt(){if(K)return H;K=1;var r=vt(),t=ht(),n=Ft();return H=function(e,o){return n(t(e,o,r),e+"")}}function Tt(){if(X)return Q;return X=1,Q=function(){this.__data__=[],this.size=0}}function Nt(){if(Z)return Y;return Z=1,Y=function(r,t){return r===t||r!=r&&t!=t}}function Ut(){if(tr)return rr;tr=1;var r=Nt();return rr=function(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return-1}}function Bt(){if(er)return nr;er=1;var r=Ut(),t=Array.prototype.splice;return nr=function(n){var e=this.__data__,o=r(e,n);return!(o<0)&&(o==e.length-1?e.pop():t.call(e,o,1),--this.size,!0)}}function It(){if(ur)return or;ur=1;var r=Ut();return or=function(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]}}function Mt(){if(cr)return ir;cr=1;var r=Ut();return ir=function(t){return r(this.__data__,t)>-1}}function qt(){if(fr)return ar;fr=1;var r=Ut();return ar=function(t,n){var e=this.__data__,o=r(e,t);return o<0?(++this.size,e.push([t,n])):e[o][1]=n,this}}function Dt(){if(lr)return sr;lr=1;var r=Tt(),t=Bt(),n=It(),e=Mt(),o=qt();function u(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return u.prototype.clear=r,u.prototype.delete=t,u.prototype.get=n,u.prototype.has=e,u.prototype.set=o,sr=u}function Lt(){if(vr)return pr;vr=1;var r=Dt();return pr=function(){this.__data__=new r,this.size=0}}function Gt(){if(dr)return hr;return dr=1,hr=function(r){var t=this.__data__,n=t.delete(r);return this.size=t.size,n}}function Vt(){if(gr)return yr;return gr=1,yr=function(r){return this.__data__.get(r)}}function Wt(){if(br)return _r;return br=1,_r=function(r){return this.__data__.has(r)}}function Jt(){if(jr)return mr;jr=1;var r=St()(gt(),"Map");return mr=r}function Ht(){if(Or)return wr;Or=1;var r=St()(Object,"create");return wr=r}function Kt(){if(xr)return Pr;xr=1;var r=Ht();return Pr=function(){this.__data__=r?r(null):{},this.size=0}}function Qt(){if($r)return Rr;return $r=1,Rr=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}}function Xt(){if(Sr)return Ar;Sr=1;var r=Ht(),t=Object.prototype.hasOwnProperty;return Ar=function(n){var e=this.__data__;if(r){var o=e[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(e,n)?e[n]:void 0}}function Yt(){if(Cr)return zr;Cr=1;var r=Ht(),t=Object.prototype.hasOwnProperty;return zr=function(n){var e=this.__data__;return r?void 0!==e[n]:t.call(e,n)}}function Zt(){if(Fr)return Er;Fr=1;var r=Ht();return Er=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=r&&void 0===n?"__lodash_hash_undefined__":n,this}}function rn(){if(Tr)return kr;Tr=1;var r=Kt(),t=Qt(),n=Xt(),e=Yt(),o=Zt();function u(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return u.prototype.clear=r,u.prototype.delete=t,u.prototype.get=n,u.prototype.has=e,u.prototype.set=o,kr=u}function tn(){if(Ur)return Nr;Ur=1;var r=rn(),t=Dt(),n=Jt();return Nr=function(){this.size=0,this.__data__={hash:new r,map:new(n||t),string:new r}}}function nn(){if(Ir)return Br;return Ir=1,Br=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r}}function en(){if(qr)return Mr;qr=1;var r=nn();return Mr=function(t,n){var e=t.__data__;return r(n)?e["string"==typeof n?"string":"hash"]:e.map}}function on(){if(Lr)return Dr;Lr=1;var r=en();return Dr=function(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}function un(){if(Vr)return Gr;Vr=1;var r=en();return Gr=function(t){return r(this,t).get(t)}}function cn(){if(Jr)return Wr;Jr=1;var r=en();return Wr=function(t){return r(this,t).has(t)}}function an(){if(Kr)return Hr;Kr=1;var r=en();return Hr=function(t,n){var e=r(this,t),o=e.size;return e.set(t,n),this.size+=e.size==o?0:1,this}}function fn(){if(Xr)return Qr;Xr=1;var r=tn(),t=on(),n=un(),e=cn(),o=an();function u(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return u.prototype.clear=r,u.prototype.delete=t,u.prototype.get=n,u.prototype.has=e,u.prototype.set=o,Qr=u}function sn(){if(Zr)return Yr;Zr=1;var r=Dt(),t=Jt(),n=fn();return Yr=function(e,o){var u=this.__data__;if(u instanceof r){var i=u.__data__;if(!t||i.length<199)return i.push([e,o]),this.size=++u.size,this;u=this.__data__=new n(i)}return u.set(e,o),this.size=u.size,this}}function ln(){if(tt)return rt;tt=1;var r=Dt(),t=Lt(),n=Gt(),e=Vt(),o=Wt(),u=sn();function i(t){var n=this.__data__=new r(t);this.size=n.size}return i.prototype.clear=t,i.prototype.delete=n,i.prototype.get=e,i.prototype.has=o,i.prototype.set=u,rt=i}function pn(){if(et)return nt;et=1;var r=zt();return nt=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}}function vn(){if(ut)return ot;ut=1;var r=pn(),t=Nt();return ot=function(n,e,o){(void 0!==o&&!t(n[e],o)||void 0===o&&!(e in n))&&r(n,e,o)}}function hn(){if(ct)return it;return ct=1,it=function(r){return function(t,n,e){for(var o=-1,u=Object(t),i=e(t),c=i.length;c--;){var a=i[r?c:++o];if(!1===n(u[a],a,u))break}return t}}}function dn(){if(ft)return at;ft=1;var r=hn()();return at=r}var yn,gn,_n,bn,mn,jn,wn,On,Pn,xn,Rn,$n,An,Sn,zn,Cn,En,Fn,kn,Tn,Nn,Un,Bn,In,Mn,qn,Dn,Ln,Gn,Vn,Wn,Jn,Hn,Kn={exports:{}};function Qn(){return yn||(yn=1,r=Kn,t=Kn.exports,n=gt(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,u=o&&o.exports===e?n.Buffer:void 0,i=u?u.allocUnsafe:void 0,r.exports=function(r,t){if(t)return r.slice();var n=r.length,e=i?i(n):new r.constructor(n);return r.copy(e),e}),Kn.exports;var r,t,n,e,o,u,i}function Xn(){if(_n)return gn;_n=1;var r=gt().Uint8Array;return gn=r}function Yn(){if(mn)return bn;mn=1;var r=Xn();return bn=function(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}}function Zn(){if(wn)return jn;wn=1;var r=Yn();return jn=function(t,n){var e=n?r(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}}function re(){if(Pn)return On;return Pn=1,On=function(r,t){var n=-1,e=r.length;for(t||(t=Array(e));++n<e;)t[n]=r[n];return t}}function te(){if(Rn)return xn;Rn=1;var r=wt(),t=Object.create,n=function(){function n(){}return function(e){if(!r(e))return{};if(t)return t(e);n.prototype=e;var o=new n;return n.prototype=void 0,o}}();return xn=n}function ne(){if(An)return $n;return An=1,$n=function(r,t){return function(n){return r(t(n))}}}function ee(){if(zn)return Sn;zn=1;var r=ne()(Object.getPrototypeOf,Object);return Sn=r}function oe(){if(En)return Cn;En=1;var r=Object.prototype;return Cn=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||r)}}function ue(){if(kn)return Fn;kn=1;var r=te(),t=ee(),n=oe();return Fn=function(e){return"function"!=typeof e.constructor||n(e)?{}:r(t(e))}}function ie(){if(Nn)return Tn;return Nn=1,Tn=function(r){return null!=r&&"object"==typeof r}}function ce(){if(Bn)return Un;Bn=1;var r=jt(),t=ie();return Un=function(n){return t(n)&&"[object Arguments]"==r(n)}}function ae(){if(Mn)return In;Mn=1;var r=ce(),t=ie(),n=Object.prototype,e=n.hasOwnProperty,o=n.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(r){return t(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return In=u}function fe(){if(Dn)return qn;Dn=1;var r=Array.isArray;return qn=r}function se(){if(Gn)return Ln;Gn=1;return Ln=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}}function le(){if(Wn)return Vn;Wn=1;var r=Ot(),t=se();return Vn=function(n){return null!=n&&t(n.length)&&!r(n)}}function pe(){if(Hn)return Jn;Hn=1;var r=le(),t=ie();return Jn=function(n){return t(n)&&r(n)}}var ve,he,de,ye,ge,_e,be,me,je,we={exports:{}};function Oe(){if(he)return ve;return he=1,ve=function(){return!1}}function Pe(){return de||(de=1,function(r,t){var n=gt(),e=Oe(),o=t&&!t.nodeType&&t,u=o&&r&&!r.nodeType&&r,i=u&&u.exports===o?n.Buffer:void 0,c=(i?i.isBuffer:void 0)||e;r.exports=c}(we,we.exports)),we.exports}function xe(){if(ge)return ye;ge=1;var r=jt(),t=ee(),n=ie(),e=Function.prototype,o=Object.prototype,u=e.toString,i=o.hasOwnProperty,c=u.call(Object);return ye=function(e){if(!n(e)||"[object Object]"!=r(e))return!1;var o=t(e);if(null===o)return!0;var a=i.call(o,"constructor")&&o.constructor;return"function"==typeof a&&a instanceof a&&u.call(a)==c}}function Re(){if(be)return _e;be=1;var r=jt(),t=se(),n=ie(),e={};return e["[object Float32Array]"]=e["[object Float64Array]"]=e["[object Int8Array]"]=e["[object Int16Array]"]=e["[object Int32Array]"]=e["[object Uint8Array]"]=e["[object Uint8ClampedArray]"]=e["[object Uint16Array]"]=e["[object Uint32Array]"]=!0,e["[object Arguments]"]=e["[object Array]"]=e["[object ArrayBuffer]"]=e["[object Boolean]"]=e["[object DataView]"]=e["[object Date]"]=e["[object Error]"]=e["[object Function]"]=e["[object Map]"]=e["[object Number]"]=e["[object Object]"]=e["[object RegExp]"]=e["[object Set]"]=e["[object String]"]=e["[object WeakMap]"]=!1,_e=function(o){return n(o)&&t(o.length)&&!!e[r(o)]}}function $e(){if(je)return me;return je=1,me=function(r){return function(t){return r(t)}}}var Ae,Se,ze,Ce,Ee,Fe,ke,Te,Ne,Ue,Be,Ie,Me,qe,De,Le,Ge,Ve,We,Je,He,Ke,Qe,Xe,Ye,Ze,ro,to,no,eo,oo,uo,io,co,ao,fo,so,lo={exports:{}};function po(){return Ae||(Ae=1,r=lo,t=lo.exports,n=yt(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,u=o&&o.exports===e&&n.process,i=function(){try{var r=o&&o.require&&o.require("util").types;return r||u&&u.binding&&u.binding("util")}catch(r){}}(),r.exports=i),lo.exports;var r,t,n,e,o,u,i}function vo(){if(ze)return Se;ze=1;var r=Re(),t=$e(),n=po(),e=n&&n.isTypedArray,o=e?t(e):r;return Se=o}function ho(){if(Ee)return Ce;return Ee=1,Ce=function(r,t){if(("constructor"!==t||"function"!=typeof r[t])&&"__proto__"!=t)return r[t]}}function yo(){if(ke)return Fe;ke=1;var r=pn(),t=Nt(),n=Object.prototype.hasOwnProperty;return Fe=function(e,o,u){var i=e[o];n.call(e,o)&&t(i,u)&&(void 0!==u||o in e)||r(e,o,u)}}function go(){if(Ne)return Te;Ne=1;var r=yo(),t=pn();return Te=function(n,e,o,u){var i=!o;o||(o={});for(var c=-1,a=e.length;++c<a;){var f=e[c],s=u?u(o[f],n[f],f,o,n):void 0;void 0===s&&(s=n[f]),i?t(o,f,s):r(o,f,s)}return o}}function _o(){if(Be)return Ue;return Be=1,Ue=function(r,t){for(var n=-1,e=Array(r);++n<r;)e[n]=t(n);return e}}function bo(){if(Me)return Ie;Me=1;var r=/^(?:0|[1-9]\d*)$/;return Ie=function(t,n){var e=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==e||"symbol"!=e&&r.test(t))&&t>-1&&t%1==0&&t<n}}function mo(){if(De)return qe;De=1;var r=_o(),t=ae(),n=fe(),e=Pe(),o=bo(),u=vo(),i=Object.prototype.hasOwnProperty;return qe=function(c,a){var f=n(c),s=!f&&t(c),l=!f&&!s&&e(c),p=!f&&!s&&!l&&u(c),v=f||s||l||p,h=v?r(c.length,String):[],d=h.length;for(var y in c)!a&&!i.call(c,y)||v&&("length"==y||l&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||o(y,d))||h.push(y);return h}}function jo(){if(Ge)return Le;return Ge=1,Le=function(r){var t=[];if(null!=r)for(var n in Object(r))t.push(n);return t}}function wo(){if(We)return Ve;We=1;var r=wt(),t=oe(),n=jo(),e=Object.prototype.hasOwnProperty;return Ve=function(o){if(!r(o))return n(o);var u=t(o),i=[];for(var c in o)("constructor"!=c||!u&&e.call(o,c))&&i.push(c);return i}}function Oo(){if(He)return Je;He=1;var r=mo(),t=wo(),n=le();return Je=function(e){return n(e)?r(e,!0):t(e)}}function Po(){if(Qe)return Ke;Qe=1;var r=go(),t=Oo();return Ke=function(n){return r(n,t(n))}}function xo(){if(Ye)return Xe;Ye=1;var r=vn(),t=Qn(),n=Zn(),e=re(),o=ue(),u=ae(),i=fe(),c=pe(),a=Pe(),f=Ot(),s=wt(),l=xe(),p=vo(),v=ho(),h=Po();return Xe=function(d,y,g,_,b,m,j){var w=v(d,g),O=v(y,g),P=j.get(O);if(P)r(d,g,P);else{var x=m?m(w,O,g+"",d,y,j):void 0,R=void 0===x;if(R){var $=i(O),A=!$&&a(O),S=!$&&!A&&p(O);x=O,$||A||S?i(w)?x=w:c(w)?x=e(w):A?(R=!1,x=t(O,!0)):S?(R=!1,x=n(O,!0)):x=[]:l(O)||u(O)?(x=w,u(w)?x=h(w):s(w)&&!f(w)||(x=o(O))):R=!1}R&&(j.set(O,x),b(x,O,_,m,j),j.delete(O)),r(d,g,x)}}}function Ro(){if(ro)return Ze;ro=1;var r=ln(),t=vn(),n=dn(),e=xo(),o=wt(),u=Oo(),i=ho();return Ze=function c(a,f,s,l,p){a!==f&&n(f,(function(n,u){if(p||(p=new r),o(n))e(a,f,u,s,c,l,p);else{var v=l?l(i(a,u),n,u+"",a,f,p):void 0;void 0===v&&(v=n),t(a,u,v)}}),u)},Ze}function $o(){if(no)return to;no=1;var r=Ro(),t=wt();return to=function n(e,o,u,i,c,a){return t(e)&&t(o)&&(a.set(o,e),r(e,o,void 0,n,a),a.delete(o)),e},to}function Ao(){if(oo)return eo;oo=1;var r=Nt(),t=le(),n=bo(),e=wt();return eo=function(o,u,i){if(!e(i))return!1;var c=typeof u;return!!("number"==c?t(i)&&n(u,i.length):"string"==c&&u in i)&&r(i[u],o)}}function So(){if(io)return uo;io=1;var r=kt(),t=Ao();return uo=function(n){return r((function(r,e){var o=-1,u=e.length,i=u>1?e[u-1]:void 0,c=u>2?e[2]:void 0;for(i=n.length>3&&"function"==typeof i?(u--,i):void 0,c&&t(e[0],e[1],c)&&(i=u<3?void 0:i,u=1),r=Object(r);++o<u;){var a=e[o];a&&n(r,a,o,i)}return r}))}}function zo(){if(ao)return co;ao=1;var r=Ro(),t=So()((function(t,n,e,o){r(t,n,e,o)}));return co=t}function Co(){if(so)return fo;so=1;var r=pt(),t=kt(),n=$o(),e=zo(),o=t((function(t){return t.push(void 0,n),r(e,void 0,t)}));return fo=o}var Eo=lt(Co()),Fo=lt(xe());class ko{name;searchPlaces;_config;loaders;searchCache;constructor(r){const{name:t,searchPlaces:n,defaultConfig:e,loaders:o}=r;if(!t&&!n)throw new Error("searchPlaces or name is required");this.name=t,this.searchPlaces=n||function(r){const t=["json","js","ts","cjs","yaml","yml"];return["package.json",...t.map((t=>`${r}.${t}`)),...t.map((t=>`.${r}.${t}`))]}(t),this._config=e||{},this.loaders=o}get config(){return Eo({},this.search(),this._config)}getSearchPlaces(){return this.searchPlaces}get(t={}){const{file:n,dir:e=process.cwd()}=t,o={};if(!1===n)return o;const u=r(this.name,{searchPlaces:this.searchPlaces,loaders:this.loaders}),i=n?u.load(n):u.search(e);if(i&&"string"==typeof i.config)throw new Error(`Invalid configuration file at ${i.filepath}`);return i&&Fo(i.config)?i.config:o}search(){return this.searchCache?this.searchCache:this.searchCache=this.get({})}}const To={protectedBranches:["master","develop","main"],cleanFiles:["dist","node_modules","yarn.lock","package-lock.json",".eslintcache","*.log"],commitlint:{extends:["@commitlint/config-conventional"]},release:{publishPath:"",autoMergeReleasePR:!1,autoMergeType:"squash",branchName:"release-${pkgName}-${tagName}",PRTitle:"[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}",PRBody:"## Publish Details\n\n- 🏷️ Version: ${tagName}\n- 🌲 Branch: ${branch}\n- 🔧 Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.",label:{color:"1A7F37",description:"Release PR",name:"CI-Release"},packagesDirectories:[],changePackagesLabel:"changes:${name}"},envOrder:[".env.local",".env.production",".env"]};var No,Uo,Bo,Io,Mo,qo,Do,Lo,Go,Vo,Wo,Jo,Ho,Ko,Qo,Xo,Yo,Zo,ru,tu,nu,eu,ou,uu,iu,cu,au,fu,su,lu,pu,vu,hu,du,yu,gu,_u,bu,mu,ju,wu,Ou;function Pu(){if(Uo)return No;Uo=1;var r=go(),t=So(),n=Oo(),e=t((function(t,e,o,u){r(e,n(e),t,u)}));return No=e}function xu(){if(Io)return Bo;Io=1;var r=jt(),t=ie(),n=xe();return Bo=function(e){if(!t(e))return!1;var o=r(e);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof e.message&&"string"==typeof e.name&&!n(e)}}function Ru(){if(qo)return Mo;qo=1;var r=pt(),t=kt(),n=xu(),e=t((function(t,e){try{return r(t,void 0,e)}catch(r){return n(r)?r:new Error(r)}}));return Mo=e}function $u(){if(Lo)return Do;return Lo=1,Do=function(r,t){for(var n=-1,e=null==r?0:r.length,o=Array(e);++n<e;)o[n]=t(r[n],n,r);return o}}function Au(){if(Vo)return Go;Vo=1;var r=$u();return Go=function(t,n){return r(n,(function(r){return t[r]}))}}function Su(){if(Jo)return Wo;Jo=1;var r=Nt(),t=Object.prototype,n=t.hasOwnProperty;return Wo=function(e,o,u,i){return void 0===e||r(e,t[u])&&!n.call(i,u)?o:e}}function zu(){if(Ko)return Ho;Ko=1;var r={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return Ho=function(t){return"\\"+r[t]}}function Cu(){if(Xo)return Qo;Xo=1;var r=ne()(Object.keys,Object);return Qo=r}function Eu(){if(Zo)return Yo;Zo=1;var r=oe(),t=Cu(),n=Object.prototype.hasOwnProperty;return Yo=function(e){if(!r(e))return t(e);var o=[];for(var u in Object(e))n.call(e,u)&&"constructor"!=u&&o.push(u);return o}}function Fu(){if(tu)return ru;tu=1;var r=mo(),t=Eu(),n=le();return ru=function(e){return n(e)?r(e):t(e)}}function ku(){if(eu)return nu;eu=1;return nu=/<%=([\s\S]+?)%>/g}function Tu(){if(uu)return ou;return uu=1,ou=function(r){return function(t){return null==r?void 0:r[t]}}}function Nu(){if(cu)return iu;cu=1;var r=Tu()({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});return iu=r}function Uu(){if(fu)return au;fu=1;var r=jt(),t=ie();return au=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==r(n)}}function Bu(){if(lu)return su;lu=1;var r=_t(),t=$u(),n=fe(),e=Uu(),o=r?r.prototype:void 0,u=o?o.toString:void 0;return su=function r(o){if("string"==typeof o)return o;if(n(o))return t(o,r)+"";if(e(o))return u?u.call(o):"";var i=o+"";return"0"==i&&1/o==-1/0?"-0":i},su}function Iu(){if(vu)return pu;vu=1;var r=Bu();return pu=function(t){return null==t?"":r(t)}}function Mu(){if(du)return hu;du=1;var r=Nu(),t=Iu(),n=/[&<>"']/g,e=RegExp(n.source);return hu=function(o){return(o=t(o))&&e.test(o)?o.replace(n,r):o}}function qu(){if(gu)return yu;gu=1;return yu=/<%-([\s\S]+?)%>/g}function Du(){if(bu)return _u;bu=1;return _u=/<%([\s\S]+?)%>/g}function Lu(){if(ju)return mu;ju=1;var r=Mu();return mu={escape:qu(),evaluate:Du(),interpolate:ku(),variable:"",imports:{_:{escape:r}}}}function Gu(){if(Ou)return wu;Ou=1;var r=Pu(),t=Ru(),n=Au(),e=Su(),o=zu(),u=xu(),i=Ao(),c=Fu(),a=ku(),f=Lu(),s=Iu(),l=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,v=/(__e\(.*?\)|\b__t\)) \+\n'';/g,h=/[()=,{}\[\]\/\s]/,d=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,y=/($^)/,g=/['\n\r\u2028\u2029\\]/g,_=Object.prototype.hasOwnProperty;return wu=function(b,m,j){var w=f.imports._.templateSettings||f;j&&i(b,m,j)&&(m=void 0),b=s(b),m=r({},m,w,e);var O,P,x=r({},m.imports,w.imports,e),R=c(x),$=n(x,R),A=0,S=m.interpolate||y,z="__p += '",C=RegExp((m.escape||y).source+"|"+S.source+"|"+(S===a?d:y).source+"|"+(m.evaluate||y).source+"|$","g"),E=_.call(m,"sourceURL")?"//# sourceURL="+(m.sourceURL+"").replace(/\s/g," ")+"\n":"";b.replace(C,(function(r,t,n,e,u,i){return n||(n=e),z+=b.slice(A,i).replace(g,o),t&&(O=!0,z+="' +\n__e("+t+") +\n'"),u&&(P=!0,z+="';\n"+u+";\n__p += '"),n&&(z+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),A=i+r.length,r})),z+="';\n";var F=_.call(m,"variable")&&m.variable;if(F){if(h.test(F))throw new Error("Invalid `variable` option passed into `_.template`")}else z="with (obj) {\n"+z+"\n}\n";z=(P?z.replace(l,""):z).replace(p,"$1").replace(v,"$1;"),z="function("+(F||"obj")+") {\n"+(F?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(O?", __e = _.escape":"")+(P?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+z+"return __p\n}";var k=t((function(){return Function(R,E+"return "+z).apply(void 0,$)}));if(k.source=z,u(k))throw k;return k}}var Vu,Wu,Ju=lt(Gu());class Hu{config;cache;constructor(r,t=new Map){this.config=r,this.cache=t}get logger(){return this.config.logger}static format(r="",t={}){return Ju(r)(t)}format(r="",t={}){try{return Hu.format(r,t)}catch(n){throw this.logger.error(`Unable to render template with context:\n${r}\n${JSON.stringify(t)}`),this.logger.error(n),n}}exec(r,t={}){const{context:n,...e}=t;return"string"==typeof r?this.execFormattedCommand(this.format(r,n||{}),e):this.execFormattedCommand(r,e)}run(r,t={}){return this.exec(r,{silent:!0,...t})}async execFormattedCommand(r,t={}){const n=this.config.execPromise;if(!n)throw new Error("execPromise is not defined");const{dryRunResult:e,silent:o,dryRun:u,isCache:i}=t,c=void 0!==u?u:this.config.dryRun,a=void 0!==i?!!i:!!this.config.isCache,f="string"==typeof r?r:r.join(" "),s=a&&this.cache.has(f);if(o||this.logger.exec(r,{isCached:s}),c)return Promise.resolve(e);if(s)return this.cache.get(f);const l=n(r,t);return this.cache.has(f)||this.cache.set(f,l),l}}function Ku(){if(Wu)return Vu;Wu=1;var r=Ro(),t=So()((function(t,n,e){r(t,n,e)}));return Vu=t}var Qu=lt(Ku());class Xu extends t{prefix(r){switch(r){case"INFO":return n.blue(r);case"WARN":return n.yellow(r);case"ERROR":return n.red(r);case"DEBUG":return n.gray(r);default:return r}}obtrusive(r){const t=n.bold(r);super.obtrusive(t)}}const Yu=(r,t)=>{const n=Array.isArray(r)?r.join(" "):r;return new Promise(((r,o)=>{e(n,{encoding:"utf-8",...t},((t,n,e)=>{let u;u=t?void 0===t.code?1:t.code:0,0===u?r(n.trim()):o(new Error(e||n))}))}))};function Zu(r){return new ko({name:"fe-config",defaultConfig:Qu({},To,r)})}class ri{logger;shell;feConfig;dryRun;verbose;options;constructor(r){const{logger:t,shell:n,feConfig:e,dryRun:o,verbose:u,options:i}=r||{},c=i||{};this.logger=t||new Xu({debug:u,dryRun:o}),this.shell=n||new Hu({logger:this.logger,dryRun:o,execPromise:c.execPromise||Yu}),this.feConfig=Zu(e).config,this.dryRun=!!o,this.verbose=!!u,this.options=c}}export{ko as ConfigSearch,ri as FeScriptContext,Xu as ScriptsLogger,Hu as Shell,To as defaultFeConfig,Zu as getFeConfigSearch};