test-mixer 2.0.16 → 3.0.2

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.
@@ -1,3376 +0,0 @@
1
- /**
2
- * @name test-mixer
3
- * @fileoverview Test helper to generate function opts object variations
4
- * @version 2.0.16
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/test-mixer/}
8
- */
9
-
10
- (function (global, factory) {
11
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
12
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
13
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.testMixer = {}));
14
- }(this, (function (exports) { 'use strict';
15
-
16
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
17
-
18
- function createCommonjsModule(fn) {
19
- var module = { exports: {} };
20
- return fn(module, module.exports), module.exports;
21
- }
22
-
23
- /**
24
- * lodash (Custom Build) <https://lodash.com/>
25
- * Build: `lodash modularize exports="npm" -o ./`
26
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
27
- * Released under MIT license <https://lodash.com/license>
28
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
29
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
30
- */
31
-
32
- /** Used to stand-in for `undefined` hash values. */
33
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
34
-
35
- /** Used as references for various `Number` constants. */
36
- var MAX_SAFE_INTEGER = 9007199254740991;
37
-
38
- /** `Object#toString` result references. */
39
- var funcTag = '[object Function]',
40
- genTag = '[object GeneratorFunction]';
41
-
42
- /**
43
- * Used to match `RegExp`
44
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
45
- */
46
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
47
-
48
- /** Used to detect host constructors (Safari). */
49
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
50
-
51
- /** Detect free variable `global` from Node.js. */
52
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
53
-
54
- /** Detect free variable `self`. */
55
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
56
-
57
- /** Used as a reference to the global object. */
58
- var root = freeGlobal || freeSelf || Function('return this')();
59
-
60
- /**
61
- * A faster alternative to `Function#apply`, this function invokes `func`
62
- * with the `this` binding of `thisArg` and the arguments of `args`.
63
- *
64
- * @private
65
- * @param {Function} func The function to invoke.
66
- * @param {*} thisArg The `this` binding of `func`.
67
- * @param {Array} args The arguments to invoke `func` with.
68
- * @returns {*} Returns the result of `func`.
69
- */
70
- function apply$1(func, thisArg, args) {
71
- switch (args.length) {
72
- case 0: return func.call(thisArg);
73
- case 1: return func.call(thisArg, args[0]);
74
- case 2: return func.call(thisArg, args[0], args[1]);
75
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
76
- }
77
- return func.apply(thisArg, args);
78
- }
79
-
80
- /**
81
- * A specialized version of `_.includes` for arrays without support for
82
- * specifying an index to search from.
83
- *
84
- * @private
85
- * @param {Array} [array] The array to inspect.
86
- * @param {*} target The value to search for.
87
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
88
- */
89
- function arrayIncludes(array, value) {
90
- var length = array ? array.length : 0;
91
- return !!length && baseIndexOf$1(array, value, 0) > -1;
92
- }
93
-
94
- /**
95
- * This function is like `arrayIncludes` except that it accepts a comparator.
96
- *
97
- * @private
98
- * @param {Array} [array] The array to inspect.
99
- * @param {*} target The value to search for.
100
- * @param {Function} comparator The comparator invoked per element.
101
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
102
- */
103
- function arrayIncludesWith(array, value, comparator) {
104
- var index = -1,
105
- length = array ? array.length : 0;
106
-
107
- while (++index < length) {
108
- if (comparator(value, array[index])) {
109
- return true;
110
- }
111
- }
112
- return false;
113
- }
114
-
115
- /**
116
- * A specialized version of `_.map` for arrays without support for iteratee
117
- * shorthands.
118
- *
119
- * @private
120
- * @param {Array} [array] The array to iterate over.
121
- * @param {Function} iteratee The function invoked per iteration.
122
- * @returns {Array} Returns the new mapped array.
123
- */
124
- function arrayMap$1(array, iteratee) {
125
- var index = -1,
126
- length = array ? array.length : 0,
127
- result = Array(length);
128
-
129
- while (++index < length) {
130
- result[index] = iteratee(array[index], index, array);
131
- }
132
- return result;
133
- }
134
-
135
- /**
136
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
137
- * support for iteratee shorthands.
138
- *
139
- * @private
140
- * @param {Array} array The array to inspect.
141
- * @param {Function} predicate The function invoked per iteration.
142
- * @param {number} fromIndex The index to search from.
143
- * @param {boolean} [fromRight] Specify iterating from right to left.
144
- * @returns {number} Returns the index of the matched value, else `-1`.
145
- */
146
- function baseFindIndex$1(array, predicate, fromIndex, fromRight) {
147
- var length = array.length,
148
- index = fromIndex + (fromRight ? 1 : -1);
149
-
150
- while ((fromRight ? index-- : ++index < length)) {
151
- if (predicate(array[index], index, array)) {
152
- return index;
153
- }
154
- }
155
- return -1;
156
- }
157
-
158
- /**
159
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
160
- *
161
- * @private
162
- * @param {Array} array The array to inspect.
163
- * @param {*} value The value to search for.
164
- * @param {number} fromIndex The index to search from.
165
- * @returns {number} Returns the index of the matched value, else `-1`.
166
- */
167
- function baseIndexOf$1(array, value, fromIndex) {
168
- if (value !== value) {
169
- return baseFindIndex$1(array, baseIsNaN$1, fromIndex);
170
- }
171
- var index = fromIndex - 1,
172
- length = array.length;
173
-
174
- while (++index < length) {
175
- if (array[index] === value) {
176
- return index;
177
- }
178
- }
179
- return -1;
180
- }
181
-
182
- /**
183
- * The base implementation of `_.isNaN` without support for number objects.
184
- *
185
- * @private
186
- * @param {*} value The value to check.
187
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
188
- */
189
- function baseIsNaN$1(value) {
190
- return value !== value;
191
- }
192
-
193
- /**
194
- * The base implementation of `_.unary` without support for storing metadata.
195
- *
196
- * @private
197
- * @param {Function} func The function to cap arguments for.
198
- * @returns {Function} Returns the new capped function.
199
- */
200
- function baseUnary$1(func) {
201
- return function(value) {
202
- return func(value);
203
- };
204
- }
205
-
206
- /**
207
- * Checks if a cache value for `key` exists.
208
- *
209
- * @private
210
- * @param {Object} cache The cache to query.
211
- * @param {string} key The key of the entry to check.
212
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
213
- */
214
- function cacheHas(cache, key) {
215
- return cache.has(key);
216
- }
217
-
218
- /**
219
- * Gets the value at `key` of `object`.
220
- *
221
- * @private
222
- * @param {Object} [object] The object to query.
223
- * @param {string} key The key of the property to get.
224
- * @returns {*} Returns the property value.
225
- */
226
- function getValue(object, key) {
227
- return object == null ? undefined : object[key];
228
- }
229
-
230
- /**
231
- * Checks if `value` is a host object in IE < 9.
232
- *
233
- * @private
234
- * @param {*} value The value to check.
235
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
236
- */
237
- function isHostObject$1(value) {
238
- // Many host objects are `Object` objects that can coerce to strings
239
- // despite having improperly defined `toString` methods.
240
- var result = false;
241
- if (value != null && typeof value.toString != 'function') {
242
- try {
243
- result = !!(value + '');
244
- } catch (e) {}
245
- }
246
- return result;
247
- }
248
-
249
- /** Used for built-in method references. */
250
- var arrayProto$1 = Array.prototype,
251
- funcProto$1 = Function.prototype,
252
- objectProto$1 = Object.prototype;
253
-
254
- /** Used to detect overreaching core-js shims. */
255
- var coreJsData = root['__core-js_shared__'];
256
-
257
- /** Used to detect methods masquerading as native. */
258
- var maskSrcKey = (function() {
259
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
260
- return uid ? ('Symbol(src)_1.' + uid) : '';
261
- }());
262
-
263
- /** Used to resolve the decompiled source of functions. */
264
- var funcToString$1 = funcProto$1.toString;
265
-
266
- /** Used to check objects for own properties. */
267
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
268
-
269
- /**
270
- * Used to resolve the
271
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
272
- * of values.
273
- */
274
- var objectToString$1 = objectProto$1.toString;
275
-
276
- /** Used to detect if a method is native. */
277
- var reIsNative = RegExp('^' +
278
- funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&')
279
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
280
- );
281
-
282
- /** Built-in value references. */
283
- var splice$1 = arrayProto$1.splice;
284
-
285
- /* Built-in method references for those with the same name as other `lodash` methods. */
286
- var nativeMax$1 = Math.max,
287
- nativeMin = Math.min;
288
-
289
- /* Built-in method references that are verified to be native. */
290
- var Map = getNative(root, 'Map'),
291
- nativeCreate = getNative(Object, 'create');
292
-
293
- /**
294
- * Creates a hash object.
295
- *
296
- * @private
297
- * @constructor
298
- * @param {Array} [entries] The key-value pairs to cache.
299
- */
300
- function Hash(entries) {
301
- var index = -1,
302
- length = entries ? entries.length : 0;
303
-
304
- this.clear();
305
- while (++index < length) {
306
- var entry = entries[index];
307
- this.set(entry[0], entry[1]);
308
- }
309
- }
310
-
311
- /**
312
- * Removes all key-value entries from the hash.
313
- *
314
- * @private
315
- * @name clear
316
- * @memberOf Hash
317
- */
318
- function hashClear() {
319
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
320
- }
321
-
322
- /**
323
- * Removes `key` and its value from the hash.
324
- *
325
- * @private
326
- * @name delete
327
- * @memberOf Hash
328
- * @param {Object} hash The hash to modify.
329
- * @param {string} key The key of the value to remove.
330
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
331
- */
332
- function hashDelete(key) {
333
- return this.has(key) && delete this.__data__[key];
334
- }
335
-
336
- /**
337
- * Gets the hash value for `key`.
338
- *
339
- * @private
340
- * @name get
341
- * @memberOf Hash
342
- * @param {string} key The key of the value to get.
343
- * @returns {*} Returns the entry value.
344
- */
345
- function hashGet(key) {
346
- var data = this.__data__;
347
- if (nativeCreate) {
348
- var result = data[key];
349
- return result === HASH_UNDEFINED ? undefined : result;
350
- }
351
- return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
352
- }
353
-
354
- /**
355
- * Checks if a hash value for `key` exists.
356
- *
357
- * @private
358
- * @name has
359
- * @memberOf Hash
360
- * @param {string} key The key of the entry to check.
361
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
362
- */
363
- function hashHas(key) {
364
- var data = this.__data__;
365
- return nativeCreate ? data[key] !== undefined : hasOwnProperty$1.call(data, key);
366
- }
367
-
368
- /**
369
- * Sets the hash `key` to `value`.
370
- *
371
- * @private
372
- * @name set
373
- * @memberOf Hash
374
- * @param {string} key The key of the value to set.
375
- * @param {*} value The value to set.
376
- * @returns {Object} Returns the hash instance.
377
- */
378
- function hashSet(key, value) {
379
- var data = this.__data__;
380
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
381
- return this;
382
- }
383
-
384
- // Add methods to `Hash`.
385
- Hash.prototype.clear = hashClear;
386
- Hash.prototype['delete'] = hashDelete;
387
- Hash.prototype.get = hashGet;
388
- Hash.prototype.has = hashHas;
389
- Hash.prototype.set = hashSet;
390
-
391
- /**
392
- * Creates an list cache object.
393
- *
394
- * @private
395
- * @constructor
396
- * @param {Array} [entries] The key-value pairs to cache.
397
- */
398
- function ListCache(entries) {
399
- var index = -1,
400
- length = entries ? entries.length : 0;
401
-
402
- this.clear();
403
- while (++index < length) {
404
- var entry = entries[index];
405
- this.set(entry[0], entry[1]);
406
- }
407
- }
408
-
409
- /**
410
- * Removes all key-value entries from the list cache.
411
- *
412
- * @private
413
- * @name clear
414
- * @memberOf ListCache
415
- */
416
- function listCacheClear() {
417
- this.__data__ = [];
418
- }
419
-
420
- /**
421
- * Removes `key` and its value from the list cache.
422
- *
423
- * @private
424
- * @name delete
425
- * @memberOf ListCache
426
- * @param {string} key The key of the value to remove.
427
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
428
- */
429
- function listCacheDelete(key) {
430
- var data = this.__data__,
431
- index = assocIndexOf(data, key);
432
-
433
- if (index < 0) {
434
- return false;
435
- }
436
- var lastIndex = data.length - 1;
437
- if (index == lastIndex) {
438
- data.pop();
439
- } else {
440
- splice$1.call(data, index, 1);
441
- }
442
- return true;
443
- }
444
-
445
- /**
446
- * Gets the list cache value for `key`.
447
- *
448
- * @private
449
- * @name get
450
- * @memberOf ListCache
451
- * @param {string} key The key of the value to get.
452
- * @returns {*} Returns the entry value.
453
- */
454
- function listCacheGet(key) {
455
- var data = this.__data__,
456
- index = assocIndexOf(data, key);
457
-
458
- return index < 0 ? undefined : data[index][1];
459
- }
460
-
461
- /**
462
- * Checks if a list cache value for `key` exists.
463
- *
464
- * @private
465
- * @name has
466
- * @memberOf ListCache
467
- * @param {string} key The key of the entry to check.
468
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
469
- */
470
- function listCacheHas(key) {
471
- return assocIndexOf(this.__data__, key) > -1;
472
- }
473
-
474
- /**
475
- * Sets the list cache `key` to `value`.
476
- *
477
- * @private
478
- * @name set
479
- * @memberOf ListCache
480
- * @param {string} key The key of the value to set.
481
- * @param {*} value The value to set.
482
- * @returns {Object} Returns the list cache instance.
483
- */
484
- function listCacheSet(key, value) {
485
- var data = this.__data__,
486
- index = assocIndexOf(data, key);
487
-
488
- if (index < 0) {
489
- data.push([key, value]);
490
- } else {
491
- data[index][1] = value;
492
- }
493
- return this;
494
- }
495
-
496
- // Add methods to `ListCache`.
497
- ListCache.prototype.clear = listCacheClear;
498
- ListCache.prototype['delete'] = listCacheDelete;
499
- ListCache.prototype.get = listCacheGet;
500
- ListCache.prototype.has = listCacheHas;
501
- ListCache.prototype.set = listCacheSet;
502
-
503
- /**
504
- * Creates a map cache object to store key-value pairs.
505
- *
506
- * @private
507
- * @constructor
508
- * @param {Array} [entries] The key-value pairs to cache.
509
- */
510
- function MapCache(entries) {
511
- var index = -1,
512
- length = entries ? entries.length : 0;
513
-
514
- this.clear();
515
- while (++index < length) {
516
- var entry = entries[index];
517
- this.set(entry[0], entry[1]);
518
- }
519
- }
520
-
521
- /**
522
- * Removes all key-value entries from the map.
523
- *
524
- * @private
525
- * @name clear
526
- * @memberOf MapCache
527
- */
528
- function mapCacheClear() {
529
- this.__data__ = {
530
- 'hash': new Hash,
531
- 'map': new (Map || ListCache),
532
- 'string': new Hash
533
- };
534
- }
535
-
536
- /**
537
- * Removes `key` and its value from the map.
538
- *
539
- * @private
540
- * @name delete
541
- * @memberOf MapCache
542
- * @param {string} key The key of the value to remove.
543
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
544
- */
545
- function mapCacheDelete(key) {
546
- return getMapData(this, key)['delete'](key);
547
- }
548
-
549
- /**
550
- * Gets the map value for `key`.
551
- *
552
- * @private
553
- * @name get
554
- * @memberOf MapCache
555
- * @param {string} key The key of the value to get.
556
- * @returns {*} Returns the entry value.
557
- */
558
- function mapCacheGet(key) {
559
- return getMapData(this, key).get(key);
560
- }
561
-
562
- /**
563
- * Checks if a map value for `key` exists.
564
- *
565
- * @private
566
- * @name has
567
- * @memberOf MapCache
568
- * @param {string} key The key of the entry to check.
569
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
570
- */
571
- function mapCacheHas(key) {
572
- return getMapData(this, key).has(key);
573
- }
574
-
575
- /**
576
- * Sets the map `key` to `value`.
577
- *
578
- * @private
579
- * @name set
580
- * @memberOf MapCache
581
- * @param {string} key The key of the value to set.
582
- * @param {*} value The value to set.
583
- * @returns {Object} Returns the map cache instance.
584
- */
585
- function mapCacheSet(key, value) {
586
- getMapData(this, key).set(key, value);
587
- return this;
588
- }
589
-
590
- // Add methods to `MapCache`.
591
- MapCache.prototype.clear = mapCacheClear;
592
- MapCache.prototype['delete'] = mapCacheDelete;
593
- MapCache.prototype.get = mapCacheGet;
594
- MapCache.prototype.has = mapCacheHas;
595
- MapCache.prototype.set = mapCacheSet;
596
-
597
- /**
598
- *
599
- * Creates an array cache object to store unique values.
600
- *
601
- * @private
602
- * @constructor
603
- * @param {Array} [values] The values to cache.
604
- */
605
- function SetCache(values) {
606
- var index = -1,
607
- length = values ? values.length : 0;
608
-
609
- this.__data__ = new MapCache;
610
- while (++index < length) {
611
- this.add(values[index]);
612
- }
613
- }
614
-
615
- /**
616
- * Adds `value` to the array cache.
617
- *
618
- * @private
619
- * @name add
620
- * @memberOf SetCache
621
- * @alias push
622
- * @param {*} value The value to cache.
623
- * @returns {Object} Returns the cache instance.
624
- */
625
- function setCacheAdd(value) {
626
- this.__data__.set(value, HASH_UNDEFINED);
627
- return this;
628
- }
629
-
630
- /**
631
- * Checks if `value` is in the array cache.
632
- *
633
- * @private
634
- * @name has
635
- * @memberOf SetCache
636
- * @param {*} value The value to search for.
637
- * @returns {number} Returns `true` if `value` is found, else `false`.
638
- */
639
- function setCacheHas(value) {
640
- return this.__data__.has(value);
641
- }
642
-
643
- // Add methods to `SetCache`.
644
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
645
- SetCache.prototype.has = setCacheHas;
646
-
647
- /**
648
- * Gets the index at which the `key` is found in `array` of key-value pairs.
649
- *
650
- * @private
651
- * @param {Array} array The array to inspect.
652
- * @param {*} key The key to search for.
653
- * @returns {number} Returns the index of the matched value, else `-1`.
654
- */
655
- function assocIndexOf(array, key) {
656
- var length = array.length;
657
- while (length--) {
658
- if (eq(array[length][0], key)) {
659
- return length;
660
- }
661
- }
662
- return -1;
663
- }
664
-
665
- /**
666
- * The base implementation of methods like `_.intersection`, without support
667
- * for iteratee shorthands, that accepts an array of arrays to inspect.
668
- *
669
- * @private
670
- * @param {Array} arrays The arrays to inspect.
671
- * @param {Function} [iteratee] The iteratee invoked per element.
672
- * @param {Function} [comparator] The comparator invoked per element.
673
- * @returns {Array} Returns the new array of shared values.
674
- */
675
- function baseIntersection(arrays, iteratee, comparator) {
676
- var includes = comparator ? arrayIncludesWith : arrayIncludes,
677
- length = arrays[0].length,
678
- othLength = arrays.length,
679
- othIndex = othLength,
680
- caches = Array(othLength),
681
- maxLength = Infinity,
682
- result = [];
683
-
684
- while (othIndex--) {
685
- var array = arrays[othIndex];
686
- if (othIndex && iteratee) {
687
- array = arrayMap$1(array, baseUnary$1(iteratee));
688
- }
689
- maxLength = nativeMin(array.length, maxLength);
690
- caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
691
- ? new SetCache(othIndex && array)
692
- : undefined;
693
- }
694
- array = arrays[0];
695
-
696
- var index = -1,
697
- seen = caches[0];
698
-
699
- outer:
700
- while (++index < length && result.length < maxLength) {
701
- var value = array[index],
702
- computed = iteratee ? iteratee(value) : value;
703
-
704
- value = (comparator || value !== 0) ? value : 0;
705
- if (!(seen
706
- ? cacheHas(seen, computed)
707
- : includes(result, computed, comparator)
708
- )) {
709
- othIndex = othLength;
710
- while (--othIndex) {
711
- var cache = caches[othIndex];
712
- if (!(cache
713
- ? cacheHas(cache, computed)
714
- : includes(arrays[othIndex], computed, comparator))
715
- ) {
716
- continue outer;
717
- }
718
- }
719
- if (seen) {
720
- seen.push(computed);
721
- }
722
- result.push(value);
723
- }
724
- }
725
- return result;
726
- }
727
-
728
- /**
729
- * The base implementation of `_.isNative` without bad shim checks.
730
- *
731
- * @private
732
- * @param {*} value The value to check.
733
- * @returns {boolean} Returns `true` if `value` is a native function,
734
- * else `false`.
735
- */
736
- function baseIsNative(value) {
737
- if (!isObject(value) || isMasked(value)) {
738
- return false;
739
- }
740
- var pattern = (isFunction(value) || isHostObject$1(value)) ? reIsNative : reIsHostCtor;
741
- return pattern.test(toSource(value));
742
- }
743
-
744
- /**
745
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
746
- *
747
- * @private
748
- * @param {Function} func The function to apply a rest parameter to.
749
- * @param {number} [start=func.length-1] The start position of the rest parameter.
750
- * @returns {Function} Returns the new function.
751
- */
752
- function baseRest$1(func, start) {
753
- start = nativeMax$1(start === undefined ? (func.length - 1) : start, 0);
754
- return function() {
755
- var args = arguments,
756
- index = -1,
757
- length = nativeMax$1(args.length - start, 0),
758
- array = Array(length);
759
-
760
- while (++index < length) {
761
- array[index] = args[start + index];
762
- }
763
- index = -1;
764
- var otherArgs = Array(start + 1);
765
- while (++index < start) {
766
- otherArgs[index] = args[index];
767
- }
768
- otherArgs[start] = array;
769
- return apply$1(func, this, otherArgs);
770
- };
771
- }
772
-
773
- /**
774
- * Casts `value` to an empty array if it's not an array like object.
775
- *
776
- * @private
777
- * @param {*} value The value to inspect.
778
- * @returns {Array|Object} Returns the cast array-like object.
779
- */
780
- function castArrayLikeObject(value) {
781
- return isArrayLikeObject(value) ? value : [];
782
- }
783
-
784
- /**
785
- * Gets the data for `map`.
786
- *
787
- * @private
788
- * @param {Object} map The map to query.
789
- * @param {string} key The reference key.
790
- * @returns {*} Returns the map data.
791
- */
792
- function getMapData(map, key) {
793
- var data = map.__data__;
794
- return isKeyable(key)
795
- ? data[typeof key == 'string' ? 'string' : 'hash']
796
- : data.map;
797
- }
798
-
799
- /**
800
- * Gets the native function at `key` of `object`.
801
- *
802
- * @private
803
- * @param {Object} object The object to query.
804
- * @param {string} key The key of the method to get.
805
- * @returns {*} Returns the function if it's native, else `undefined`.
806
- */
807
- function getNative(object, key) {
808
- var value = getValue(object, key);
809
- return baseIsNative(value) ? value : undefined;
810
- }
811
-
812
- /**
813
- * Checks if `value` is suitable for use as unique object key.
814
- *
815
- * @private
816
- * @param {*} value The value to check.
817
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
818
- */
819
- function isKeyable(value) {
820
- var type = typeof value;
821
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
822
- ? (value !== '__proto__')
823
- : (value === null);
824
- }
825
-
826
- /**
827
- * Checks if `func` has its source masked.
828
- *
829
- * @private
830
- * @param {Function} func The function to check.
831
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
832
- */
833
- function isMasked(func) {
834
- return !!maskSrcKey && (maskSrcKey in func);
835
- }
836
-
837
- /**
838
- * Converts `func` to its source code.
839
- *
840
- * @private
841
- * @param {Function} func The function to process.
842
- * @returns {string} Returns the source code.
843
- */
844
- function toSource(func) {
845
- if (func != null) {
846
- try {
847
- return funcToString$1.call(func);
848
- } catch (e) {}
849
- try {
850
- return (func + '');
851
- } catch (e) {}
852
- }
853
- return '';
854
- }
855
-
856
- /**
857
- * Creates an array of unique values that are included in all given arrays
858
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
859
- * for equality comparisons. The order of result values is determined by the
860
- * order they occur in the first array.
861
- *
862
- * @static
863
- * @memberOf _
864
- * @since 0.1.0
865
- * @category Array
866
- * @param {...Array} [arrays] The arrays to inspect.
867
- * @returns {Array} Returns the new array of intersecting values.
868
- * @example
869
- *
870
- * _.intersection([2, 1], [2, 3]);
871
- * // => [2]
872
- */
873
- var intersection = baseRest$1(function(arrays) {
874
- var mapped = arrayMap$1(arrays, castArrayLikeObject);
875
- return (mapped.length && mapped[0] === arrays[0])
876
- ? baseIntersection(mapped)
877
- : [];
878
- });
879
-
880
- /**
881
- * Performs a
882
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
883
- * comparison between two values to determine if they are equivalent.
884
- *
885
- * @static
886
- * @memberOf _
887
- * @since 4.0.0
888
- * @category Lang
889
- * @param {*} value The value to compare.
890
- * @param {*} other The other value to compare.
891
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
892
- * @example
893
- *
894
- * var object = { 'a': 1 };
895
- * var other = { 'a': 1 };
896
- *
897
- * _.eq(object, object);
898
- * // => true
899
- *
900
- * _.eq(object, other);
901
- * // => false
902
- *
903
- * _.eq('a', 'a');
904
- * // => true
905
- *
906
- * _.eq('a', Object('a'));
907
- * // => false
908
- *
909
- * _.eq(NaN, NaN);
910
- * // => true
911
- */
912
- function eq(value, other) {
913
- return value === other || (value !== value && other !== other);
914
- }
915
-
916
- /**
917
- * Checks if `value` is array-like. A value is considered array-like if it's
918
- * not a function and has a `value.length` that's an integer greater than or
919
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
920
- *
921
- * @static
922
- * @memberOf _
923
- * @since 4.0.0
924
- * @category Lang
925
- * @param {*} value The value to check.
926
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
927
- * @example
928
- *
929
- * _.isArrayLike([1, 2, 3]);
930
- * // => true
931
- *
932
- * _.isArrayLike(document.body.children);
933
- * // => true
934
- *
935
- * _.isArrayLike('abc');
936
- * // => true
937
- *
938
- * _.isArrayLike(_.noop);
939
- * // => false
940
- */
941
- function isArrayLike(value) {
942
- return value != null && isLength(value.length) && !isFunction(value);
943
- }
944
-
945
- /**
946
- * This method is like `_.isArrayLike` except that it also checks if `value`
947
- * is an object.
948
- *
949
- * @static
950
- * @memberOf _
951
- * @since 4.0.0
952
- * @category Lang
953
- * @param {*} value The value to check.
954
- * @returns {boolean} Returns `true` if `value` is an array-like object,
955
- * else `false`.
956
- * @example
957
- *
958
- * _.isArrayLikeObject([1, 2, 3]);
959
- * // => true
960
- *
961
- * _.isArrayLikeObject(document.body.children);
962
- * // => true
963
- *
964
- * _.isArrayLikeObject('abc');
965
- * // => false
966
- *
967
- * _.isArrayLikeObject(_.noop);
968
- * // => false
969
- */
970
- function isArrayLikeObject(value) {
971
- return isObjectLike$1(value) && isArrayLike(value);
972
- }
973
-
974
- /**
975
- * Checks if `value` is classified as a `Function` object.
976
- *
977
- * @static
978
- * @memberOf _
979
- * @since 0.1.0
980
- * @category Lang
981
- * @param {*} value The value to check.
982
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
983
- * @example
984
- *
985
- * _.isFunction(_);
986
- * // => true
987
- *
988
- * _.isFunction(/abc/);
989
- * // => false
990
- */
991
- function isFunction(value) {
992
- // The use of `Object#toString` avoids issues with the `typeof` operator
993
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
994
- var tag = isObject(value) ? objectToString$1.call(value) : '';
995
- return tag == funcTag || tag == genTag;
996
- }
997
-
998
- /**
999
- * Checks if `value` is a valid array-like length.
1000
- *
1001
- * **Note:** This method is loosely based on
1002
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1003
- *
1004
- * @static
1005
- * @memberOf _
1006
- * @since 4.0.0
1007
- * @category Lang
1008
- * @param {*} value The value to check.
1009
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1010
- * @example
1011
- *
1012
- * _.isLength(3);
1013
- * // => true
1014
- *
1015
- * _.isLength(Number.MIN_VALUE);
1016
- * // => false
1017
- *
1018
- * _.isLength(Infinity);
1019
- * // => false
1020
- *
1021
- * _.isLength('3');
1022
- * // => false
1023
- */
1024
- function isLength(value) {
1025
- return typeof value == 'number' &&
1026
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1027
- }
1028
-
1029
- /**
1030
- * Checks if `value` is the
1031
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1032
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1033
- *
1034
- * @static
1035
- * @memberOf _
1036
- * @since 0.1.0
1037
- * @category Lang
1038
- * @param {*} value The value to check.
1039
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1040
- * @example
1041
- *
1042
- * _.isObject({});
1043
- * // => true
1044
- *
1045
- * _.isObject([1, 2, 3]);
1046
- * // => true
1047
- *
1048
- * _.isObject(_.noop);
1049
- * // => true
1050
- *
1051
- * _.isObject(null);
1052
- * // => false
1053
- */
1054
- function isObject(value) {
1055
- var type = typeof value;
1056
- return !!value && (type == 'object' || type == 'function');
1057
- }
1058
-
1059
- /**
1060
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1061
- * and has a `typeof` result of "object".
1062
- *
1063
- * @static
1064
- * @memberOf _
1065
- * @since 4.0.0
1066
- * @category Lang
1067
- * @param {*} value The value to check.
1068
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1069
- * @example
1070
- *
1071
- * _.isObjectLike({});
1072
- * // => true
1073
- *
1074
- * _.isObjectLike([1, 2, 3]);
1075
- * // => true
1076
- *
1077
- * _.isObjectLike(_.noop);
1078
- * // => false
1079
- *
1080
- * _.isObjectLike(null);
1081
- * // => false
1082
- */
1083
- function isObjectLike$1(value) {
1084
- return !!value && typeof value == 'object';
1085
- }
1086
-
1087
- var lodash_intersection = intersection;
1088
-
1089
- /**
1090
- * lodash (Custom Build) <https://lodash.com/>
1091
- * Build: `lodash modularize exports="npm" -o ./`
1092
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
1093
- * Released under MIT license <https://lodash.com/license>
1094
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1095
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1096
- */
1097
- /**
1098
- * A faster alternative to `Function#apply`, this function invokes `func`
1099
- * with the `this` binding of `thisArg` and the arguments of `args`.
1100
- *
1101
- * @private
1102
- * @param {Function} func The function to invoke.
1103
- * @param {*} thisArg The `this` binding of `func`.
1104
- * @param {Array} args The arguments to invoke `func` with.
1105
- * @returns {*} Returns the result of `func`.
1106
- */
1107
- function apply(func, thisArg, args) {
1108
- switch (args.length) {
1109
- case 0: return func.call(thisArg);
1110
- case 1: return func.call(thisArg, args[0]);
1111
- case 2: return func.call(thisArg, args[0], args[1]);
1112
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
1113
- }
1114
- return func.apply(thisArg, args);
1115
- }
1116
-
1117
- /**
1118
- * A specialized version of `_.map` for arrays without support for iteratee
1119
- * shorthands.
1120
- *
1121
- * @private
1122
- * @param {Array} [array] The array to iterate over.
1123
- * @param {Function} iteratee The function invoked per iteration.
1124
- * @returns {Array} Returns the new mapped array.
1125
- */
1126
- function arrayMap(array, iteratee) {
1127
- var index = -1,
1128
- length = array ? array.length : 0,
1129
- result = Array(length);
1130
-
1131
- while (++index < length) {
1132
- result[index] = iteratee(array[index], index, array);
1133
- }
1134
- return result;
1135
- }
1136
-
1137
- /**
1138
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
1139
- * support for iteratee shorthands.
1140
- *
1141
- * @private
1142
- * @param {Array} array The array to search.
1143
- * @param {Function} predicate The function invoked per iteration.
1144
- * @param {number} fromIndex The index to search from.
1145
- * @param {boolean} [fromRight] Specify iterating from right to left.
1146
- * @returns {number} Returns the index of the matched value, else `-1`.
1147
- */
1148
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
1149
- var length = array.length,
1150
- index = fromIndex + (fromRight ? 1 : -1);
1151
-
1152
- while ((fromRight ? index-- : ++index < length)) {
1153
- if (predicate(array[index], index, array)) {
1154
- return index;
1155
- }
1156
- }
1157
- return -1;
1158
- }
1159
-
1160
- /**
1161
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
1162
- *
1163
- * @private
1164
- * @param {Array} array The array to search.
1165
- * @param {*} value The value to search for.
1166
- * @param {number} fromIndex The index to search from.
1167
- * @returns {number} Returns the index of the matched value, else `-1`.
1168
- */
1169
- function baseIndexOf(array, value, fromIndex) {
1170
- if (value !== value) {
1171
- return baseFindIndex(array, baseIsNaN, fromIndex);
1172
- }
1173
- var index = fromIndex - 1,
1174
- length = array.length;
1175
-
1176
- while (++index < length) {
1177
- if (array[index] === value) {
1178
- return index;
1179
- }
1180
- }
1181
- return -1;
1182
- }
1183
-
1184
- /**
1185
- * This function is like `baseIndexOf` except that it accepts a comparator.
1186
- *
1187
- * @private
1188
- * @param {Array} array The array to search.
1189
- * @param {*} value The value to search for.
1190
- * @param {number} fromIndex The index to search from.
1191
- * @param {Function} comparator The comparator invoked per element.
1192
- * @returns {number} Returns the index of the matched value, else `-1`.
1193
- */
1194
- function baseIndexOfWith(array, value, fromIndex, comparator) {
1195
- var index = fromIndex - 1,
1196
- length = array.length;
1197
-
1198
- while (++index < length) {
1199
- if (comparator(array[index], value)) {
1200
- return index;
1201
- }
1202
- }
1203
- return -1;
1204
- }
1205
-
1206
- /**
1207
- * The base implementation of `_.isNaN` without support for number objects.
1208
- *
1209
- * @private
1210
- * @param {*} value The value to check.
1211
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1212
- */
1213
- function baseIsNaN(value) {
1214
- return value !== value;
1215
- }
1216
-
1217
- /**
1218
- * The base implementation of `_.unary` without support for storing metadata.
1219
- *
1220
- * @private
1221
- * @param {Function} func The function to cap arguments for.
1222
- * @returns {Function} Returns the new capped function.
1223
- */
1224
- function baseUnary(func) {
1225
- return function(value) {
1226
- return func(value);
1227
- };
1228
- }
1229
-
1230
- /** Used for built-in method references. */
1231
- var arrayProto = Array.prototype;
1232
-
1233
- /** Built-in value references. */
1234
- var splice = arrayProto.splice;
1235
-
1236
- /* Built-in method references for those with the same name as other `lodash` methods. */
1237
- var nativeMax = Math.max;
1238
-
1239
- /**
1240
- * The base implementation of `_.pullAllBy` without support for iteratee
1241
- * shorthands.
1242
- *
1243
- * @private
1244
- * @param {Array} array The array to modify.
1245
- * @param {Array} values The values to remove.
1246
- * @param {Function} [iteratee] The iteratee invoked per element.
1247
- * @param {Function} [comparator] The comparator invoked per element.
1248
- * @returns {Array} Returns `array`.
1249
- */
1250
- function basePullAll(array, values, iteratee, comparator) {
1251
- var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
1252
- index = -1,
1253
- length = values.length,
1254
- seen = array;
1255
-
1256
- if (array === values) {
1257
- values = copyArray(values);
1258
- }
1259
- if (iteratee) {
1260
- seen = arrayMap(array, baseUnary(iteratee));
1261
- }
1262
- while (++index < length) {
1263
- var fromIndex = 0,
1264
- value = values[index],
1265
- computed = iteratee ? iteratee(value) : value;
1266
-
1267
- while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
1268
- if (seen !== array) {
1269
- splice.call(seen, fromIndex, 1);
1270
- }
1271
- splice.call(array, fromIndex, 1);
1272
- }
1273
- }
1274
- return array;
1275
- }
1276
-
1277
- /**
1278
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
1279
- *
1280
- * @private
1281
- * @param {Function} func The function to apply a rest parameter to.
1282
- * @param {number} [start=func.length-1] The start position of the rest parameter.
1283
- * @returns {Function} Returns the new function.
1284
- */
1285
- function baseRest(func, start) {
1286
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
1287
- return function() {
1288
- var args = arguments,
1289
- index = -1,
1290
- length = nativeMax(args.length - start, 0),
1291
- array = Array(length);
1292
-
1293
- while (++index < length) {
1294
- array[index] = args[start + index];
1295
- }
1296
- index = -1;
1297
- var otherArgs = Array(start + 1);
1298
- while (++index < start) {
1299
- otherArgs[index] = args[index];
1300
- }
1301
- otherArgs[start] = array;
1302
- return apply(func, this, otherArgs);
1303
- };
1304
- }
1305
-
1306
- /**
1307
- * Copies the values of `source` to `array`.
1308
- *
1309
- * @private
1310
- * @param {Array} source The array to copy values from.
1311
- * @param {Array} [array=[]] The array to copy values to.
1312
- * @returns {Array} Returns `array`.
1313
- */
1314
- function copyArray(source, array) {
1315
- var index = -1,
1316
- length = source.length;
1317
-
1318
- array || (array = Array(length));
1319
- while (++index < length) {
1320
- array[index] = source[index];
1321
- }
1322
- return array;
1323
- }
1324
-
1325
- /**
1326
- * Removes all given values from `array` using
1327
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1328
- * for equality comparisons.
1329
- *
1330
- * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
1331
- * to remove elements from an array by predicate.
1332
- *
1333
- * @static
1334
- * @memberOf _
1335
- * @since 2.0.0
1336
- * @category Array
1337
- * @param {Array} array The array to modify.
1338
- * @param {...*} [values] The values to remove.
1339
- * @returns {Array} Returns `array`.
1340
- * @example
1341
- *
1342
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
1343
- *
1344
- * _.pull(array, 'a', 'c');
1345
- * console.log(array);
1346
- * // => ['b', 'b']
1347
- */
1348
- var pull = baseRest(pullAll);
1349
-
1350
- /**
1351
- * This method is like `_.pull` except that it accepts an array of values to remove.
1352
- *
1353
- * **Note:** Unlike `_.difference`, this method mutates `array`.
1354
- *
1355
- * @static
1356
- * @memberOf _
1357
- * @since 4.0.0
1358
- * @category Array
1359
- * @param {Array} array The array to modify.
1360
- * @param {Array} values The values to remove.
1361
- * @returns {Array} Returns `array`.
1362
- * @example
1363
- *
1364
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
1365
- *
1366
- * _.pullAll(array, ['a', 'c']);
1367
- * console.log(array);
1368
- * // => ['b', 'b']
1369
- */
1370
- function pullAll(array, values) {
1371
- return (array && array.length && values && values.length)
1372
- ? basePullAll(array, values)
1373
- : array;
1374
- }
1375
-
1376
- var lodash_pull = pull;
1377
-
1378
- /**
1379
- * lodash (Custom Build) <https://lodash.com/>
1380
- * Build: `lodash modularize exports="npm" -o ./`
1381
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
1382
- * Released under MIT license <https://lodash.com/license>
1383
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1384
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1385
- */
1386
- /** `Object#toString` result references. */
1387
- var objectTag = '[object Object]';
1388
-
1389
- /**
1390
- * Checks if `value` is a host object in IE < 9.
1391
- *
1392
- * @private
1393
- * @param {*} value The value to check.
1394
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
1395
- */
1396
- function isHostObject(value) {
1397
- // Many host objects are `Object` objects that can coerce to strings
1398
- // despite having improperly defined `toString` methods.
1399
- var result = false;
1400
- if (value != null && typeof value.toString != 'function') {
1401
- try {
1402
- result = !!(value + '');
1403
- } catch (e) {}
1404
- }
1405
- return result;
1406
- }
1407
-
1408
- /**
1409
- * Creates a unary function that invokes `func` with its argument transformed.
1410
- *
1411
- * @private
1412
- * @param {Function} func The function to wrap.
1413
- * @param {Function} transform The argument transform.
1414
- * @returns {Function} Returns the new function.
1415
- */
1416
- function overArg(func, transform) {
1417
- return function(arg) {
1418
- return func(transform(arg));
1419
- };
1420
- }
1421
-
1422
- /** Used for built-in method references. */
1423
- var funcProto = Function.prototype,
1424
- objectProto = Object.prototype;
1425
-
1426
- /** Used to resolve the decompiled source of functions. */
1427
- var funcToString = funcProto.toString;
1428
-
1429
- /** Used to check objects for own properties. */
1430
- var hasOwnProperty = objectProto.hasOwnProperty;
1431
-
1432
- /** Used to infer the `Object` constructor. */
1433
- var objectCtorString = funcToString.call(Object);
1434
-
1435
- /**
1436
- * Used to resolve the
1437
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1438
- * of values.
1439
- */
1440
- var objectToString = objectProto.toString;
1441
-
1442
- /** Built-in value references. */
1443
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1444
-
1445
- /**
1446
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1447
- * and has a `typeof` result of "object".
1448
- *
1449
- * @static
1450
- * @memberOf _
1451
- * @since 4.0.0
1452
- * @category Lang
1453
- * @param {*} value The value to check.
1454
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1455
- * @example
1456
- *
1457
- * _.isObjectLike({});
1458
- * // => true
1459
- *
1460
- * _.isObjectLike([1, 2, 3]);
1461
- * // => true
1462
- *
1463
- * _.isObjectLike(_.noop);
1464
- * // => false
1465
- *
1466
- * _.isObjectLike(null);
1467
- * // => false
1468
- */
1469
- function isObjectLike(value) {
1470
- return !!value && typeof value == 'object';
1471
- }
1472
-
1473
- /**
1474
- * Checks if `value` is a plain object, that is, an object created by the
1475
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
1476
- *
1477
- * @static
1478
- * @memberOf _
1479
- * @since 0.8.0
1480
- * @category Lang
1481
- * @param {*} value The value to check.
1482
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
1483
- * @example
1484
- *
1485
- * function Foo() {
1486
- * this.a = 1;
1487
- * }
1488
- *
1489
- * _.isPlainObject(new Foo);
1490
- * // => false
1491
- *
1492
- * _.isPlainObject([1, 2, 3]);
1493
- * // => false
1494
- *
1495
- * _.isPlainObject({ 'x': 0, 'y': 0 });
1496
- * // => true
1497
- *
1498
- * _.isPlainObject(Object.create(null));
1499
- * // => true
1500
- */
1501
- function isPlainObject(value) {
1502
- if (!isObjectLike(value) ||
1503
- objectToString.call(value) != objectTag || isHostObject(value)) {
1504
- return false;
1505
- }
1506
- var proto = getPrototype(value);
1507
- if (proto === null) {
1508
- return true;
1509
- }
1510
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
1511
- return (typeof Ctor == 'function' &&
1512
- Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
1513
- }
1514
-
1515
- var lodash_isplainobject = isPlainObject;
1516
-
1517
- /**
1518
- * lodash (Custom Build) <https://lodash.com/>
1519
- * Build: `lodash modularize exports="npm" -o ./`
1520
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
1521
- * Released under MIT license <https://lodash.com/license>
1522
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1523
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1524
- */
1525
-
1526
- var lodash_clonedeep = createCommonjsModule(function (module, exports) {
1527
- /** Used as the size to enable large array optimizations. */
1528
- var LARGE_ARRAY_SIZE = 200;
1529
-
1530
- /** Used to stand-in for `undefined` hash values. */
1531
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1532
-
1533
- /** Used as references for various `Number` constants. */
1534
- var MAX_SAFE_INTEGER = 9007199254740991;
1535
-
1536
- /** `Object#toString` result references. */
1537
- var argsTag = '[object Arguments]',
1538
- arrayTag = '[object Array]',
1539
- boolTag = '[object Boolean]',
1540
- dateTag = '[object Date]',
1541
- errorTag = '[object Error]',
1542
- funcTag = '[object Function]',
1543
- genTag = '[object GeneratorFunction]',
1544
- mapTag = '[object Map]',
1545
- numberTag = '[object Number]',
1546
- objectTag = '[object Object]',
1547
- promiseTag = '[object Promise]',
1548
- regexpTag = '[object RegExp]',
1549
- setTag = '[object Set]',
1550
- stringTag = '[object String]',
1551
- symbolTag = '[object Symbol]',
1552
- weakMapTag = '[object WeakMap]';
1553
-
1554
- var arrayBufferTag = '[object ArrayBuffer]',
1555
- dataViewTag = '[object DataView]',
1556
- float32Tag = '[object Float32Array]',
1557
- float64Tag = '[object Float64Array]',
1558
- int8Tag = '[object Int8Array]',
1559
- int16Tag = '[object Int16Array]',
1560
- int32Tag = '[object Int32Array]',
1561
- uint8Tag = '[object Uint8Array]',
1562
- uint8ClampedTag = '[object Uint8ClampedArray]',
1563
- uint16Tag = '[object Uint16Array]',
1564
- uint32Tag = '[object Uint32Array]';
1565
-
1566
- /**
1567
- * Used to match `RegExp`
1568
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1569
- */
1570
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1571
-
1572
- /** Used to match `RegExp` flags from their coerced string values. */
1573
- var reFlags = /\w*$/;
1574
-
1575
- /** Used to detect host constructors (Safari). */
1576
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
1577
-
1578
- /** Used to detect unsigned integer values. */
1579
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1580
-
1581
- /** Used to identify `toStringTag` values supported by `_.clone`. */
1582
- var cloneableTags = {};
1583
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
1584
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
1585
- cloneableTags[boolTag] = cloneableTags[dateTag] =
1586
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
1587
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
1588
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
1589
- cloneableTags[numberTag] = cloneableTags[objectTag] =
1590
- cloneableTags[regexpTag] = cloneableTags[setTag] =
1591
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
1592
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
1593
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1594
- cloneableTags[errorTag] = cloneableTags[funcTag] =
1595
- cloneableTags[weakMapTag] = false;
1596
-
1597
- /** Detect free variable `global` from Node.js. */
1598
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1599
-
1600
- /** Detect free variable `self`. */
1601
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
1602
-
1603
- /** Used as a reference to the global object. */
1604
- var root = freeGlobal || freeSelf || Function('return this')();
1605
-
1606
- /** Detect free variable `exports`. */
1607
- var freeExports = exports && !exports.nodeType && exports;
1608
-
1609
- /** Detect free variable `module`. */
1610
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1611
-
1612
- /** Detect the popular CommonJS extension `module.exports`. */
1613
- var moduleExports = freeModule && freeModule.exports === freeExports;
1614
-
1615
- /**
1616
- * Adds the key-value `pair` to `map`.
1617
- *
1618
- * @private
1619
- * @param {Object} map The map to modify.
1620
- * @param {Array} pair The key-value pair to add.
1621
- * @returns {Object} Returns `map`.
1622
- */
1623
- function addMapEntry(map, pair) {
1624
- // Don't return `map.set` because it's not chainable in IE 11.
1625
- map.set(pair[0], pair[1]);
1626
- return map;
1627
- }
1628
-
1629
- /**
1630
- * Adds `value` to `set`.
1631
- *
1632
- * @private
1633
- * @param {Object} set The set to modify.
1634
- * @param {*} value The value to add.
1635
- * @returns {Object} Returns `set`.
1636
- */
1637
- function addSetEntry(set, value) {
1638
- // Don't return `set.add` because it's not chainable in IE 11.
1639
- set.add(value);
1640
- return set;
1641
- }
1642
-
1643
- /**
1644
- * A specialized version of `_.forEach` for arrays without support for
1645
- * iteratee shorthands.
1646
- *
1647
- * @private
1648
- * @param {Array} [array] The array to iterate over.
1649
- * @param {Function} iteratee The function invoked per iteration.
1650
- * @returns {Array} Returns `array`.
1651
- */
1652
- function arrayEach(array, iteratee) {
1653
- var index = -1,
1654
- length = array ? array.length : 0;
1655
-
1656
- while (++index < length) {
1657
- if (iteratee(array[index], index, array) === false) {
1658
- break;
1659
- }
1660
- }
1661
- return array;
1662
- }
1663
-
1664
- /**
1665
- * Appends the elements of `values` to `array`.
1666
- *
1667
- * @private
1668
- * @param {Array} array The array to modify.
1669
- * @param {Array} values The values to append.
1670
- * @returns {Array} Returns `array`.
1671
- */
1672
- function arrayPush(array, values) {
1673
- var index = -1,
1674
- length = values.length,
1675
- offset = array.length;
1676
-
1677
- while (++index < length) {
1678
- array[offset + index] = values[index];
1679
- }
1680
- return array;
1681
- }
1682
-
1683
- /**
1684
- * A specialized version of `_.reduce` for arrays without support for
1685
- * iteratee shorthands.
1686
- *
1687
- * @private
1688
- * @param {Array} [array] The array to iterate over.
1689
- * @param {Function} iteratee The function invoked per iteration.
1690
- * @param {*} [accumulator] The initial value.
1691
- * @param {boolean} [initAccum] Specify using the first element of `array` as
1692
- * the initial value.
1693
- * @returns {*} Returns the accumulated value.
1694
- */
1695
- function arrayReduce(array, iteratee, accumulator, initAccum) {
1696
- var index = -1,
1697
- length = array ? array.length : 0;
1698
-
1699
- if (initAccum && length) {
1700
- accumulator = array[++index];
1701
- }
1702
- while (++index < length) {
1703
- accumulator = iteratee(accumulator, array[index], index, array);
1704
- }
1705
- return accumulator;
1706
- }
1707
-
1708
- /**
1709
- * The base implementation of `_.times` without support for iteratee shorthands
1710
- * or max array length checks.
1711
- *
1712
- * @private
1713
- * @param {number} n The number of times to invoke `iteratee`.
1714
- * @param {Function} iteratee The function invoked per iteration.
1715
- * @returns {Array} Returns the array of results.
1716
- */
1717
- function baseTimes(n, iteratee) {
1718
- var index = -1,
1719
- result = Array(n);
1720
-
1721
- while (++index < n) {
1722
- result[index] = iteratee(index);
1723
- }
1724
- return result;
1725
- }
1726
-
1727
- /**
1728
- * Gets the value at `key` of `object`.
1729
- *
1730
- * @private
1731
- * @param {Object} [object] The object to query.
1732
- * @param {string} key The key of the property to get.
1733
- * @returns {*} Returns the property value.
1734
- */
1735
- function getValue(object, key) {
1736
- return object == null ? undefined : object[key];
1737
- }
1738
-
1739
- /**
1740
- * Checks if `value` is a host object in IE < 9.
1741
- *
1742
- * @private
1743
- * @param {*} value The value to check.
1744
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
1745
- */
1746
- function isHostObject(value) {
1747
- // Many host objects are `Object` objects that can coerce to strings
1748
- // despite having improperly defined `toString` methods.
1749
- var result = false;
1750
- if (value != null && typeof value.toString != 'function') {
1751
- try {
1752
- result = !!(value + '');
1753
- } catch (e) {}
1754
- }
1755
- return result;
1756
- }
1757
-
1758
- /**
1759
- * Converts `map` to its key-value pairs.
1760
- *
1761
- * @private
1762
- * @param {Object} map The map to convert.
1763
- * @returns {Array} Returns the key-value pairs.
1764
- */
1765
- function mapToArray(map) {
1766
- var index = -1,
1767
- result = Array(map.size);
1768
-
1769
- map.forEach(function(value, key) {
1770
- result[++index] = [key, value];
1771
- });
1772
- return result;
1773
- }
1774
-
1775
- /**
1776
- * Creates a unary function that invokes `func` with its argument transformed.
1777
- *
1778
- * @private
1779
- * @param {Function} func The function to wrap.
1780
- * @param {Function} transform The argument transform.
1781
- * @returns {Function} Returns the new function.
1782
- */
1783
- function overArg(func, transform) {
1784
- return function(arg) {
1785
- return func(transform(arg));
1786
- };
1787
- }
1788
-
1789
- /**
1790
- * Converts `set` to an array of its values.
1791
- *
1792
- * @private
1793
- * @param {Object} set The set to convert.
1794
- * @returns {Array} Returns the values.
1795
- */
1796
- function setToArray(set) {
1797
- var index = -1,
1798
- result = Array(set.size);
1799
-
1800
- set.forEach(function(value) {
1801
- result[++index] = value;
1802
- });
1803
- return result;
1804
- }
1805
-
1806
- /** Used for built-in method references. */
1807
- var arrayProto = Array.prototype,
1808
- funcProto = Function.prototype,
1809
- objectProto = Object.prototype;
1810
-
1811
- /** Used to detect overreaching core-js shims. */
1812
- var coreJsData = root['__core-js_shared__'];
1813
-
1814
- /** Used to detect methods masquerading as native. */
1815
- var maskSrcKey = (function() {
1816
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1817
- return uid ? ('Symbol(src)_1.' + uid) : '';
1818
- }());
1819
-
1820
- /** Used to resolve the decompiled source of functions. */
1821
- var funcToString = funcProto.toString;
1822
-
1823
- /** Used to check objects for own properties. */
1824
- var hasOwnProperty = objectProto.hasOwnProperty;
1825
-
1826
- /**
1827
- * Used to resolve the
1828
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1829
- * of values.
1830
- */
1831
- var objectToString = objectProto.toString;
1832
-
1833
- /** Used to detect if a method is native. */
1834
- var reIsNative = RegExp('^' +
1835
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
1836
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1837
- );
1838
-
1839
- /** Built-in value references. */
1840
- var Buffer = moduleExports ? root.Buffer : undefined,
1841
- Symbol = root.Symbol,
1842
- Uint8Array = root.Uint8Array,
1843
- getPrototype = overArg(Object.getPrototypeOf, Object),
1844
- objectCreate = Object.create,
1845
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
1846
- splice = arrayProto.splice;
1847
-
1848
- /* Built-in method references for those with the same name as other `lodash` methods. */
1849
- var nativeGetSymbols = Object.getOwnPropertySymbols,
1850
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
1851
- nativeKeys = overArg(Object.keys, Object);
1852
-
1853
- /* Built-in method references that are verified to be native. */
1854
- var DataView = getNative(root, 'DataView'),
1855
- Map = getNative(root, 'Map'),
1856
- Promise = getNative(root, 'Promise'),
1857
- Set = getNative(root, 'Set'),
1858
- WeakMap = getNative(root, 'WeakMap'),
1859
- nativeCreate = getNative(Object, 'create');
1860
-
1861
- /** Used to detect maps, sets, and weakmaps. */
1862
- var dataViewCtorString = toSource(DataView),
1863
- mapCtorString = toSource(Map),
1864
- promiseCtorString = toSource(Promise),
1865
- setCtorString = toSource(Set),
1866
- weakMapCtorString = toSource(WeakMap);
1867
-
1868
- /** Used to convert symbols to primitives and strings. */
1869
- var symbolProto = Symbol ? Symbol.prototype : undefined,
1870
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1871
-
1872
- /**
1873
- * Creates a hash object.
1874
- *
1875
- * @private
1876
- * @constructor
1877
- * @param {Array} [entries] The key-value pairs to cache.
1878
- */
1879
- function Hash(entries) {
1880
- var index = -1,
1881
- length = entries ? entries.length : 0;
1882
-
1883
- this.clear();
1884
- while (++index < length) {
1885
- var entry = entries[index];
1886
- this.set(entry[0], entry[1]);
1887
- }
1888
- }
1889
-
1890
- /**
1891
- * Removes all key-value entries from the hash.
1892
- *
1893
- * @private
1894
- * @name clear
1895
- * @memberOf Hash
1896
- */
1897
- function hashClear() {
1898
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
1899
- }
1900
-
1901
- /**
1902
- * Removes `key` and its value from the hash.
1903
- *
1904
- * @private
1905
- * @name delete
1906
- * @memberOf Hash
1907
- * @param {Object} hash The hash to modify.
1908
- * @param {string} key The key of the value to remove.
1909
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1910
- */
1911
- function hashDelete(key) {
1912
- return this.has(key) && delete this.__data__[key];
1913
- }
1914
-
1915
- /**
1916
- * Gets the hash value for `key`.
1917
- *
1918
- * @private
1919
- * @name get
1920
- * @memberOf Hash
1921
- * @param {string} key The key of the value to get.
1922
- * @returns {*} Returns the entry value.
1923
- */
1924
- function hashGet(key) {
1925
- var data = this.__data__;
1926
- if (nativeCreate) {
1927
- var result = data[key];
1928
- return result === HASH_UNDEFINED ? undefined : result;
1929
- }
1930
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
1931
- }
1932
-
1933
- /**
1934
- * Checks if a hash value for `key` exists.
1935
- *
1936
- * @private
1937
- * @name has
1938
- * @memberOf Hash
1939
- * @param {string} key The key of the entry to check.
1940
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1941
- */
1942
- function hashHas(key) {
1943
- var data = this.__data__;
1944
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
1945
- }
1946
-
1947
- /**
1948
- * Sets the hash `key` to `value`.
1949
- *
1950
- * @private
1951
- * @name set
1952
- * @memberOf Hash
1953
- * @param {string} key The key of the value to set.
1954
- * @param {*} value The value to set.
1955
- * @returns {Object} Returns the hash instance.
1956
- */
1957
- function hashSet(key, value) {
1958
- var data = this.__data__;
1959
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1960
- return this;
1961
- }
1962
-
1963
- // Add methods to `Hash`.
1964
- Hash.prototype.clear = hashClear;
1965
- Hash.prototype['delete'] = hashDelete;
1966
- Hash.prototype.get = hashGet;
1967
- Hash.prototype.has = hashHas;
1968
- Hash.prototype.set = hashSet;
1969
-
1970
- /**
1971
- * Creates an list cache object.
1972
- *
1973
- * @private
1974
- * @constructor
1975
- * @param {Array} [entries] The key-value pairs to cache.
1976
- */
1977
- function ListCache(entries) {
1978
- var index = -1,
1979
- length = entries ? entries.length : 0;
1980
-
1981
- this.clear();
1982
- while (++index < length) {
1983
- var entry = entries[index];
1984
- this.set(entry[0], entry[1]);
1985
- }
1986
- }
1987
-
1988
- /**
1989
- * Removes all key-value entries from the list cache.
1990
- *
1991
- * @private
1992
- * @name clear
1993
- * @memberOf ListCache
1994
- */
1995
- function listCacheClear() {
1996
- this.__data__ = [];
1997
- }
1998
-
1999
- /**
2000
- * Removes `key` and its value from the list cache.
2001
- *
2002
- * @private
2003
- * @name delete
2004
- * @memberOf ListCache
2005
- * @param {string} key The key of the value to remove.
2006
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2007
- */
2008
- function listCacheDelete(key) {
2009
- var data = this.__data__,
2010
- index = assocIndexOf(data, key);
2011
-
2012
- if (index < 0) {
2013
- return false;
2014
- }
2015
- var lastIndex = data.length - 1;
2016
- if (index == lastIndex) {
2017
- data.pop();
2018
- } else {
2019
- splice.call(data, index, 1);
2020
- }
2021
- return true;
2022
- }
2023
-
2024
- /**
2025
- * Gets the list cache value for `key`.
2026
- *
2027
- * @private
2028
- * @name get
2029
- * @memberOf ListCache
2030
- * @param {string} key The key of the value to get.
2031
- * @returns {*} Returns the entry value.
2032
- */
2033
- function listCacheGet(key) {
2034
- var data = this.__data__,
2035
- index = assocIndexOf(data, key);
2036
-
2037
- return index < 0 ? undefined : data[index][1];
2038
- }
2039
-
2040
- /**
2041
- * Checks if a list cache value for `key` exists.
2042
- *
2043
- * @private
2044
- * @name has
2045
- * @memberOf ListCache
2046
- * @param {string} key The key of the entry to check.
2047
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2048
- */
2049
- function listCacheHas(key) {
2050
- return assocIndexOf(this.__data__, key) > -1;
2051
- }
2052
-
2053
- /**
2054
- * Sets the list cache `key` to `value`.
2055
- *
2056
- * @private
2057
- * @name set
2058
- * @memberOf ListCache
2059
- * @param {string} key The key of the value to set.
2060
- * @param {*} value The value to set.
2061
- * @returns {Object} Returns the list cache instance.
2062
- */
2063
- function listCacheSet(key, value) {
2064
- var data = this.__data__,
2065
- index = assocIndexOf(data, key);
2066
-
2067
- if (index < 0) {
2068
- data.push([key, value]);
2069
- } else {
2070
- data[index][1] = value;
2071
- }
2072
- return this;
2073
- }
2074
-
2075
- // Add methods to `ListCache`.
2076
- ListCache.prototype.clear = listCacheClear;
2077
- ListCache.prototype['delete'] = listCacheDelete;
2078
- ListCache.prototype.get = listCacheGet;
2079
- ListCache.prototype.has = listCacheHas;
2080
- ListCache.prototype.set = listCacheSet;
2081
-
2082
- /**
2083
- * Creates a map cache object to store key-value pairs.
2084
- *
2085
- * @private
2086
- * @constructor
2087
- * @param {Array} [entries] The key-value pairs to cache.
2088
- */
2089
- function MapCache(entries) {
2090
- var index = -1,
2091
- length = entries ? entries.length : 0;
2092
-
2093
- this.clear();
2094
- while (++index < length) {
2095
- var entry = entries[index];
2096
- this.set(entry[0], entry[1]);
2097
- }
2098
- }
2099
-
2100
- /**
2101
- * Removes all key-value entries from the map.
2102
- *
2103
- * @private
2104
- * @name clear
2105
- * @memberOf MapCache
2106
- */
2107
- function mapCacheClear() {
2108
- this.__data__ = {
2109
- 'hash': new Hash,
2110
- 'map': new (Map || ListCache),
2111
- 'string': new Hash
2112
- };
2113
- }
2114
-
2115
- /**
2116
- * Removes `key` and its value from the map.
2117
- *
2118
- * @private
2119
- * @name delete
2120
- * @memberOf MapCache
2121
- * @param {string} key The key of the value to remove.
2122
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2123
- */
2124
- function mapCacheDelete(key) {
2125
- return getMapData(this, key)['delete'](key);
2126
- }
2127
-
2128
- /**
2129
- * Gets the map value for `key`.
2130
- *
2131
- * @private
2132
- * @name get
2133
- * @memberOf MapCache
2134
- * @param {string} key The key of the value to get.
2135
- * @returns {*} Returns the entry value.
2136
- */
2137
- function mapCacheGet(key) {
2138
- return getMapData(this, key).get(key);
2139
- }
2140
-
2141
- /**
2142
- * Checks if a map value for `key` exists.
2143
- *
2144
- * @private
2145
- * @name has
2146
- * @memberOf MapCache
2147
- * @param {string} key The key of the entry to check.
2148
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2149
- */
2150
- function mapCacheHas(key) {
2151
- return getMapData(this, key).has(key);
2152
- }
2153
-
2154
- /**
2155
- * Sets the map `key` to `value`.
2156
- *
2157
- * @private
2158
- * @name set
2159
- * @memberOf MapCache
2160
- * @param {string} key The key of the value to set.
2161
- * @param {*} value The value to set.
2162
- * @returns {Object} Returns the map cache instance.
2163
- */
2164
- function mapCacheSet(key, value) {
2165
- getMapData(this, key).set(key, value);
2166
- return this;
2167
- }
2168
-
2169
- // Add methods to `MapCache`.
2170
- MapCache.prototype.clear = mapCacheClear;
2171
- MapCache.prototype['delete'] = mapCacheDelete;
2172
- MapCache.prototype.get = mapCacheGet;
2173
- MapCache.prototype.has = mapCacheHas;
2174
- MapCache.prototype.set = mapCacheSet;
2175
-
2176
- /**
2177
- * Creates a stack cache object to store key-value pairs.
2178
- *
2179
- * @private
2180
- * @constructor
2181
- * @param {Array} [entries] The key-value pairs to cache.
2182
- */
2183
- function Stack(entries) {
2184
- this.__data__ = new ListCache(entries);
2185
- }
2186
-
2187
- /**
2188
- * Removes all key-value entries from the stack.
2189
- *
2190
- * @private
2191
- * @name clear
2192
- * @memberOf Stack
2193
- */
2194
- function stackClear() {
2195
- this.__data__ = new ListCache;
2196
- }
2197
-
2198
- /**
2199
- * Removes `key` and its value from the stack.
2200
- *
2201
- * @private
2202
- * @name delete
2203
- * @memberOf Stack
2204
- * @param {string} key The key of the value to remove.
2205
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2206
- */
2207
- function stackDelete(key) {
2208
- return this.__data__['delete'](key);
2209
- }
2210
-
2211
- /**
2212
- * Gets the stack value for `key`.
2213
- *
2214
- * @private
2215
- * @name get
2216
- * @memberOf Stack
2217
- * @param {string} key The key of the value to get.
2218
- * @returns {*} Returns the entry value.
2219
- */
2220
- function stackGet(key) {
2221
- return this.__data__.get(key);
2222
- }
2223
-
2224
- /**
2225
- * Checks if a stack value for `key` exists.
2226
- *
2227
- * @private
2228
- * @name has
2229
- * @memberOf Stack
2230
- * @param {string} key The key of the entry to check.
2231
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2232
- */
2233
- function stackHas(key) {
2234
- return this.__data__.has(key);
2235
- }
2236
-
2237
- /**
2238
- * Sets the stack `key` to `value`.
2239
- *
2240
- * @private
2241
- * @name set
2242
- * @memberOf Stack
2243
- * @param {string} key The key of the value to set.
2244
- * @param {*} value The value to set.
2245
- * @returns {Object} Returns the stack cache instance.
2246
- */
2247
- function stackSet(key, value) {
2248
- var cache = this.__data__;
2249
- if (cache instanceof ListCache) {
2250
- var pairs = cache.__data__;
2251
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
2252
- pairs.push([key, value]);
2253
- return this;
2254
- }
2255
- cache = this.__data__ = new MapCache(pairs);
2256
- }
2257
- cache.set(key, value);
2258
- return this;
2259
- }
2260
-
2261
- // Add methods to `Stack`.
2262
- Stack.prototype.clear = stackClear;
2263
- Stack.prototype['delete'] = stackDelete;
2264
- Stack.prototype.get = stackGet;
2265
- Stack.prototype.has = stackHas;
2266
- Stack.prototype.set = stackSet;
2267
-
2268
- /**
2269
- * Creates an array of the enumerable property names of the array-like `value`.
2270
- *
2271
- * @private
2272
- * @param {*} value The value to query.
2273
- * @param {boolean} inherited Specify returning inherited property names.
2274
- * @returns {Array} Returns the array of property names.
2275
- */
2276
- function arrayLikeKeys(value, inherited) {
2277
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
2278
- // Safari 9 makes `arguments.length` enumerable in strict mode.
2279
- var result = (isArray(value) || isArguments(value))
2280
- ? baseTimes(value.length, String)
2281
- : [];
2282
-
2283
- var length = result.length,
2284
- skipIndexes = !!length;
2285
-
2286
- for (var key in value) {
2287
- if ((inherited || hasOwnProperty.call(value, key)) &&
2288
- !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
2289
- result.push(key);
2290
- }
2291
- }
2292
- return result;
2293
- }
2294
-
2295
- /**
2296
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
2297
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2298
- * for equality comparisons.
2299
- *
2300
- * @private
2301
- * @param {Object} object The object to modify.
2302
- * @param {string} key The key of the property to assign.
2303
- * @param {*} value The value to assign.
2304
- */
2305
- function assignValue(object, key, value) {
2306
- var objValue = object[key];
2307
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
2308
- (value === undefined && !(key in object))) {
2309
- object[key] = value;
2310
- }
2311
- }
2312
-
2313
- /**
2314
- * Gets the index at which the `key` is found in `array` of key-value pairs.
2315
- *
2316
- * @private
2317
- * @param {Array} array The array to inspect.
2318
- * @param {*} key The key to search for.
2319
- * @returns {number} Returns the index of the matched value, else `-1`.
2320
- */
2321
- function assocIndexOf(array, key) {
2322
- var length = array.length;
2323
- while (length--) {
2324
- if (eq(array[length][0], key)) {
2325
- return length;
2326
- }
2327
- }
2328
- return -1;
2329
- }
2330
-
2331
- /**
2332
- * The base implementation of `_.assign` without support for multiple sources
2333
- * or `customizer` functions.
2334
- *
2335
- * @private
2336
- * @param {Object} object The destination object.
2337
- * @param {Object} source The source object.
2338
- * @returns {Object} Returns `object`.
2339
- */
2340
- function baseAssign(object, source) {
2341
- return object && copyObject(source, keys(source), object);
2342
- }
2343
-
2344
- /**
2345
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2346
- * traversed objects.
2347
- *
2348
- * @private
2349
- * @param {*} value The value to clone.
2350
- * @param {boolean} [isDeep] Specify a deep clone.
2351
- * @param {boolean} [isFull] Specify a clone including symbols.
2352
- * @param {Function} [customizer] The function to customize cloning.
2353
- * @param {string} [key] The key of `value`.
2354
- * @param {Object} [object] The parent object of `value`.
2355
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2356
- * @returns {*} Returns the cloned value.
2357
- */
2358
- function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
2359
- var result;
2360
- if (customizer) {
2361
- result = object ? customizer(value, key, object, stack) : customizer(value);
2362
- }
2363
- if (result !== undefined) {
2364
- return result;
2365
- }
2366
- if (!isObject(value)) {
2367
- return value;
2368
- }
2369
- var isArr = isArray(value);
2370
- if (isArr) {
2371
- result = initCloneArray(value);
2372
- if (!isDeep) {
2373
- return copyArray(value, result);
2374
- }
2375
- } else {
2376
- var tag = getTag(value),
2377
- isFunc = tag == funcTag || tag == genTag;
2378
-
2379
- if (isBuffer(value)) {
2380
- return cloneBuffer(value, isDeep);
2381
- }
2382
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2383
- if (isHostObject(value)) {
2384
- return object ? value : {};
2385
- }
2386
- result = initCloneObject(isFunc ? {} : value);
2387
- if (!isDeep) {
2388
- return copySymbols(value, baseAssign(result, value));
2389
- }
2390
- } else {
2391
- if (!cloneableTags[tag]) {
2392
- return object ? value : {};
2393
- }
2394
- result = initCloneByTag(value, tag, baseClone, isDeep);
2395
- }
2396
- }
2397
- // Check for circular references and return its corresponding clone.
2398
- stack || (stack = new Stack);
2399
- var stacked = stack.get(value);
2400
- if (stacked) {
2401
- return stacked;
2402
- }
2403
- stack.set(value, result);
2404
-
2405
- if (!isArr) {
2406
- var props = isFull ? getAllKeys(value) : keys(value);
2407
- }
2408
- arrayEach(props || value, function(subValue, key) {
2409
- if (props) {
2410
- key = subValue;
2411
- subValue = value[key];
2412
- }
2413
- // Recursively populate clone (susceptible to call stack limits).
2414
- assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
2415
- });
2416
- return result;
2417
- }
2418
-
2419
- /**
2420
- * The base implementation of `_.create` without support for assigning
2421
- * properties to the created object.
2422
- *
2423
- * @private
2424
- * @param {Object} prototype The object to inherit from.
2425
- * @returns {Object} Returns the new object.
2426
- */
2427
- function baseCreate(proto) {
2428
- return isObject(proto) ? objectCreate(proto) : {};
2429
- }
2430
-
2431
- /**
2432
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
2433
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
2434
- * symbols of `object`.
2435
- *
2436
- * @private
2437
- * @param {Object} object The object to query.
2438
- * @param {Function} keysFunc The function to get the keys of `object`.
2439
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
2440
- * @returns {Array} Returns the array of property names and symbols.
2441
- */
2442
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2443
- var result = keysFunc(object);
2444
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
2445
- }
2446
-
2447
- /**
2448
- * The base implementation of `getTag`.
2449
- *
2450
- * @private
2451
- * @param {*} value The value to query.
2452
- * @returns {string} Returns the `toStringTag`.
2453
- */
2454
- function baseGetTag(value) {
2455
- return objectToString.call(value);
2456
- }
2457
-
2458
- /**
2459
- * The base implementation of `_.isNative` without bad shim checks.
2460
- *
2461
- * @private
2462
- * @param {*} value The value to check.
2463
- * @returns {boolean} Returns `true` if `value` is a native function,
2464
- * else `false`.
2465
- */
2466
- function baseIsNative(value) {
2467
- if (!isObject(value) || isMasked(value)) {
2468
- return false;
2469
- }
2470
- var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
2471
- return pattern.test(toSource(value));
2472
- }
2473
-
2474
- /**
2475
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2476
- *
2477
- * @private
2478
- * @param {Object} object The object to query.
2479
- * @returns {Array} Returns the array of property names.
2480
- */
2481
- function baseKeys(object) {
2482
- if (!isPrototype(object)) {
2483
- return nativeKeys(object);
2484
- }
2485
- var result = [];
2486
- for (var key in Object(object)) {
2487
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
2488
- result.push(key);
2489
- }
2490
- }
2491
- return result;
2492
- }
2493
-
2494
- /**
2495
- * Creates a clone of `buffer`.
2496
- *
2497
- * @private
2498
- * @param {Buffer} buffer The buffer to clone.
2499
- * @param {boolean} [isDeep] Specify a deep clone.
2500
- * @returns {Buffer} Returns the cloned buffer.
2501
- */
2502
- function cloneBuffer(buffer, isDeep) {
2503
- if (isDeep) {
2504
- return buffer.slice();
2505
- }
2506
- var result = new buffer.constructor(buffer.length);
2507
- buffer.copy(result);
2508
- return result;
2509
- }
2510
-
2511
- /**
2512
- * Creates a clone of `arrayBuffer`.
2513
- *
2514
- * @private
2515
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2516
- * @returns {ArrayBuffer} Returns the cloned array buffer.
2517
- */
2518
- function cloneArrayBuffer(arrayBuffer) {
2519
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2520
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
2521
- return result;
2522
- }
2523
-
2524
- /**
2525
- * Creates a clone of `dataView`.
2526
- *
2527
- * @private
2528
- * @param {Object} dataView The data view to clone.
2529
- * @param {boolean} [isDeep] Specify a deep clone.
2530
- * @returns {Object} Returns the cloned data view.
2531
- */
2532
- function cloneDataView(dataView, isDeep) {
2533
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2534
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2535
- }
2536
-
2537
- /**
2538
- * Creates a clone of `map`.
2539
- *
2540
- * @private
2541
- * @param {Object} map The map to clone.
2542
- * @param {Function} cloneFunc The function to clone values.
2543
- * @param {boolean} [isDeep] Specify a deep clone.
2544
- * @returns {Object} Returns the cloned map.
2545
- */
2546
- function cloneMap(map, isDeep, cloneFunc) {
2547
- var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
2548
- return arrayReduce(array, addMapEntry, new map.constructor);
2549
- }
2550
-
2551
- /**
2552
- * Creates a clone of `regexp`.
2553
- *
2554
- * @private
2555
- * @param {Object} regexp The regexp to clone.
2556
- * @returns {Object} Returns the cloned regexp.
2557
- */
2558
- function cloneRegExp(regexp) {
2559
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2560
- result.lastIndex = regexp.lastIndex;
2561
- return result;
2562
- }
2563
-
2564
- /**
2565
- * Creates a clone of `set`.
2566
- *
2567
- * @private
2568
- * @param {Object} set The set to clone.
2569
- * @param {Function} cloneFunc The function to clone values.
2570
- * @param {boolean} [isDeep] Specify a deep clone.
2571
- * @returns {Object} Returns the cloned set.
2572
- */
2573
- function cloneSet(set, isDeep, cloneFunc) {
2574
- var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
2575
- return arrayReduce(array, addSetEntry, new set.constructor);
2576
- }
2577
-
2578
- /**
2579
- * Creates a clone of the `symbol` object.
2580
- *
2581
- * @private
2582
- * @param {Object} symbol The symbol object to clone.
2583
- * @returns {Object} Returns the cloned symbol object.
2584
- */
2585
- function cloneSymbol(symbol) {
2586
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2587
- }
2588
-
2589
- /**
2590
- * Creates a clone of `typedArray`.
2591
- *
2592
- * @private
2593
- * @param {Object} typedArray The typed array to clone.
2594
- * @param {boolean} [isDeep] Specify a deep clone.
2595
- * @returns {Object} Returns the cloned typed array.
2596
- */
2597
- function cloneTypedArray(typedArray, isDeep) {
2598
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2599
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2600
- }
2601
-
2602
- /**
2603
- * Copies the values of `source` to `array`.
2604
- *
2605
- * @private
2606
- * @param {Array} source The array to copy values from.
2607
- * @param {Array} [array=[]] The array to copy values to.
2608
- * @returns {Array} Returns `array`.
2609
- */
2610
- function copyArray(source, array) {
2611
- var index = -1,
2612
- length = source.length;
2613
-
2614
- array || (array = Array(length));
2615
- while (++index < length) {
2616
- array[index] = source[index];
2617
- }
2618
- return array;
2619
- }
2620
-
2621
- /**
2622
- * Copies properties of `source` to `object`.
2623
- *
2624
- * @private
2625
- * @param {Object} source The object to copy properties from.
2626
- * @param {Array} props The property identifiers to copy.
2627
- * @param {Object} [object={}] The object to copy properties to.
2628
- * @param {Function} [customizer] The function to customize copied values.
2629
- * @returns {Object} Returns `object`.
2630
- */
2631
- function copyObject(source, props, object, customizer) {
2632
- object || (object = {});
2633
-
2634
- var index = -1,
2635
- length = props.length;
2636
-
2637
- while (++index < length) {
2638
- var key = props[index];
2639
-
2640
- var newValue = customizer
2641
- ? customizer(object[key], source[key], key, object, source)
2642
- : undefined;
2643
-
2644
- assignValue(object, key, newValue === undefined ? source[key] : newValue);
2645
- }
2646
- return object;
2647
- }
2648
-
2649
- /**
2650
- * Copies own symbol properties of `source` to `object`.
2651
- *
2652
- * @private
2653
- * @param {Object} source The object to copy symbols from.
2654
- * @param {Object} [object={}] The object to copy symbols to.
2655
- * @returns {Object} Returns `object`.
2656
- */
2657
- function copySymbols(source, object) {
2658
- return copyObject(source, getSymbols(source), object);
2659
- }
2660
-
2661
- /**
2662
- * Creates an array of own enumerable property names and symbols of `object`.
2663
- *
2664
- * @private
2665
- * @param {Object} object The object to query.
2666
- * @returns {Array} Returns the array of property names and symbols.
2667
- */
2668
- function getAllKeys(object) {
2669
- return baseGetAllKeys(object, keys, getSymbols);
2670
- }
2671
-
2672
- /**
2673
- * Gets the data for `map`.
2674
- *
2675
- * @private
2676
- * @param {Object} map The map to query.
2677
- * @param {string} key The reference key.
2678
- * @returns {*} Returns the map data.
2679
- */
2680
- function getMapData(map, key) {
2681
- var data = map.__data__;
2682
- return isKeyable(key)
2683
- ? data[typeof key == 'string' ? 'string' : 'hash']
2684
- : data.map;
2685
- }
2686
-
2687
- /**
2688
- * Gets the native function at `key` of `object`.
2689
- *
2690
- * @private
2691
- * @param {Object} object The object to query.
2692
- * @param {string} key The key of the method to get.
2693
- * @returns {*} Returns the function if it's native, else `undefined`.
2694
- */
2695
- function getNative(object, key) {
2696
- var value = getValue(object, key);
2697
- return baseIsNative(value) ? value : undefined;
2698
- }
2699
-
2700
- /**
2701
- * Creates an array of the own enumerable symbol properties of `object`.
2702
- *
2703
- * @private
2704
- * @param {Object} object The object to query.
2705
- * @returns {Array} Returns the array of symbols.
2706
- */
2707
- var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
2708
-
2709
- /**
2710
- * Gets the `toStringTag` of `value`.
2711
- *
2712
- * @private
2713
- * @param {*} value The value to query.
2714
- * @returns {string} Returns the `toStringTag`.
2715
- */
2716
- var getTag = baseGetTag;
2717
-
2718
- // Fallback for data views, maps, sets, and weak maps in IE 11,
2719
- // for data views in Edge < 14, and promises in Node.js.
2720
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
2721
- (Map && getTag(new Map) != mapTag) ||
2722
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
2723
- (Set && getTag(new Set) != setTag) ||
2724
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
2725
- getTag = function(value) {
2726
- var result = objectToString.call(value),
2727
- Ctor = result == objectTag ? value.constructor : undefined,
2728
- ctorString = Ctor ? toSource(Ctor) : undefined;
2729
-
2730
- if (ctorString) {
2731
- switch (ctorString) {
2732
- case dataViewCtorString: return dataViewTag;
2733
- case mapCtorString: return mapTag;
2734
- case promiseCtorString: return promiseTag;
2735
- case setCtorString: return setTag;
2736
- case weakMapCtorString: return weakMapTag;
2737
- }
2738
- }
2739
- return result;
2740
- };
2741
- }
2742
-
2743
- /**
2744
- * Initializes an array clone.
2745
- *
2746
- * @private
2747
- * @param {Array} array The array to clone.
2748
- * @returns {Array} Returns the initialized clone.
2749
- */
2750
- function initCloneArray(array) {
2751
- var length = array.length,
2752
- result = array.constructor(length);
2753
-
2754
- // Add properties assigned by `RegExp#exec`.
2755
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2756
- result.index = array.index;
2757
- result.input = array.input;
2758
- }
2759
- return result;
2760
- }
2761
-
2762
- /**
2763
- * Initializes an object clone.
2764
- *
2765
- * @private
2766
- * @param {Object} object The object to clone.
2767
- * @returns {Object} Returns the initialized clone.
2768
- */
2769
- function initCloneObject(object) {
2770
- return (typeof object.constructor == 'function' && !isPrototype(object))
2771
- ? baseCreate(getPrototype(object))
2772
- : {};
2773
- }
2774
-
2775
- /**
2776
- * Initializes an object clone based on its `toStringTag`.
2777
- *
2778
- * **Note:** This function only supports cloning values with tags of
2779
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
2780
- *
2781
- * @private
2782
- * @param {Object} object The object to clone.
2783
- * @param {string} tag The `toStringTag` of the object to clone.
2784
- * @param {Function} cloneFunc The function to clone values.
2785
- * @param {boolean} [isDeep] Specify a deep clone.
2786
- * @returns {Object} Returns the initialized clone.
2787
- */
2788
- function initCloneByTag(object, tag, cloneFunc, isDeep) {
2789
- var Ctor = object.constructor;
2790
- switch (tag) {
2791
- case arrayBufferTag:
2792
- return cloneArrayBuffer(object);
2793
-
2794
- case boolTag:
2795
- case dateTag:
2796
- return new Ctor(+object);
2797
-
2798
- case dataViewTag:
2799
- return cloneDataView(object, isDeep);
2800
-
2801
- case float32Tag: case float64Tag:
2802
- case int8Tag: case int16Tag: case int32Tag:
2803
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
2804
- return cloneTypedArray(object, isDeep);
2805
-
2806
- case mapTag:
2807
- return cloneMap(object, isDeep, cloneFunc);
2808
-
2809
- case numberTag:
2810
- case stringTag:
2811
- return new Ctor(object);
2812
-
2813
- case regexpTag:
2814
- return cloneRegExp(object);
2815
-
2816
- case setTag:
2817
- return cloneSet(object, isDeep, cloneFunc);
2818
-
2819
- case symbolTag:
2820
- return cloneSymbol(object);
2821
- }
2822
- }
2823
-
2824
- /**
2825
- * Checks if `value` is a valid array-like index.
2826
- *
2827
- * @private
2828
- * @param {*} value The value to check.
2829
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2830
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2831
- */
2832
- function isIndex(value, length) {
2833
- length = length == null ? MAX_SAFE_INTEGER : length;
2834
- return !!length &&
2835
- (typeof value == 'number' || reIsUint.test(value)) &&
2836
- (value > -1 && value % 1 == 0 && value < length);
2837
- }
2838
-
2839
- /**
2840
- * Checks if `value` is suitable for use as unique object key.
2841
- *
2842
- * @private
2843
- * @param {*} value The value to check.
2844
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
2845
- */
2846
- function isKeyable(value) {
2847
- var type = typeof value;
2848
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
2849
- ? (value !== '__proto__')
2850
- : (value === null);
2851
- }
2852
-
2853
- /**
2854
- * Checks if `func` has its source masked.
2855
- *
2856
- * @private
2857
- * @param {Function} func The function to check.
2858
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
2859
- */
2860
- function isMasked(func) {
2861
- return !!maskSrcKey && (maskSrcKey in func);
2862
- }
2863
-
2864
- /**
2865
- * Checks if `value` is likely a prototype object.
2866
- *
2867
- * @private
2868
- * @param {*} value The value to check.
2869
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
2870
- */
2871
- function isPrototype(value) {
2872
- var Ctor = value && value.constructor,
2873
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
2874
-
2875
- return value === proto;
2876
- }
2877
-
2878
- /**
2879
- * Converts `func` to its source code.
2880
- *
2881
- * @private
2882
- * @param {Function} func The function to process.
2883
- * @returns {string} Returns the source code.
2884
- */
2885
- function toSource(func) {
2886
- if (func != null) {
2887
- try {
2888
- return funcToString.call(func);
2889
- } catch (e) {}
2890
- try {
2891
- return (func + '');
2892
- } catch (e) {}
2893
- }
2894
- return '';
2895
- }
2896
-
2897
- /**
2898
- * This method is like `_.clone` except that it recursively clones `value`.
2899
- *
2900
- * @static
2901
- * @memberOf _
2902
- * @since 1.0.0
2903
- * @category Lang
2904
- * @param {*} value The value to recursively clone.
2905
- * @returns {*} Returns the deep cloned value.
2906
- * @see _.clone
2907
- * @example
2908
- *
2909
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
2910
- *
2911
- * var deep = _.cloneDeep(objects);
2912
- * console.log(deep[0] === objects[0]);
2913
- * // => false
2914
- */
2915
- function cloneDeep(value) {
2916
- return baseClone(value, true, true);
2917
- }
2918
-
2919
- /**
2920
- * Performs a
2921
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2922
- * comparison between two values to determine if they are equivalent.
2923
- *
2924
- * @static
2925
- * @memberOf _
2926
- * @since 4.0.0
2927
- * @category Lang
2928
- * @param {*} value The value to compare.
2929
- * @param {*} other The other value to compare.
2930
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2931
- * @example
2932
- *
2933
- * var object = { 'a': 1 };
2934
- * var other = { 'a': 1 };
2935
- *
2936
- * _.eq(object, object);
2937
- * // => true
2938
- *
2939
- * _.eq(object, other);
2940
- * // => false
2941
- *
2942
- * _.eq('a', 'a');
2943
- * // => true
2944
- *
2945
- * _.eq('a', Object('a'));
2946
- * // => false
2947
- *
2948
- * _.eq(NaN, NaN);
2949
- * // => true
2950
- */
2951
- function eq(value, other) {
2952
- return value === other || (value !== value && other !== other);
2953
- }
2954
-
2955
- /**
2956
- * Checks if `value` is likely an `arguments` object.
2957
- *
2958
- * @static
2959
- * @memberOf _
2960
- * @since 0.1.0
2961
- * @category Lang
2962
- * @param {*} value The value to check.
2963
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2964
- * else `false`.
2965
- * @example
2966
- *
2967
- * _.isArguments(function() { return arguments; }());
2968
- * // => true
2969
- *
2970
- * _.isArguments([1, 2, 3]);
2971
- * // => false
2972
- */
2973
- function isArguments(value) {
2974
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
2975
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
2976
- (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
2977
- }
2978
-
2979
- /**
2980
- * Checks if `value` is classified as an `Array` object.
2981
- *
2982
- * @static
2983
- * @memberOf _
2984
- * @since 0.1.0
2985
- * @category Lang
2986
- * @param {*} value The value to check.
2987
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
2988
- * @example
2989
- *
2990
- * _.isArray([1, 2, 3]);
2991
- * // => true
2992
- *
2993
- * _.isArray(document.body.children);
2994
- * // => false
2995
- *
2996
- * _.isArray('abc');
2997
- * // => false
2998
- *
2999
- * _.isArray(_.noop);
3000
- * // => false
3001
- */
3002
- var isArray = Array.isArray;
3003
-
3004
- /**
3005
- * Checks if `value` is array-like. A value is considered array-like if it's
3006
- * not a function and has a `value.length` that's an integer greater than or
3007
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
3008
- *
3009
- * @static
3010
- * @memberOf _
3011
- * @since 4.0.0
3012
- * @category Lang
3013
- * @param {*} value The value to check.
3014
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
3015
- * @example
3016
- *
3017
- * _.isArrayLike([1, 2, 3]);
3018
- * // => true
3019
- *
3020
- * _.isArrayLike(document.body.children);
3021
- * // => true
3022
- *
3023
- * _.isArrayLike('abc');
3024
- * // => true
3025
- *
3026
- * _.isArrayLike(_.noop);
3027
- * // => false
3028
- */
3029
- function isArrayLike(value) {
3030
- return value != null && isLength(value.length) && !isFunction(value);
3031
- }
3032
-
3033
- /**
3034
- * This method is like `_.isArrayLike` except that it also checks if `value`
3035
- * is an object.
3036
- *
3037
- * @static
3038
- * @memberOf _
3039
- * @since 4.0.0
3040
- * @category Lang
3041
- * @param {*} value The value to check.
3042
- * @returns {boolean} Returns `true` if `value` is an array-like object,
3043
- * else `false`.
3044
- * @example
3045
- *
3046
- * _.isArrayLikeObject([1, 2, 3]);
3047
- * // => true
3048
- *
3049
- * _.isArrayLikeObject(document.body.children);
3050
- * // => true
3051
- *
3052
- * _.isArrayLikeObject('abc');
3053
- * // => false
3054
- *
3055
- * _.isArrayLikeObject(_.noop);
3056
- * // => false
3057
- */
3058
- function isArrayLikeObject(value) {
3059
- return isObjectLike(value) && isArrayLike(value);
3060
- }
3061
-
3062
- /**
3063
- * Checks if `value` is a buffer.
3064
- *
3065
- * @static
3066
- * @memberOf _
3067
- * @since 4.3.0
3068
- * @category Lang
3069
- * @param {*} value The value to check.
3070
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
3071
- * @example
3072
- *
3073
- * _.isBuffer(new Buffer(2));
3074
- * // => true
3075
- *
3076
- * _.isBuffer(new Uint8Array(2));
3077
- * // => false
3078
- */
3079
- var isBuffer = nativeIsBuffer || stubFalse;
3080
-
3081
- /**
3082
- * Checks if `value` is classified as a `Function` object.
3083
- *
3084
- * @static
3085
- * @memberOf _
3086
- * @since 0.1.0
3087
- * @category Lang
3088
- * @param {*} value The value to check.
3089
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
3090
- * @example
3091
- *
3092
- * _.isFunction(_);
3093
- * // => true
3094
- *
3095
- * _.isFunction(/abc/);
3096
- * // => false
3097
- */
3098
- function isFunction(value) {
3099
- // The use of `Object#toString` avoids issues with the `typeof` operator
3100
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
3101
- var tag = isObject(value) ? objectToString.call(value) : '';
3102
- return tag == funcTag || tag == genTag;
3103
- }
3104
-
3105
- /**
3106
- * Checks if `value` is a valid array-like length.
3107
- *
3108
- * **Note:** This method is loosely based on
3109
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
3110
- *
3111
- * @static
3112
- * @memberOf _
3113
- * @since 4.0.0
3114
- * @category Lang
3115
- * @param {*} value The value to check.
3116
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
3117
- * @example
3118
- *
3119
- * _.isLength(3);
3120
- * // => true
3121
- *
3122
- * _.isLength(Number.MIN_VALUE);
3123
- * // => false
3124
- *
3125
- * _.isLength(Infinity);
3126
- * // => false
3127
- *
3128
- * _.isLength('3');
3129
- * // => false
3130
- */
3131
- function isLength(value) {
3132
- return typeof value == 'number' &&
3133
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
3134
- }
3135
-
3136
- /**
3137
- * Checks if `value` is the
3138
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
3139
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
3140
- *
3141
- * @static
3142
- * @memberOf _
3143
- * @since 0.1.0
3144
- * @category Lang
3145
- * @param {*} value The value to check.
3146
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
3147
- * @example
3148
- *
3149
- * _.isObject({});
3150
- * // => true
3151
- *
3152
- * _.isObject([1, 2, 3]);
3153
- * // => true
3154
- *
3155
- * _.isObject(_.noop);
3156
- * // => true
3157
- *
3158
- * _.isObject(null);
3159
- * // => false
3160
- */
3161
- function isObject(value) {
3162
- var type = typeof value;
3163
- return !!value && (type == 'object' || type == 'function');
3164
- }
3165
-
3166
- /**
3167
- * Checks if `value` is object-like. A value is object-like if it's not `null`
3168
- * and has a `typeof` result of "object".
3169
- *
3170
- * @static
3171
- * @memberOf _
3172
- * @since 4.0.0
3173
- * @category Lang
3174
- * @param {*} value The value to check.
3175
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
3176
- * @example
3177
- *
3178
- * _.isObjectLike({});
3179
- * // => true
3180
- *
3181
- * _.isObjectLike([1, 2, 3]);
3182
- * // => true
3183
- *
3184
- * _.isObjectLike(_.noop);
3185
- * // => false
3186
- *
3187
- * _.isObjectLike(null);
3188
- * // => false
3189
- */
3190
- function isObjectLike(value) {
3191
- return !!value && typeof value == 'object';
3192
- }
3193
-
3194
- /**
3195
- * Creates an array of the own enumerable property names of `object`.
3196
- *
3197
- * **Note:** Non-object values are coerced to objects. See the
3198
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
3199
- * for more details.
3200
- *
3201
- * @static
3202
- * @since 0.1.0
3203
- * @memberOf _
3204
- * @category Object
3205
- * @param {Object} object The object to query.
3206
- * @returns {Array} Returns the array of property names.
3207
- * @example
3208
- *
3209
- * function Foo() {
3210
- * this.a = 1;
3211
- * this.b = 2;
3212
- * }
3213
- *
3214
- * Foo.prototype.c = 3;
3215
- *
3216
- * _.keys(new Foo);
3217
- * // => ['a', 'b'] (iteration order is not guaranteed)
3218
- *
3219
- * _.keys('hi');
3220
- * // => ['0', '1']
3221
- */
3222
- function keys(object) {
3223
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
3224
- }
3225
-
3226
- /**
3227
- * This method returns a new empty array.
3228
- *
3229
- * @static
3230
- * @memberOf _
3231
- * @since 4.13.0
3232
- * @category Util
3233
- * @returns {Array} Returns the new empty array.
3234
- * @example
3235
- *
3236
- * var arrays = _.times(2, _.stubArray);
3237
- *
3238
- * console.log(arrays);
3239
- * // => [[], []]
3240
- *
3241
- * console.log(arrays[0] === arrays[1]);
3242
- * // => false
3243
- */
3244
- function stubArray() {
3245
- return [];
3246
- }
3247
-
3248
- /**
3249
- * This method returns `false`.
3250
- *
3251
- * @static
3252
- * @memberOf _
3253
- * @since 4.13.0
3254
- * @category Util
3255
- * @returns {boolean} Returns `false`.
3256
- * @example
3257
- *
3258
- * _.times(2, _.stubFalse);
3259
- * // => [false, false]
3260
- */
3261
- function stubFalse() {
3262
- return false;
3263
- }
3264
-
3265
- module.exports = cloneDeep;
3266
- });
3267
-
3268
- /**
3269
- * @name object-boolean-combinations
3270
- * @fileoverview Consumes a defaults object with booleans, generates all possible variations of it
3271
- * @version 4.0.16
3272
- * @author Roy Revelt, Codsen Ltd
3273
- * @license MIT
3274
- * {@link https://codsen.com/os/object-boolean-combinations/}
3275
- */
3276
- function combinations(originalIncomingObject, originalOverrideObject = {}) {
3277
- function combi(n) {
3278
- const r = [];
3279
- for (let i = 0; i < 1 << n; i++) {
3280
- const c = [];
3281
- for (let j = 0; j < n; j++) {
3282
- c.push(i & 1 << j ? 1 : 0);
3283
- }
3284
- r.push(c);
3285
- }
3286
- return r;
3287
- }
3288
- if (!originalIncomingObject) {
3289
- throw new Error("[THROW_ID_01] missing input object");
3290
- }
3291
- if (!lodash_isplainobject(originalIncomingObject)) {
3292
- throw new Error("[THROW_ID_02] the first input object must be a true object");
3293
- }
3294
- if (originalOverrideObject && !lodash_isplainobject(originalOverrideObject)) {
3295
- throw new Error("[THROW_ID_03] the second override object must be a true object");
3296
- }
3297
- const incomingObject = lodash_clonedeep(originalIncomingObject);
3298
- const overrideObject = lodash_clonedeep(originalOverrideObject);
3299
- const propertiesToMix = Object.keys(incomingObject);
3300
- const outcomingObjectsArray = [];
3301
- let propertiesToBeOverridden = [];
3302
- if (lodash_isplainobject(overrideObject) && Object.keys(overrideObject).length) {
3303
- propertiesToBeOverridden = lodash_intersection(Object.keys(overrideObject), Object.keys(incomingObject));
3304
- propertiesToBeOverridden.forEach(elem => lodash_pull(propertiesToMix, elem));
3305
- }
3306
- const boolCombinations = combi(Object.keys(propertiesToMix).length);
3307
- let tempObject;
3308
- boolCombinations.forEach((_elem1, index1) => {
3309
- tempObject = {};
3310
- propertiesToMix.forEach((elem2, index2) => {
3311
- tempObject[elem2] = boolCombinations[index1][index2] === 1;
3312
- });
3313
- outcomingObjectsArray.push(tempObject);
3314
- });
3315
- if (lodash_isplainobject(overrideObject) && Object.keys(overrideObject).length) {
3316
- outcomingObjectsArray.forEach(elem3 => propertiesToBeOverridden.forEach(elem4 => {
3317
- elem3[elem4] = overrideObject[elem4];
3318
- }));
3319
- }
3320
- return outcomingObjectsArray;
3321
- }
3322
-
3323
- var version$1 = "2.0.16";
3324
-
3325
- const version = version$1;
3326
- function mixer(ref = {}, defaultsObj = {}) {
3327
- if (ref && typeof ref !== "object") {
3328
- throw new Error(`test-mixer: [THROW_ID_01] the first input arg is missing!`);
3329
- }
3330
- if (defaultsObj && typeof defaultsObj !== "object") {
3331
- throw new Error(`test-mixer: [THROW_ID_02] the second input arg is missing!`);
3332
- }
3333
- let caught;
3334
- if (typeof ref === "object" &&
3335
- typeof defaultsObj === "object" &&
3336
- Object.keys(ref).some((refKey) => {
3337
- if (!Object.keys(defaultsObj).includes(refKey)) {
3338
- caught = refKey;
3339
- return true;
3340
- }
3341
- })) {
3342
- throw new Error(`test-mixer: [THROW_ID_03] the second input arg object should be defaults; it should be a superset of 1st input arg object. However, 1st input arg object contains key "${caught}" which 2nd input arg object doesn't have.`);
3343
- }
3344
- // quick end
3345
- if (!Object.keys(defaultsObj).length) {
3346
- return [];
3347
- }
3348
- const refClone = lodash_clonedeep(ref);
3349
- const defaultsObjClone = lodash_clonedeep(defaultsObj);
3350
- const optsWithBoolValues = {};
3351
- // 1. find out, what boolean-value keys are there in defaultsObj that
3352
- // are missing in ref. If there are n keys, we'll generate 2^n objects.
3353
- Object.keys(defaultsObj).forEach((key) => {
3354
- // if key's value is bool AND it's not present in ref,
3355
- // add it to "optsWithBoolValues"
3356
- if (typeof defaultsObjClone[key] === "boolean" &&
3357
- !Object.keys(ref).includes(key)) {
3358
- optsWithBoolValues[key] = defaultsObjClone[key];
3359
- }
3360
- });
3361
- // calculate combinations using combinations() - object-boolean-combinations
3362
- // then restore the non-bool keys
3363
- const res = combinations(optsWithBoolValues).map((obj) => ({
3364
- ...defaultsObj,
3365
- ...refClone,
3366
- ...obj,
3367
- }));
3368
- return res;
3369
- }
3370
-
3371
- exports.mixer = mixer;
3372
- exports.version = version;
3373
-
3374
- Object.defineProperty(exports, '__esModule', { value: true });
3375
-
3376
- })));