@teamix/pro 1.5.10 → 1.5.11-beta.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.
@@ -0,0 +1,1578 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ // @ts-nocheck
3
+ /**
4
+ * lodash (Custom Build) <https://lodash.com/>
5
+ * Build: `lodash modularize exports="npm" -o ./`
6
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
7
+ * Released under MIT license <https://lodash.com/license>
8
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
9
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
10
+ */
11
+ /** Used as the size to enable large array optimizations. */
12
+ var LARGE_ARRAY_SIZE = 200;
13
+ /** Used to stand-in for `undefined` hash values. */
14
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
15
+ /** Used as references for various `Number` constants. */
16
+ var MAX_SAFE_INTEGER = 9007199254740991;
17
+ /** `Object#toString` result references. */
18
+ var argsTag = '[object Arguments]',
19
+ arrayTag = '[object Array]',
20
+ boolTag = '[object Boolean]',
21
+ dateTag = '[object Date]',
22
+ errorTag = '[object Error]',
23
+ funcTag = '[object Function]',
24
+ genTag = '[object GeneratorFunction]',
25
+ mapTag = '[object Map]',
26
+ numberTag = '[object Number]',
27
+ objectTag = '[object Object]',
28
+ promiseTag = '[object Promise]',
29
+ regexpTag = '[object RegExp]',
30
+ setTag = '[object Set]',
31
+ stringTag = '[object String]',
32
+ symbolTag = '[object Symbol]',
33
+ weakMapTag = '[object WeakMap]';
34
+ var arrayBufferTag = '[object ArrayBuffer]',
35
+ dataViewTag = '[object DataView]',
36
+ float32Tag = '[object Float32Array]',
37
+ float64Tag = '[object Float64Array]',
38
+ int8Tag = '[object Int8Array]',
39
+ int16Tag = '[object Int16Array]',
40
+ int32Tag = '[object Int32Array]',
41
+ uint8Tag = '[object Uint8Array]',
42
+ uint8ClampedTag = '[object Uint8ClampedArray]',
43
+ uint16Tag = '[object Uint16Array]',
44
+ uint32Tag = '[object Uint32Array]';
45
+ /**
46
+ * Used to match `RegExp`
47
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
48
+ */
49
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
50
+ /** Used to match `RegExp` flags from their coerced string values. */
51
+ var reFlags = /\w*$/;
52
+ /** Used to detect host constructors (Safari). */
53
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
54
+ /** Used to detect unsigned integer values. */
55
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
56
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
57
+ var cloneableTags = {};
58
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
59
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
60
+ /** Detect free variable `global` from Node.js. */
61
+ var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global;
62
+ /** Detect free variable `self`. */
63
+ var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
64
+ /** Used as a reference to the global object. */
65
+ var root = freeGlobal || freeSelf || Function('return this')();
66
+ /** Detect free variable `exports`. */
67
+ var freeExports = (typeof exports === "undefined" ? "undefined" : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
68
+ /** Detect free variable `module`. */
69
+ var freeModule = freeExports && (typeof module === "undefined" ? "undefined" : _typeof(module)) == 'object' && module && !module.nodeType && module;
70
+ /** Detect the popular CommonJS extension `module.exports`. */
71
+ var moduleExports = freeModule && freeModule.exports === freeExports;
72
+ /**
73
+ * Adds the key-value `pair` to `map`.
74
+ *
75
+ * @private
76
+ * @param {Object} map The map to modify.
77
+ * @param {Array} pair The key-value pair to add.
78
+ * @returns {Object} Returns `map`.
79
+ */
80
+ function addMapEntry(map, pair) {
81
+ // Don't return `map.set` because it's not chainable in IE 11.
82
+ map.set(pair[0], pair[1]);
83
+ return map;
84
+ }
85
+ /**
86
+ * Adds `value` to `set`.
87
+ *
88
+ * @private
89
+ * @param {Object} set The set to modify.
90
+ * @param {*} value The value to add.
91
+ * @returns {Object} Returns `set`.
92
+ */
93
+ function addSetEntry(set, value) {
94
+ // Don't return `set.add` because it's not chainable in IE 11.
95
+ set.add(value);
96
+ return set;
97
+ }
98
+ /**
99
+ * A specialized version of `_.forEach` for arrays without support for
100
+ * iteratee shorthands.
101
+ *
102
+ * @private
103
+ * @param {Array} [array] The array to iterate over.
104
+ * @param {Function} iteratee The function invoked per iteration.
105
+ * @returns {Array} Returns `array`.
106
+ */
107
+ function arrayEach(array, iteratee) {
108
+ var index = -1,
109
+ length = array ? array.length : 0;
110
+ while (++index < length) {
111
+ if (iteratee(array[index], index, array) === false) {
112
+ break;
113
+ }
114
+ }
115
+ return array;
116
+ }
117
+ /**
118
+ * Appends the elements of `values` to `array`.
119
+ *
120
+ * @private
121
+ * @param {Array} array The array to modify.
122
+ * @param {Array} values The values to append.
123
+ * @returns {Array} Returns `array`.
124
+ */
125
+ function arrayPush(array, values) {
126
+ var index = -1,
127
+ length = values.length,
128
+ offset = array.length;
129
+ while (++index < length) {
130
+ array[offset + index] = values[index];
131
+ }
132
+ return array;
133
+ }
134
+ /**
135
+ * A specialized version of `_.reduce` for arrays without support for
136
+ * iteratee shorthands.
137
+ *
138
+ * @private
139
+ * @param {Array} [array] The array to iterate over.
140
+ * @param {Function} iteratee The function invoked per iteration.
141
+ * @param {*} [accumulator] The initial value.
142
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
143
+ * the initial value.
144
+ * @returns {*} Returns the accumulated value.
145
+ */
146
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
147
+ var index = -1,
148
+ length = array ? array.length : 0;
149
+ if (initAccum && length) {
150
+ accumulator = array[++index];
151
+ }
152
+ while (++index < length) {
153
+ accumulator = iteratee(accumulator, array[index], index, array);
154
+ }
155
+ return accumulator;
156
+ }
157
+ /**
158
+ * The base implementation of `_.times` without support for iteratee shorthands
159
+ * or max array length checks.
160
+ *
161
+ * @private
162
+ * @param {number} n The number of times to invoke `iteratee`.
163
+ * @param {Function} iteratee The function invoked per iteration.
164
+ * @returns {Array} Returns the array of results.
165
+ */
166
+ function baseTimes(n, iteratee) {
167
+ var index = -1,
168
+ result = Array(n);
169
+ while (++index < n) {
170
+ result[index] = iteratee(index);
171
+ }
172
+ return result;
173
+ }
174
+ /**
175
+ * Gets the value at `key` of `object`.
176
+ *
177
+ * @private
178
+ * @param {Object} [object] The object to query.
179
+ * @param {string} key The key of the property to get.
180
+ * @returns {*} Returns the property value.
181
+ */
182
+ function getValue(object, key) {
183
+ return object == null ? undefined : object[key];
184
+ }
185
+ /**
186
+ * Checks if `value` is a host object in IE < 9.
187
+ *
188
+ * @private
189
+ * @param {*} value The value to check.
190
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
191
+ */
192
+ function isHostObject(value) {
193
+ // Many host objects are `Object` objects that can coerce to strings
194
+ // despite having improperly defined `toString` methods.
195
+ var result = false;
196
+ if (value != null && typeof value.toString != 'function') {
197
+ try {
198
+ result = !!(value + '');
199
+ } catch (e) {}
200
+ }
201
+ return result;
202
+ }
203
+ /**
204
+ * Converts `map` to its key-value pairs.
205
+ *
206
+ * @private
207
+ * @param {Object} map The map to convert.
208
+ * @returns {Array} Returns the key-value pairs.
209
+ */
210
+ function mapToArray(map) {
211
+ var index = -1,
212
+ result = Array(map.size);
213
+ map.forEach(function (value, key) {
214
+ result[++index] = [key, value];
215
+ });
216
+ return result;
217
+ }
218
+ /**
219
+ * Creates a unary function that invokes `func` with its argument transformed.
220
+ *
221
+ * @private
222
+ * @param {Function} func The function to wrap.
223
+ * @param {Function} transform The argument transform.
224
+ * @returns {Function} Returns the new function.
225
+ */
226
+ function overArg(func, transform) {
227
+ return function (arg) {
228
+ return func(transform(arg));
229
+ };
230
+ }
231
+ /**
232
+ * Converts `set` to an array of its values.
233
+ *
234
+ * @private
235
+ * @param {Object} set The set to convert.
236
+ * @returns {Array} Returns the values.
237
+ */
238
+ function setToArray(set) {
239
+ var index = -1,
240
+ result = Array(set.size);
241
+ set.forEach(function (value) {
242
+ result[++index] = value;
243
+ });
244
+ return result;
245
+ }
246
+ /** Used for built-in method references. */
247
+ var arrayProto = Array.prototype,
248
+ funcProto = Function.prototype,
249
+ objectProto = Object.prototype;
250
+ /** Used to detect overreaching core-js shims. */
251
+ var coreJsData = root['__core-js_shared__'];
252
+ /** Used to detect methods masquerading as native. */
253
+ var maskSrcKey = function () {
254
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
255
+ return uid ? 'Symbol(src)_1.' + uid : '';
256
+ }();
257
+ /** Used to resolve the decompiled source of functions. */
258
+ var funcToString = funcProto.toString;
259
+ /** Used to check objects for own properties. */
260
+ var hasOwnProperty = objectProto.hasOwnProperty;
261
+ /**
262
+ * Used to resolve the
263
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
264
+ * of values.
265
+ */
266
+ var objectToString = objectProto.toString;
267
+ /** Used to detect if a method is native. */
268
+ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
269
+ /** Built-in value references. */
270
+ var Buffer = moduleExports ? root.Buffer : undefined,
271
+ _Symbol = root.Symbol,
272
+ Uint8Array = root.Uint8Array,
273
+ getPrototype = overArg(Object.getPrototypeOf, Object),
274
+ objectCreate = Object.create,
275
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
276
+ splice = arrayProto.splice;
277
+ /* Built-in method references for those with the same name as other `lodash` methods. */
278
+ var nativeGetSymbols = Object.getOwnPropertySymbols,
279
+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
280
+ nativeKeys = overArg(Object.keys, Object);
281
+ /* Built-in method references that are verified to be native. */
282
+ var DataView = getNative(root, 'DataView'),
283
+ Map = getNative(root, 'Map'),
284
+ Promise = getNative(root, 'Promise'),
285
+ Set = getNative(root, 'Set'),
286
+ WeakMap = getNative(root, 'WeakMap'),
287
+ nativeCreate = getNative(Object, 'create');
288
+ /** Used to detect maps, sets, and weakmaps. */
289
+ var dataViewCtorString = toSource(DataView),
290
+ mapCtorString = toSource(Map),
291
+ promiseCtorString = toSource(Promise),
292
+ setCtorString = toSource(Set),
293
+ weakMapCtorString = toSource(WeakMap);
294
+ /** Used to convert symbols to primitives and strings. */
295
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
296
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
297
+ /**
298
+ * Creates a hash object.
299
+ *
300
+ * @private
301
+ * @constructor
302
+ * @param {Array} [entries] The key-value pairs to cache.
303
+ */
304
+ function Hash(entries) {
305
+ var index = -1,
306
+ length = entries ? entries.length : 0;
307
+ this.clear();
308
+ while (++index < length) {
309
+ var entry = entries[index];
310
+ this.set(entry[0], entry[1]);
311
+ }
312
+ }
313
+ /**
314
+ * Removes all key-value entries from the hash.
315
+ *
316
+ * @private
317
+ * @name clear
318
+ * @memberOf Hash
319
+ */
320
+ function hashClear() {
321
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
322
+ }
323
+ /**
324
+ * Removes `key` and its value from the hash.
325
+ *
326
+ * @private
327
+ * @name delete
328
+ * @memberOf Hash
329
+ * @param {Object} hash The hash to modify.
330
+ * @param {string} key The key of the value to remove.
331
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
332
+ */
333
+ function hashDelete(key) {
334
+ return this.has(key) && delete this.__data__[key];
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.call(data, key) ? data[key] : undefined;
352
+ }
353
+ /**
354
+ * Checks if a hash value for `key` exists.
355
+ *
356
+ * @private
357
+ * @name has
358
+ * @memberOf Hash
359
+ * @param {string} key The key of the entry to check.
360
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
361
+ */
362
+ function hashHas(key) {
363
+ var data = this.__data__;
364
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
365
+ }
366
+ /**
367
+ * Sets the hash `key` to `value`.
368
+ *
369
+ * @private
370
+ * @name set
371
+ * @memberOf Hash
372
+ * @param {string} key The key of the value to set.
373
+ * @param {*} value The value to set.
374
+ * @returns {Object} Returns the hash instance.
375
+ */
376
+ function hashSet(key, value) {
377
+ var data = this.__data__;
378
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
379
+ return this;
380
+ }
381
+ // Add methods to `Hash`.
382
+ Hash.prototype.clear = hashClear;
383
+ Hash.prototype['delete'] = hashDelete;
384
+ Hash.prototype.get = hashGet;
385
+ Hash.prototype.has = hashHas;
386
+ Hash.prototype.set = hashSet;
387
+ /**
388
+ * Creates an list cache object.
389
+ *
390
+ * @private
391
+ * @constructor
392
+ * @param {Array} [entries] The key-value pairs to cache.
393
+ */
394
+ function ListCache(entries) {
395
+ var index = -1,
396
+ length = entries ? entries.length : 0;
397
+ this.clear();
398
+ while (++index < length) {
399
+ var entry = entries[index];
400
+ this.set(entry[0], entry[1]);
401
+ }
402
+ }
403
+ /**
404
+ * Removes all key-value entries from the list cache.
405
+ *
406
+ * @private
407
+ * @name clear
408
+ * @memberOf ListCache
409
+ */
410
+ function listCacheClear() {
411
+ this.__data__ = [];
412
+ }
413
+ /**
414
+ * Removes `key` and its value from the list cache.
415
+ *
416
+ * @private
417
+ * @name delete
418
+ * @memberOf ListCache
419
+ * @param {string} key The key of the value to remove.
420
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
421
+ */
422
+ function listCacheDelete(key) {
423
+ var data = this.__data__,
424
+ index = assocIndexOf(data, key);
425
+ if (index < 0) {
426
+ return false;
427
+ }
428
+ var lastIndex = data.length - 1;
429
+ if (index == lastIndex) {
430
+ data.pop();
431
+ } else {
432
+ splice.call(data, index, 1);
433
+ }
434
+ return true;
435
+ }
436
+ /**
437
+ * Gets the list cache value for `key`.
438
+ *
439
+ * @private
440
+ * @name get
441
+ * @memberOf ListCache
442
+ * @param {string} key The key of the value to get.
443
+ * @returns {*} Returns the entry value.
444
+ */
445
+ function listCacheGet(key) {
446
+ var data = this.__data__,
447
+ index = assocIndexOf(data, key);
448
+ return index < 0 ? undefined : data[index][1];
449
+ }
450
+ /**
451
+ * Checks if a list cache value for `key` exists.
452
+ *
453
+ * @private
454
+ * @name has
455
+ * @memberOf ListCache
456
+ * @param {string} key The key of the entry to check.
457
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
458
+ */
459
+ function listCacheHas(key) {
460
+ return assocIndexOf(this.__data__, key) > -1;
461
+ }
462
+ /**
463
+ * Sets the list cache `key` to `value`.
464
+ *
465
+ * @private
466
+ * @name set
467
+ * @memberOf ListCache
468
+ * @param {string} key The key of the value to set.
469
+ * @param {*} value The value to set.
470
+ * @returns {Object} Returns the list cache instance.
471
+ */
472
+ function listCacheSet(key, value) {
473
+ var data = this.__data__,
474
+ index = assocIndexOf(data, key);
475
+ if (index < 0) {
476
+ data.push([key, value]);
477
+ } else {
478
+ data[index][1] = value;
479
+ }
480
+ return this;
481
+ }
482
+ // Add methods to `ListCache`.
483
+ ListCache.prototype.clear = listCacheClear;
484
+ ListCache.prototype['delete'] = listCacheDelete;
485
+ ListCache.prototype.get = listCacheGet;
486
+ ListCache.prototype.has = listCacheHas;
487
+ ListCache.prototype.set = listCacheSet;
488
+ /**
489
+ * Creates a map cache object to store key-value pairs.
490
+ *
491
+ * @private
492
+ * @constructor
493
+ * @param {Array} [entries] The key-value pairs to cache.
494
+ */
495
+ function MapCache(entries) {
496
+ var index = -1,
497
+ length = entries ? entries.length : 0;
498
+ this.clear();
499
+ while (++index < length) {
500
+ var entry = entries[index];
501
+ this.set(entry[0], entry[1]);
502
+ }
503
+ }
504
+ /**
505
+ * Removes all key-value entries from the map.
506
+ *
507
+ * @private
508
+ * @name clear
509
+ * @memberOf MapCache
510
+ */
511
+ function mapCacheClear() {
512
+ this.__data__ = {
513
+ hash: new Hash(),
514
+ map: new (Map || ListCache)(),
515
+ string: new Hash()
516
+ };
517
+ }
518
+ /**
519
+ * Removes `key` and its value from the map.
520
+ *
521
+ * @private
522
+ * @name delete
523
+ * @memberOf MapCache
524
+ * @param {string} key The key of the value to remove.
525
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
526
+ */
527
+ function mapCacheDelete(key) {
528
+ return getMapData(this, key)['delete'](key);
529
+ }
530
+ /**
531
+ * Gets the map value for `key`.
532
+ *
533
+ * @private
534
+ * @name get
535
+ * @memberOf MapCache
536
+ * @param {string} key The key of the value to get.
537
+ * @returns {*} Returns the entry value.
538
+ */
539
+ function mapCacheGet(key) {
540
+ return getMapData(this, key).get(key);
541
+ }
542
+ /**
543
+ * Checks if a map value for `key` exists.
544
+ *
545
+ * @private
546
+ * @name has
547
+ * @memberOf MapCache
548
+ * @param {string} key The key of the entry to check.
549
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
550
+ */
551
+ function mapCacheHas(key) {
552
+ return getMapData(this, key).has(key);
553
+ }
554
+ /**
555
+ * Sets the map `key` to `value`.
556
+ *
557
+ * @private
558
+ * @name set
559
+ * @memberOf MapCache
560
+ * @param {string} key The key of the value to set.
561
+ * @param {*} value The value to set.
562
+ * @returns {Object} Returns the map cache instance.
563
+ */
564
+ function mapCacheSet(key, value) {
565
+ getMapData(this, key).set(key, value);
566
+ return this;
567
+ }
568
+ // Add methods to `MapCache`.
569
+ MapCache.prototype.clear = mapCacheClear;
570
+ MapCache.prototype['delete'] = mapCacheDelete;
571
+ MapCache.prototype.get = mapCacheGet;
572
+ MapCache.prototype.has = mapCacheHas;
573
+ MapCache.prototype.set = mapCacheSet;
574
+ /**
575
+ * Creates a stack cache object to store key-value pairs.
576
+ *
577
+ * @private
578
+ * @constructor
579
+ * @param {Array} [entries] The key-value pairs to cache.
580
+ */
581
+ function Stack(entries) {
582
+ this.__data__ = new ListCache(entries);
583
+ }
584
+ /**
585
+ * Removes all key-value entries from the stack.
586
+ *
587
+ * @private
588
+ * @name clear
589
+ * @memberOf Stack
590
+ */
591
+ function stackClear() {
592
+ this.__data__ = new ListCache();
593
+ }
594
+ /**
595
+ * Removes `key` and its value from the stack.
596
+ *
597
+ * @private
598
+ * @name delete
599
+ * @memberOf Stack
600
+ * @param {string} key The key of the value to remove.
601
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
602
+ */
603
+ function stackDelete(key) {
604
+ return this.__data__['delete'](key);
605
+ }
606
+ /**
607
+ * Gets the stack value for `key`.
608
+ *
609
+ * @private
610
+ * @name get
611
+ * @memberOf Stack
612
+ * @param {string} key The key of the value to get.
613
+ * @returns {*} Returns the entry value.
614
+ */
615
+ function stackGet(key) {
616
+ return this.__data__.get(key);
617
+ }
618
+ /**
619
+ * Checks if a stack value for `key` exists.
620
+ *
621
+ * @private
622
+ * @name has
623
+ * @memberOf Stack
624
+ * @param {string} key The key of the entry to check.
625
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
626
+ */
627
+ function stackHas(key) {
628
+ return this.__data__.has(key);
629
+ }
630
+ /**
631
+ * Sets the stack `key` to `value`.
632
+ *
633
+ * @private
634
+ * @name set
635
+ * @memberOf Stack
636
+ * @param {string} key The key of the value to set.
637
+ * @param {*} value The value to set.
638
+ * @returns {Object} Returns the stack cache instance.
639
+ */
640
+ function stackSet(key, value) {
641
+ var cache = this.__data__;
642
+ if (cache instanceof ListCache) {
643
+ var pairs = cache.__data__;
644
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
645
+ pairs.push([key, value]);
646
+ return this;
647
+ }
648
+ cache = this.__data__ = new MapCache(pairs);
649
+ }
650
+ cache.set(key, value);
651
+ return this;
652
+ }
653
+ // Add methods to `Stack`.
654
+ Stack.prototype.clear = stackClear;
655
+ Stack.prototype['delete'] = stackDelete;
656
+ Stack.prototype.get = stackGet;
657
+ Stack.prototype.has = stackHas;
658
+ Stack.prototype.set = stackSet;
659
+ /**
660
+ * Creates an array of the enumerable property names of the array-like `value`.
661
+ *
662
+ * @private
663
+ * @param {*} value The value to query.
664
+ * @param {boolean} inherited Specify returning inherited property names.
665
+ * @returns {Array} Returns the array of property names.
666
+ */
667
+ function arrayLikeKeys(value, inherited) {
668
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
669
+ // Safari 9 makes `arguments.length` enumerable in strict mode.
670
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
671
+ var length = result.length,
672
+ skipIndexes = !!length;
673
+ for (var key in value) {
674
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
675
+ result.push(key);
676
+ }
677
+ }
678
+ return result;
679
+ }
680
+ /**
681
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
682
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
683
+ * for equality comparisons.
684
+ *
685
+ * @private
686
+ * @param {Object} object The object to modify.
687
+ * @param {string} key The key of the property to assign.
688
+ * @param {*} value The value to assign.
689
+ */
690
+ function assignValue(object, key, value) {
691
+ var objValue = object[key];
692
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
693
+ object[key] = value;
694
+ }
695
+ }
696
+ /**
697
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
698
+ *
699
+ * @private
700
+ * @param {Array} array The array to inspect.
701
+ * @param {*} key The key to search for.
702
+ * @returns {number} Returns the index of the matched value, else `-1`.
703
+ */
704
+ function assocIndexOf(array, key) {
705
+ var length = array.length;
706
+ while (length--) {
707
+ if (eq(array[length][0], key)) {
708
+ return length;
709
+ }
710
+ }
711
+ return -1;
712
+ }
713
+ /**
714
+ * The base implementation of `_.assign` without support for multiple sources
715
+ * or `customizer` functions.
716
+ *
717
+ * @private
718
+ * @param {Object} object The destination object.
719
+ * @param {Object} source The source object.
720
+ * @returns {Object} Returns `object`.
721
+ */
722
+ function baseAssign(object, source) {
723
+ return object && copyObject(source, keys(source), object);
724
+ }
725
+ /**
726
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
727
+ * traversed objects.
728
+ *
729
+ * @private
730
+ * @param {*} value The value to clone.
731
+ * @param {boolean} [isDeep] Specify a deep clone.
732
+ * @param {boolean} [isFull] Specify a clone including symbols.
733
+ * @param {Function} [customizer] The function to customize cloning.
734
+ * @param {string} [key] The key of `value`.
735
+ * @param {Object} [object] The parent object of `value`.
736
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
737
+ * @returns {*} Returns the cloned value.
738
+ */
739
+ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
740
+ var result;
741
+ if (customizer) {
742
+ result = object ? customizer(value, key, object, stack) : customizer(value);
743
+ }
744
+ if (result !== undefined) {
745
+ return result;
746
+ }
747
+ if (!isObject(value)) {
748
+ return value;
749
+ }
750
+ var isArr = isArray(value);
751
+ if (isArr) {
752
+ result = initCloneArray(value);
753
+ if (!isDeep) {
754
+ return copyArray(value, result);
755
+ }
756
+ } else {
757
+ var tag = getTag(value),
758
+ isFunc = tag == funcTag || tag == genTag;
759
+ if (isBuffer(value)) {
760
+ return cloneBuffer(value, isDeep);
761
+ }
762
+ if (tag == objectTag || tag == argsTag || isFunc && !object) {
763
+ if (isHostObject(value)) {
764
+ return object ? value : {};
765
+ }
766
+ result = initCloneObject(isFunc ? {} : value);
767
+ if (!isDeep) {
768
+ return copySymbols(value, baseAssign(result, value));
769
+ }
770
+ } else {
771
+ if (!cloneableTags[tag]) {
772
+ return object ? value : {};
773
+ }
774
+ result = initCloneByTag(value, tag, baseClone, isDeep);
775
+ }
776
+ }
777
+ // Check for circular references and return its corresponding clone.
778
+ stack || (stack = new Stack());
779
+ var stacked = stack.get(value);
780
+ if (stacked) {
781
+ return stacked;
782
+ }
783
+ stack.set(value, result);
784
+ if (!isArr) {
785
+ var props = isFull ? getAllKeys(value) : keys(value);
786
+ }
787
+ arrayEach(props || value, function (subValue, key) {
788
+ if (props) {
789
+ key = subValue;
790
+ subValue = value[key];
791
+ }
792
+ // Recursively populate clone (susceptible to call stack limits).
793
+ assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
794
+ });
795
+ return result;
796
+ }
797
+ /**
798
+ * The base implementation of `_.create` without support for assigning
799
+ * properties to the created object.
800
+ *
801
+ * @private
802
+ * @param {Object} prototype The object to inherit from.
803
+ * @returns {Object} Returns the new object.
804
+ */
805
+ function baseCreate(proto) {
806
+ return isObject(proto) ? objectCreate(proto) : {};
807
+ }
808
+ /**
809
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
810
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
811
+ * symbols of `object`.
812
+ *
813
+ * @private
814
+ * @param {Object} object The object to query.
815
+ * @param {Function} keysFunc The function to get the keys of `object`.
816
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
817
+ * @returns {Array} Returns the array of property names and symbols.
818
+ */
819
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
820
+ var result = keysFunc(object);
821
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
822
+ }
823
+ /**
824
+ * The base implementation of `getTag`.
825
+ *
826
+ * @private
827
+ * @param {*} value The value to query.
828
+ * @returns {string} Returns the `toStringTag`.
829
+ */
830
+ function baseGetTag(value) {
831
+ return objectToString.call(value);
832
+ }
833
+ /**
834
+ * The base implementation of `_.isNative` without bad shim checks.
835
+ *
836
+ * @private
837
+ * @param {*} value The value to check.
838
+ * @returns {boolean} Returns `true` if `value` is a native function,
839
+ * else `false`.
840
+ */
841
+ function baseIsNative(value) {
842
+ if (!isObject(value) || isMasked(value)) {
843
+ return false;
844
+ }
845
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
846
+ return pattern.test(toSource(value));
847
+ }
848
+ /**
849
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
850
+ *
851
+ * @private
852
+ * @param {Object} object The object to query.
853
+ * @returns {Array} Returns the array of property names.
854
+ */
855
+ function baseKeys(object) {
856
+ if (!isPrototype(object)) {
857
+ return nativeKeys(object);
858
+ }
859
+ var result = [];
860
+ for (var key in Object(object)) {
861
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
862
+ result.push(key);
863
+ }
864
+ }
865
+ return result;
866
+ }
867
+ /**
868
+ * Creates a clone of `buffer`.
869
+ *
870
+ * @private
871
+ * @param {Buffer} buffer The buffer to clone.
872
+ * @param {boolean} [isDeep] Specify a deep clone.
873
+ * @returns {Buffer} Returns the cloned buffer.
874
+ */
875
+ function cloneBuffer(buffer, isDeep) {
876
+ if (isDeep) {
877
+ return buffer.slice();
878
+ }
879
+ var result = new buffer.constructor(buffer.length);
880
+ buffer.copy(result);
881
+ return result;
882
+ }
883
+ /**
884
+ * Creates a clone of `arrayBuffer`.
885
+ *
886
+ * @private
887
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
888
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
889
+ */
890
+ function cloneArrayBuffer(arrayBuffer) {
891
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
892
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
893
+ return result;
894
+ }
895
+ /**
896
+ * Creates a clone of `dataView`.
897
+ *
898
+ * @private
899
+ * @param {Object} dataView The data view to clone.
900
+ * @param {boolean} [isDeep] Specify a deep clone.
901
+ * @returns {Object} Returns the cloned data view.
902
+ */
903
+ function cloneDataView(dataView, isDeep) {
904
+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
905
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
906
+ }
907
+ /**
908
+ * Creates a clone of `map`.
909
+ *
910
+ * @private
911
+ * @param {Object} map The map to clone.
912
+ * @param {Function} cloneFunc The function to clone values.
913
+ * @param {boolean} [isDeep] Specify a deep clone.
914
+ * @returns {Object} Returns the cloned map.
915
+ */
916
+ function cloneMap(map, isDeep, cloneFunc) {
917
+ var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
918
+ return arrayReduce(array, addMapEntry, new map.constructor());
919
+ }
920
+ /**
921
+ * Creates a clone of `regexp`.
922
+ *
923
+ * @private
924
+ * @param {Object} regexp The regexp to clone.
925
+ * @returns {Object} Returns the cloned regexp.
926
+ */
927
+ function cloneRegExp(regexp) {
928
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
929
+ result.lastIndex = regexp.lastIndex;
930
+ return result;
931
+ }
932
+ /**
933
+ * Creates a clone of `set`.
934
+ *
935
+ * @private
936
+ * @param {Object} set The set to clone.
937
+ * @param {Function} cloneFunc The function to clone values.
938
+ * @param {boolean} [isDeep] Specify a deep clone.
939
+ * @returns {Object} Returns the cloned set.
940
+ */
941
+ function cloneSet(set, isDeep, cloneFunc) {
942
+ var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
943
+ return arrayReduce(array, addSetEntry, new set.constructor());
944
+ }
945
+ /**
946
+ * Creates a clone of the `symbol` object.
947
+ *
948
+ * @private
949
+ * @param {Object} symbol The symbol object to clone.
950
+ * @returns {Object} Returns the cloned symbol object.
951
+ */
952
+ function cloneSymbol(symbol) {
953
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
954
+ }
955
+ /**
956
+ * Creates a clone of `typedArray`.
957
+ *
958
+ * @private
959
+ * @param {Object} typedArray The typed array to clone.
960
+ * @param {boolean} [isDeep] Specify a deep clone.
961
+ * @returns {Object} Returns the cloned typed array.
962
+ */
963
+ function cloneTypedArray(typedArray, isDeep) {
964
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
965
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
966
+ }
967
+ /**
968
+ * Copies the values of `source` to `array`.
969
+ *
970
+ * @private
971
+ * @param {Array} source The array to copy values from.
972
+ * @param {Array} [array=[]] The array to copy values to.
973
+ * @returns {Array} Returns `array`.
974
+ */
975
+ function copyArray(source, array) {
976
+ var index = -1,
977
+ length = source.length;
978
+ array || (array = Array(length));
979
+ while (++index < length) {
980
+ array[index] = source[index];
981
+ }
982
+ return array;
983
+ }
984
+ /**
985
+ * Copies properties of `source` to `object`.
986
+ *
987
+ * @private
988
+ * @param {Object} source The object to copy properties from.
989
+ * @param {Array} props The property identifiers to copy.
990
+ * @param {Object} [object={}] The object to copy properties to.
991
+ * @param {Function} [customizer] The function to customize copied values.
992
+ * @returns {Object} Returns `object`.
993
+ */
994
+ function copyObject(source, props, object, customizer) {
995
+ object || (object = {});
996
+ var index = -1,
997
+ length = props.length;
998
+ while (++index < length) {
999
+ var key = props[index];
1000
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
1001
+ assignValue(object, key, newValue === undefined ? source[key] : newValue);
1002
+ }
1003
+ return object;
1004
+ }
1005
+ /**
1006
+ * Copies own symbol properties of `source` to `object`.
1007
+ *
1008
+ * @private
1009
+ * @param {Object} source The object to copy symbols from.
1010
+ * @param {Object} [object={}] The object to copy symbols to.
1011
+ * @returns {Object} Returns `object`.
1012
+ */
1013
+ function copySymbols(source, object) {
1014
+ return copyObject(source, getSymbols(source), object);
1015
+ }
1016
+ /**
1017
+ * Creates an array of own enumerable property names and symbols of `object`.
1018
+ *
1019
+ * @private
1020
+ * @param {Object} object The object to query.
1021
+ * @returns {Array} Returns the array of property names and symbols.
1022
+ */
1023
+ function getAllKeys(object) {
1024
+ return baseGetAllKeys(object, keys, getSymbols);
1025
+ }
1026
+ /**
1027
+ * Gets the data for `map`.
1028
+ *
1029
+ * @private
1030
+ * @param {Object} map The map to query.
1031
+ * @param {string} key The reference key.
1032
+ * @returns {*} Returns the map data.
1033
+ */
1034
+ function getMapData(map, key) {
1035
+ var data = map.__data__;
1036
+ return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
1037
+ }
1038
+ /**
1039
+ * Gets the native function at `key` of `object`.
1040
+ *
1041
+ * @private
1042
+ * @param {Object} object The object to query.
1043
+ * @param {string} key The key of the method to get.
1044
+ * @returns {*} Returns the function if it's native, else `undefined`.
1045
+ */
1046
+ function getNative(object, key) {
1047
+ var value = getValue(object, key);
1048
+ return baseIsNative(value) ? value : undefined;
1049
+ }
1050
+ /**
1051
+ * Creates an array of the own enumerable symbol properties of `object`.
1052
+ *
1053
+ * @private
1054
+ * @param {Object} object The object to query.
1055
+ * @returns {Array} Returns the array of symbols.
1056
+ */
1057
+ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
1058
+ /**
1059
+ * Gets the `toStringTag` of `value`.
1060
+ *
1061
+ * @private
1062
+ * @param {*} value The value to query.
1063
+ * @returns {string} Returns the `toStringTag`.
1064
+ */
1065
+ var getTag = baseGetTag;
1066
+ // Fallback for data views, maps, sets, and weak maps in IE 11,
1067
+ // for data views in Edge < 14, and promises in Node.js.
1068
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
1069
+ getTag = function getTag(value) {
1070
+ var result = objectToString.call(value),
1071
+ Ctor = result == objectTag ? value.constructor : undefined,
1072
+ ctorString = Ctor ? toSource(Ctor) : undefined;
1073
+ if (ctorString) {
1074
+ switch (ctorString) {
1075
+ case dataViewCtorString:
1076
+ return dataViewTag;
1077
+ case mapCtorString:
1078
+ return mapTag;
1079
+ case promiseCtorString:
1080
+ return promiseTag;
1081
+ case setCtorString:
1082
+ return setTag;
1083
+ case weakMapCtorString:
1084
+ return weakMapTag;
1085
+ }
1086
+ }
1087
+ return result;
1088
+ };
1089
+ }
1090
+ /**
1091
+ * Initializes an array clone.
1092
+ *
1093
+ * @private
1094
+ * @param {Array} array The array to clone.
1095
+ * @returns {Array} Returns the initialized clone.
1096
+ */
1097
+ function initCloneArray(array) {
1098
+ var length = array.length,
1099
+ result = array.constructor(length);
1100
+ // Add properties assigned by `RegExp#exec`.
1101
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
1102
+ result.index = array.index;
1103
+ result.input = array.input;
1104
+ }
1105
+ return result;
1106
+ }
1107
+ /**
1108
+ * Initializes an object clone.
1109
+ *
1110
+ * @private
1111
+ * @param {Object} object The object to clone.
1112
+ * @returns {Object} Returns the initialized clone.
1113
+ */
1114
+ function initCloneObject(object) {
1115
+ return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
1116
+ }
1117
+ /**
1118
+ * Initializes an object clone based on its `toStringTag`.
1119
+ *
1120
+ * **Note:** This function only supports cloning values with tags of
1121
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1122
+ *
1123
+ * @private
1124
+ * @param {Object} object The object to clone.
1125
+ * @param {string} tag The `toStringTag` of the object to clone.
1126
+ * @param {Function} cloneFunc The function to clone values.
1127
+ * @param {boolean} [isDeep] Specify a deep clone.
1128
+ * @returns {Object} Returns the initialized clone.
1129
+ */
1130
+ function initCloneByTag(object, tag, cloneFunc, isDeep) {
1131
+ var Ctor = object.constructor;
1132
+ switch (tag) {
1133
+ case arrayBufferTag:
1134
+ return cloneArrayBuffer(object);
1135
+ case boolTag:
1136
+ case dateTag:
1137
+ return new Ctor(+object);
1138
+ case dataViewTag:
1139
+ return cloneDataView(object, isDeep);
1140
+ case float32Tag:
1141
+ case float64Tag:
1142
+ case int8Tag:
1143
+ case int16Tag:
1144
+ case int32Tag:
1145
+ case uint8Tag:
1146
+ case uint8ClampedTag:
1147
+ case uint16Tag:
1148
+ case uint32Tag:
1149
+ return cloneTypedArray(object, isDeep);
1150
+ case mapTag:
1151
+ return cloneMap(object, isDeep, cloneFunc);
1152
+ case numberTag:
1153
+ case stringTag:
1154
+ return new Ctor(object);
1155
+ case regexpTag:
1156
+ return cloneRegExp(object);
1157
+ case setTag:
1158
+ return cloneSet(object, isDeep, cloneFunc);
1159
+ case symbolTag:
1160
+ return cloneSymbol(object);
1161
+ }
1162
+ }
1163
+ /**
1164
+ * Checks if `value` is a valid array-like index.
1165
+ *
1166
+ * @private
1167
+ * @param {*} value The value to check.
1168
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1169
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1170
+ */
1171
+ function isIndex(value, length) {
1172
+ length = length == null ? MAX_SAFE_INTEGER : length;
1173
+ return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1174
+ }
1175
+ /**
1176
+ * Checks if `value` is suitable for use as unique object key.
1177
+ *
1178
+ * @private
1179
+ * @param {*} value The value to check.
1180
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1181
+ */
1182
+ function isKeyable(value) {
1183
+ var type = _typeof(value);
1184
+ return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
1185
+ }
1186
+ /**
1187
+ * Checks if `func` has its source masked.
1188
+ *
1189
+ * @private
1190
+ * @param {Function} func The function to check.
1191
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1192
+ */
1193
+ function isMasked(func) {
1194
+ return !!maskSrcKey && maskSrcKey in func;
1195
+ }
1196
+ /**
1197
+ * Checks if `value` is likely a prototype object.
1198
+ *
1199
+ * @private
1200
+ * @param {*} value The value to check.
1201
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1202
+ */
1203
+ function isPrototype(value) {
1204
+ var Ctor = value && value.constructor,
1205
+ proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
1206
+ return value === proto;
1207
+ }
1208
+ /**
1209
+ * Converts `func` to its source code.
1210
+ *
1211
+ * @private
1212
+ * @param {Function} func The function to process.
1213
+ * @returns {string} Returns the source code.
1214
+ */
1215
+ function toSource(func) {
1216
+ if (func != null) {
1217
+ try {
1218
+ return funcToString.call(func);
1219
+ } catch (e) {}
1220
+ try {
1221
+ return func + '';
1222
+ } catch (e) {}
1223
+ }
1224
+ return '';
1225
+ }
1226
+ /**
1227
+ * This method is like `_.clone` except that it recursively clones `value`.
1228
+ *
1229
+ * @static
1230
+ * @memberOf _
1231
+ * @since 1.0.0
1232
+ * @category Lang
1233
+ * @param {*} value The value to recursively clone.
1234
+ * @returns {*} Returns the deep cloned value.
1235
+ * @see _.clone
1236
+ * @example
1237
+ *
1238
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
1239
+ *
1240
+ * var deep = _.cloneDeep(objects);
1241
+ * console.log(deep[0] === objects[0]);
1242
+ * // => false
1243
+ */
1244
+ function cloneDeep(value) {
1245
+ return baseClone(value, true, true);
1246
+ }
1247
+ /**
1248
+ * Performs a
1249
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1250
+ * comparison between two values to determine if they are equivalent.
1251
+ *
1252
+ * @static
1253
+ * @memberOf _
1254
+ * @since 4.0.0
1255
+ * @category Lang
1256
+ * @param {*} value The value to compare.
1257
+ * @param {*} other The other value to compare.
1258
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1259
+ * @example
1260
+ *
1261
+ * var object = { 'a': 1 };
1262
+ * var other = { 'a': 1 };
1263
+ *
1264
+ * _.eq(object, object);
1265
+ * // => true
1266
+ *
1267
+ * _.eq(object, other);
1268
+ * // => false
1269
+ *
1270
+ * _.eq('a', 'a');
1271
+ * // => true
1272
+ *
1273
+ * _.eq('a', Object('a'));
1274
+ * // => false
1275
+ *
1276
+ * _.eq(NaN, NaN);
1277
+ * // => true
1278
+ */
1279
+ function eq(value, other) {
1280
+ return value === other || value !== value && other !== other;
1281
+ }
1282
+ /**
1283
+ * Checks if `value` is likely an `arguments` object.
1284
+ *
1285
+ * @static
1286
+ * @memberOf _
1287
+ * @since 0.1.0
1288
+ * @category Lang
1289
+ * @param {*} value The value to check.
1290
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1291
+ * else `false`.
1292
+ * @example
1293
+ *
1294
+ * _.isArguments(function() { return arguments; }());
1295
+ * // => true
1296
+ *
1297
+ * _.isArguments([1, 2, 3]);
1298
+ * // => false
1299
+ */
1300
+ function isArguments(value) {
1301
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
1302
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
1303
+ }
1304
+ /**
1305
+ * Checks if `value` is classified as an `Array` object.
1306
+ *
1307
+ * @static
1308
+ * @memberOf _
1309
+ * @since 0.1.0
1310
+ * @category Lang
1311
+ * @param {*} value The value to check.
1312
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1313
+ * @example
1314
+ *
1315
+ * _.isArray([1, 2, 3]);
1316
+ * // => true
1317
+ *
1318
+ * _.isArray(document.body.children);
1319
+ * // => false
1320
+ *
1321
+ * _.isArray('abc');
1322
+ * // => false
1323
+ *
1324
+ * _.isArray(_.noop);
1325
+ * // => false
1326
+ */
1327
+ var isArray = Array.isArray;
1328
+ /**
1329
+ * Checks if `value` is array-like. A value is considered array-like if it's
1330
+ * not a function and has a `value.length` that's an integer greater than or
1331
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1332
+ *
1333
+ * @static
1334
+ * @memberOf _
1335
+ * @since 4.0.0
1336
+ * @category Lang
1337
+ * @param {*} value The value to check.
1338
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1339
+ * @example
1340
+ *
1341
+ * _.isArrayLike([1, 2, 3]);
1342
+ * // => true
1343
+ *
1344
+ * _.isArrayLike(document.body.children);
1345
+ * // => true
1346
+ *
1347
+ * _.isArrayLike('abc');
1348
+ * // => true
1349
+ *
1350
+ * _.isArrayLike(_.noop);
1351
+ * // => false
1352
+ */
1353
+ function isArrayLike(value) {
1354
+ return value != null && isLength(value.length) && !isFunction(value);
1355
+ }
1356
+ /**
1357
+ * This method is like `_.isArrayLike` except that it also checks if `value`
1358
+ * is an object.
1359
+ *
1360
+ * @static
1361
+ * @memberOf _
1362
+ * @since 4.0.0
1363
+ * @category Lang
1364
+ * @param {*} value The value to check.
1365
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
1366
+ * else `false`.
1367
+ * @example
1368
+ *
1369
+ * _.isArrayLikeObject([1, 2, 3]);
1370
+ * // => true
1371
+ *
1372
+ * _.isArrayLikeObject(document.body.children);
1373
+ * // => true
1374
+ *
1375
+ * _.isArrayLikeObject('abc');
1376
+ * // => false
1377
+ *
1378
+ * _.isArrayLikeObject(_.noop);
1379
+ * // => false
1380
+ */
1381
+ function isArrayLikeObject(value) {
1382
+ return isObjectLike(value) && isArrayLike(value);
1383
+ }
1384
+ /**
1385
+ * Checks if `value` is a buffer.
1386
+ *
1387
+ * @static
1388
+ * @memberOf _
1389
+ * @since 4.3.0
1390
+ * @category Lang
1391
+ * @param {*} value The value to check.
1392
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1393
+ * @example
1394
+ *
1395
+ * _.isBuffer(new Buffer(2));
1396
+ * // => true
1397
+ *
1398
+ * _.isBuffer(new Uint8Array(2));
1399
+ * // => false
1400
+ */
1401
+ var isBuffer = nativeIsBuffer || stubFalse;
1402
+ /**
1403
+ * Checks if `value` is classified as a `Function` object.
1404
+ *
1405
+ * @static
1406
+ * @memberOf _
1407
+ * @since 0.1.0
1408
+ * @category Lang
1409
+ * @param {*} value The value to check.
1410
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1411
+ * @example
1412
+ *
1413
+ * _.isFunction(_);
1414
+ * // => true
1415
+ *
1416
+ * _.isFunction(/abc/);
1417
+ * // => false
1418
+ */
1419
+ function isFunction(value) {
1420
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1421
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
1422
+ var tag = isObject(value) ? objectToString.call(value) : '';
1423
+ return tag == funcTag || tag == genTag;
1424
+ }
1425
+ /**
1426
+ * Checks if `value` is a valid array-like length.
1427
+ *
1428
+ * **Note:** This method is loosely based on
1429
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1430
+ *
1431
+ * @static
1432
+ * @memberOf _
1433
+ * @since 4.0.0
1434
+ * @category Lang
1435
+ * @param {*} value The value to check.
1436
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1437
+ * @example
1438
+ *
1439
+ * _.isLength(3);
1440
+ * // => true
1441
+ *
1442
+ * _.isLength(Number.MIN_VALUE);
1443
+ * // => false
1444
+ *
1445
+ * _.isLength(Infinity);
1446
+ * // => false
1447
+ *
1448
+ * _.isLength('3');
1449
+ * // => false
1450
+ */
1451
+ function isLength(value) {
1452
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1453
+ }
1454
+ /**
1455
+ * Checks if `value` is the
1456
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1457
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1458
+ *
1459
+ * @static
1460
+ * @memberOf _
1461
+ * @since 0.1.0
1462
+ * @category Lang
1463
+ * @param {*} value The value to check.
1464
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1465
+ * @example
1466
+ *
1467
+ * _.isObject({});
1468
+ * // => true
1469
+ *
1470
+ * _.isObject([1, 2, 3]);
1471
+ * // => true
1472
+ *
1473
+ * _.isObject(_.noop);
1474
+ * // => true
1475
+ *
1476
+ * _.isObject(null);
1477
+ * // => false
1478
+ */
1479
+ function isObject(value) {
1480
+ var type = _typeof(value);
1481
+ return !!value && (type == 'object' || type == 'function');
1482
+ }
1483
+ /**
1484
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1485
+ * and has a `typeof` result of "object".
1486
+ *
1487
+ * @static
1488
+ * @memberOf _
1489
+ * @since 4.0.0
1490
+ * @category Lang
1491
+ * @param {*} value The value to check.
1492
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1493
+ * @example
1494
+ *
1495
+ * _.isObjectLike({});
1496
+ * // => true
1497
+ *
1498
+ * _.isObjectLike([1, 2, 3]);
1499
+ * // => true
1500
+ *
1501
+ * _.isObjectLike(_.noop);
1502
+ * // => false
1503
+ *
1504
+ * _.isObjectLike(null);
1505
+ * // => false
1506
+ */
1507
+ function isObjectLike(value) {
1508
+ return !!value && _typeof(value) == 'object';
1509
+ }
1510
+ /**
1511
+ * Creates an array of the own enumerable property names of `object`.
1512
+ *
1513
+ * **Note:** Non-object values are coerced to objects. See the
1514
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1515
+ * for more details.
1516
+ *
1517
+ * @static
1518
+ * @since 0.1.0
1519
+ * @memberOf _
1520
+ * @category Object
1521
+ * @param {Object} object The object to query.
1522
+ * @returns {Array} Returns the array of property names.
1523
+ * @example
1524
+ *
1525
+ * function Foo() {
1526
+ * this.a = 1;
1527
+ * this.b = 2;
1528
+ * }
1529
+ *
1530
+ * Foo.prototype.c = 3;
1531
+ *
1532
+ * _.keys(new Foo);
1533
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1534
+ *
1535
+ * _.keys('hi');
1536
+ * // => ['0', '1']
1537
+ */
1538
+ function keys(object) {
1539
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1540
+ }
1541
+ /**
1542
+ * This method returns a new empty array.
1543
+ *
1544
+ * @static
1545
+ * @memberOf _
1546
+ * @since 4.13.0
1547
+ * @category Util
1548
+ * @returns {Array} Returns the new empty array.
1549
+ * @example
1550
+ *
1551
+ * var arrays = _.times(2, _.stubArray);
1552
+ *
1553
+ * console.log(arrays);
1554
+ * // => [[], []]
1555
+ *
1556
+ * console.log(arrays[0] === arrays[1]);
1557
+ * // => false
1558
+ */
1559
+ function stubArray() {
1560
+ return [];
1561
+ }
1562
+ /**
1563
+ * This method returns `false`.
1564
+ *
1565
+ * @static
1566
+ * @memberOf _
1567
+ * @since 4.13.0
1568
+ * @category Util
1569
+ * @returns {boolean} Returns `false`.
1570
+ * @example
1571
+ *
1572
+ * _.times(2, _.stubFalse);
1573
+ * // => [false, false]
1574
+ */
1575
+ function stubFalse() {
1576
+ return false;
1577
+ }
1578
+ export default cloneDeep;