@hi-ui/table 4.0.0-beta.13 → 4.0.0-beta.16

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