@kato-lee/utilities 1.0.0

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,826 @@
1
+ let LARGE_ARRAY_SIZE = 200;
2
+ let HASH_UNDEFINED = '__lodash_hash_undefined__';
3
+ let MAX_SAFE_INTEGER = 9007199254740991;
4
+
5
+ let argsTag = '[object Arguments]',
6
+ arrayTag = '[object Array]',
7
+ boolTag = '[object Boolean]',
8
+ dateTag = '[object Date]',
9
+ errorTag = '[object Error]',
10
+ funcTag = '[object Function]',
11
+ genTag = '[object GeneratorFunction]',
12
+ mapTag = '[object Map]',
13
+ numberTag = '[object Number]',
14
+ objectTag = '[object Object]',
15
+ promiseTag = '[object Promise]',
16
+ regexpTag = '[object RegExp]',
17
+ setTag = '[object Set]',
18
+ stringTag = '[object String]',
19
+ symbolTag = '[object Symbol]',
20
+ weakMapTag = '[object WeakMap]';
21
+
22
+ let arrayBufferTag = '[object ArrayBuffer]',
23
+ dataViewTag = '[object DataView]',
24
+ float32Tag = '[object Float32Array]',
25
+ float64Tag = '[object Float64Array]',
26
+ int8Tag = '[object Int8Array]',
27
+ int16Tag = '[object Int16Array]',
28
+ int32Tag = '[object Int32Array]',
29
+ uint8Tag = '[object Uint8Array]',
30
+ uint8ClampedTag = '[object Uint8ClampedArray]',
31
+ uint16Tag = '[object Uint16Array]',
32
+ uint32Tag = '[object Uint32Array]';
33
+
34
+ let reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
35
+ let reFlags = /\w*$/;
36
+ let reIsHostCtor = /^\[object .+?Constructor\]$/;
37
+ let reIsUint = /^(?:0|[1-9]\d*)$/;
38
+
39
+ let cloneableTags = {};
40
+ cloneableTags[argsTag] =
41
+ cloneableTags[arrayTag] =
42
+ cloneableTags[arrayBufferTag] =
43
+ cloneableTags[dataViewTag] =
44
+ cloneableTags[boolTag] =
45
+ cloneableTags[dateTag] =
46
+ cloneableTags[float32Tag] =
47
+ cloneableTags[float64Tag] =
48
+ cloneableTags[int8Tag] =
49
+ cloneableTags[int16Tag] =
50
+ cloneableTags[int32Tag] =
51
+ cloneableTags[mapTag] =
52
+ cloneableTags[numberTag] =
53
+ cloneableTags[objectTag] =
54
+ cloneableTags[regexpTag] =
55
+ cloneableTags[setTag] =
56
+ cloneableTags[stringTag] =
57
+ cloneableTags[symbolTag] =
58
+ cloneableTags[uint8Tag] =
59
+ cloneableTags[uint8ClampedTag] =
60
+ cloneableTags[uint16Tag] =
61
+ cloneableTags[uint32Tag] =
62
+ true;
63
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
64
+
65
+ let freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
66
+ let freeSelf = typeof self == 'object' && self && self.Object === Object && self;
67
+ let root = freeGlobal || freeSelf || Function('return this')();
68
+ let freeExports = typeof exports == 'object' && exports && !nodeType && exports;
69
+ let freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
70
+ let moduleExports = freeModule && freeModule.exports === freeExports;
71
+
72
+ function addMapEntry(map, pair) {
73
+ map.set(pair[0], pair[1]);
74
+ return map;
75
+ }
76
+
77
+ function addSetEntry(set, value) {
78
+ set.add(value);
79
+ return set;
80
+ }
81
+
82
+ function arrayEach(array, iteratee) {
83
+ let index = -1,
84
+ length = array ? array.length : 0;
85
+
86
+ while (++index < length) {
87
+ if (iteratee(array[index], index, array) === false) {
88
+ break;
89
+ }
90
+ }
91
+ return array;
92
+ }
93
+
94
+ function arrayPush(array, values) {
95
+ let index = -1,
96
+ length = values.length,
97
+ offset = array.length;
98
+
99
+ while (++index < length) {
100
+ array[offset + index] = values[index];
101
+ }
102
+ return array;
103
+ }
104
+
105
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
106
+ let index = -1,
107
+ length = array ? array.length : 0;
108
+
109
+ if (initAccum && length) {
110
+ accumulator = array[++index];
111
+ }
112
+ while (++index < length) {
113
+ accumulator = iteratee(accumulator, array[index], index, array);
114
+ }
115
+ return accumulator;
116
+ }
117
+
118
+ function baseTimes(n, iteratee) {
119
+ let index = -1,
120
+ result = Array(n);
121
+
122
+ while (++index < n) {
123
+ result[index] = iteratee(index);
124
+ }
125
+ return result;
126
+ }
127
+
128
+ function getValue(object, key) {
129
+ return object == null ? undefined : object[key];
130
+ }
131
+
132
+ function isHostObject(value) {
133
+ let result = false;
134
+ if (value != null && typeof value.toString != 'function') {
135
+ try {
136
+ result = !!(value + '');
137
+ } catch (e) {}
138
+ }
139
+ return result;
140
+ }
141
+
142
+ function mapToArray(map) {
143
+ let index = -1,
144
+ result = Array(map.size);
145
+
146
+ map.forEach(function (value, key) {
147
+ result[++index] = [key, value];
148
+ });
149
+ return result;
150
+ }
151
+
152
+ function overArg(func, transform) {
153
+ return function (arg) {
154
+ return func(transform(arg));
155
+ };
156
+ }
157
+
158
+ function setToArray(set) {
159
+ let index = -1,
160
+ result = Array(set.size);
161
+
162
+ set.forEach(function (value) {
163
+ result[++index] = value;
164
+ });
165
+ return result;
166
+ }
167
+
168
+ let arrayProto = Array.prototype,
169
+ funcProto = Function.prototype,
170
+ objectProto = Object.prototype;
171
+
172
+ let coreJsData = root['__core-js_shared__'];
173
+
174
+ let maskSrcKey = (function () {
175
+ let uid = /[^.]+$/.exec((coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO) || '');
176
+ return uid ? 'Symbol(src)_1.' + uid : '';
177
+ })();
178
+
179
+ let funcToString = funcProto.toString;
180
+ let hasOwnProperty = objectProto.hasOwnProperty;
181
+ let objectToString = objectProto.toString;
182
+
183
+ let reIsNative = RegExp(
184
+ '^' +
185
+ funcToString
186
+ .call(hasOwnProperty)
187
+ .replace(reRegExpChar, '\\$&')
188
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') +
189
+ '$'
190
+ );
191
+
192
+ let Buffer = moduleExports ? root.Buffer : undefined,
193
+ Symbol = root.Symbol,
194
+ Uint8Array = root.Uint8Array,
195
+ getPrototype = overArg(Object.getPrototypeOf, Object),
196
+ objectCreate = Object.create,
197
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
198
+ splice = arrayProto.splice;
199
+
200
+ let nativeGetSymbols = Object.getOwnPropertySymbols,
201
+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
202
+ nativeKeys = overArg(Object.keys, Object);
203
+
204
+ let DataView = getNative(root, 'DataView'),
205
+ Map = getNative(root, 'Map'),
206
+ Promise = getNative(root, 'Promise'),
207
+ Set = getNative(root, 'Set'),
208
+ WeakMap = getNative(root, 'WeakMap'),
209
+ nativeCreate = getNative(Object, 'create');
210
+
211
+ let dataViewCtorString = toSource(DataView),
212
+ mapCtorString = toSource(Map),
213
+ promiseCtorString = toSource(Promise),
214
+ setCtorString = toSource(Set),
215
+ weakMapCtorString = toSource(WeakMap);
216
+
217
+ let symbolProto = Symbol ? Symbol.prototype : undefined,
218
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
219
+
220
+ function Hash(entries) {
221
+ let index = -1,
222
+ length = entries ? entries.length : 0;
223
+
224
+ this.clear();
225
+ while (++index < length) {
226
+ let entry = entries[index];
227
+ this.set(entry[0], entry[1]);
228
+ }
229
+ }
230
+
231
+ function hashClear() {
232
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
233
+ }
234
+
235
+ function hashDelete(key) {
236
+ return this.has(key) && delete this.__data__[key];
237
+ }
238
+
239
+ function hashGet(key) {
240
+ let data = this.__data__;
241
+ if (nativeCreate) {
242
+ let result = data[key];
243
+ return result === HASH_UNDEFINED ? undefined : result;
244
+ }
245
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
246
+ }
247
+
248
+ function hashHas(key) {
249
+ let data = this.__data__;
250
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
251
+ }
252
+
253
+ function hashSet(key, value) {
254
+ let data = this.__data__;
255
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
256
+ return this;
257
+ }
258
+
259
+ Hash.prototype.clear = hashClear;
260
+ Hash.prototype['delete'] = hashDelete;
261
+ Hash.prototype.get = hashGet;
262
+ Hash.prototype.has = hashHas;
263
+ Hash.prototype.set = hashSet;
264
+
265
+ function ListCache(entries) {
266
+ let index = -1,
267
+ length = entries ? entries.length : 0;
268
+
269
+ this.clear();
270
+ while (++index < length) {
271
+ let entry = entries[index];
272
+ this.set(entry[0], entry[1]);
273
+ }
274
+ }
275
+
276
+ function listCacheClear() {
277
+ this.__data__ = [];
278
+ }
279
+
280
+ function listCacheDelete(key) {
281
+ let data = this.__data__,
282
+ index = assocIndexOf(data, key);
283
+
284
+ if (index < 0) {
285
+ return false;
286
+ }
287
+ let lastIndex = data.length - 1;
288
+ if (index == lastIndex) {
289
+ data.pop();
290
+ } else {
291
+ splice.call(data, index, 1);
292
+ }
293
+ return true;
294
+ }
295
+
296
+ function listCacheGet(key) {
297
+ let data = this.__data__,
298
+ index = assocIndexOf(data, key);
299
+
300
+ return index < 0 ? undefined : data[index][1];
301
+ }
302
+
303
+ function listCacheHas(key) {
304
+ return assocIndexOf(this.__data__, key) > -1;
305
+ }
306
+
307
+ function listCacheSet(key, value) {
308
+ let data = this.__data__,
309
+ index = assocIndexOf(data, key);
310
+
311
+ if (index < 0) {
312
+ data.push([key, value]);
313
+ } else {
314
+ data[index][1] = value;
315
+ }
316
+ return this;
317
+ }
318
+
319
+ ListCache.prototype.clear = listCacheClear;
320
+ ListCache.prototype['delete'] = listCacheDelete;
321
+ ListCache.prototype.get = listCacheGet;
322
+ ListCache.prototype.has = listCacheHas;
323
+ ListCache.prototype.set = listCacheSet;
324
+
325
+ function MapCache(entries) {
326
+ let index = -1,
327
+ length = entries ? entries.length : 0;
328
+
329
+ this.clear();
330
+ while (++index < length) {
331
+ let entry = entries[index];
332
+ this.set(entry[0], entry[1]);
333
+ }
334
+ }
335
+
336
+ function mapCacheClear() {
337
+ this.__data__ = {
338
+ hash: new Hash(),
339
+ map: new (Map || ListCache)(),
340
+ string: new Hash(),
341
+ };
342
+ }
343
+
344
+ function mapCacheDelete(key) {
345
+ return getMapData(this, key)['delete'](key);
346
+ }
347
+
348
+ function mapCacheGet(key) {
349
+ return getMapData(this, key).get(key);
350
+ }
351
+
352
+ function mapCacheHas(key) {
353
+ return getMapData(this, key).has(key);
354
+ }
355
+
356
+ function mapCacheSet(key, value) {
357
+ getMapData(this, key).set(key, value);
358
+ return this;
359
+ }
360
+
361
+ MapCache.prototype.clear = mapCacheClear;
362
+ MapCache.prototype['delete'] = mapCacheDelete;
363
+ MapCache.prototype.get = mapCacheGet;
364
+ MapCache.prototype.has = mapCacheHas;
365
+ MapCache.prototype.set = mapCacheSet;
366
+
367
+ function Stack(entries) {
368
+ this.__data__ = new ListCache(entries);
369
+ }
370
+
371
+ function stackClear() {
372
+ this.__data__ = new ListCache();
373
+ }
374
+
375
+ function stackDelete(key) {
376
+ return this.__data__['delete'](key);
377
+ }
378
+
379
+ function stackGet(key) {
380
+ return this.__data__.get(key);
381
+ }
382
+
383
+ function stackHas(key) {
384
+ return this.__data__.has(key);
385
+ }
386
+
387
+ function stackSet(key, value) {
388
+ let cache = this.__data__;
389
+ if (cache instanceof ListCache) {
390
+ let pairs = cache.__data__;
391
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
392
+ pairs.push([key, value]);
393
+ return this;
394
+ }
395
+ cache = this.__data__ = new MapCache(pairs);
396
+ }
397
+ cache.set(key, value);
398
+ return this;
399
+ }
400
+
401
+ Stack.prototype.clear = stackClear;
402
+ Stack.prototype['delete'] = stackDelete;
403
+ Stack.prototype.get = stackGet;
404
+ Stack.prototype.has = stackHas;
405
+ Stack.prototype.set = stackSet;
406
+
407
+ function arrayLikeKeys(value, inherited) {
408
+ let result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
409
+
410
+ let length = result.length,
411
+ skipIndexes = !!length;
412
+
413
+ for (let key in value) {
414
+ if (
415
+ (inherited || hasOwnProperty.call(value, key)) &&
416
+ !(skipIndexes && (key == 'length' || isIndex(key, length)))
417
+ ) {
418
+ result.push(key);
419
+ }
420
+ }
421
+ return result;
422
+ }
423
+
424
+ function assignValue(object, key, value) {
425
+ let objValue = object[key];
426
+ if (
427
+ !(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
428
+ (value === undefined && !(key in object))
429
+ ) {
430
+ object[key] = value;
431
+ }
432
+ }
433
+
434
+ function assocIndexOf(array, key) {
435
+ let length = array.length;
436
+ while (length--) {
437
+ if (eq(array[length][0], key)) {
438
+ return length;
439
+ }
440
+ }
441
+ return -1;
442
+ }
443
+
444
+ function baseAssign(object, source) {
445
+ return object && copyObject(source, keys(source), object);
446
+ }
447
+
448
+ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
449
+ let result;
450
+ if (customizer) {
451
+ result = object ? customizer(value, key, object, stack) : customizer(value);
452
+ }
453
+ if (result !== undefined) {
454
+ return result;
455
+ }
456
+ if (!isObject(value)) {
457
+ return value;
458
+ }
459
+ let isArr = isArray(value);
460
+ if (isArr) {
461
+ result = initCloneArray(value);
462
+ if (!isDeep) {
463
+ return copyArray(value, result);
464
+ }
465
+ } else {
466
+ let tag = getTag(value),
467
+ isFunc = tag == funcTag || tag == genTag;
468
+
469
+ if (isBuffer(value)) {
470
+ return cloneBuffer(value, isDeep);
471
+ }
472
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
473
+ if (isHostObject(value)) {
474
+ return object ? value : {};
475
+ }
476
+ result = initCloneObject(isFunc ? {} : value);
477
+ if (!isDeep) {
478
+ return copySymbols(value, baseAssign(result, value));
479
+ }
480
+ } else {
481
+ if (!cloneableTags[tag]) {
482
+ return object ? value : {};
483
+ }
484
+ result = initCloneByTag(value, tag, baseClone, isDeep);
485
+ }
486
+ }
487
+
488
+ stack || (stack = new Stack());
489
+ let stacked = stack.get(value);
490
+ if (stacked) {
491
+ return stacked;
492
+ }
493
+ stack.set(value, result);
494
+
495
+ if (!isArr) {
496
+ var cloneDeepProps = isFull ? getAllKeys(value) : keys(value);
497
+ }
498
+ arrayEach(cloneDeepProps || value, function (subValue, key) {
499
+ if (cloneDeepProps) {
500
+ key = subValue;
501
+ subValue = value[key];
502
+ }
503
+
504
+ assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
505
+ });
506
+ return result;
507
+ }
508
+
509
+ function baseCreate(proto) {
510
+ return isObject(proto) ? objectCreate(proto) : {};
511
+ }
512
+
513
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
514
+ let result = keysFunc(object);
515
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
516
+ }
517
+
518
+ function baseGetTag(value) {
519
+ return objectToString.call(value);
520
+ }
521
+
522
+ function baseIsNative(value) {
523
+ if (!isObject(value) || isMasked(value)) {
524
+ return false;
525
+ }
526
+ let pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
527
+ return pattern.test(toSource(value));
528
+ }
529
+
530
+ function baseKeys(object) {
531
+ if (!isPrototype(object)) {
532
+ return nativeKeys(object);
533
+ }
534
+ let result = [];
535
+ for (let key in Object(object)) {
536
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
537
+ result.push(key);
538
+ }
539
+ }
540
+ return result;
541
+ }
542
+
543
+ function cloneBuffer(buffer, isDeep) {
544
+ if (isDeep) {
545
+ return buffer.slice();
546
+ }
547
+ let result = new buffer.constructor(buffer.length);
548
+ buffer.copy(result);
549
+ return result;
550
+ }
551
+
552
+ function cloneArrayBuffer(arrayBuffer) {
553
+ let result = new arrayBuffer.constructor(arrayBuffer.byteLength);
554
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
555
+ return result;
556
+ }
557
+
558
+ function cloneDataView(dataView, isDeep) {
559
+ let buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
560
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
561
+ }
562
+
563
+ function cloneMap(map, isDeep, cloneFunc) {
564
+ let array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
565
+ return arrayReduce(array, addMapEntry, new map.constructor());
566
+ }
567
+
568
+ function cloneRegExp(regexp) {
569
+ let result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
570
+ result.lastIndex = regexp.lastIndex;
571
+ return result;
572
+ }
573
+
574
+ function cloneSet(set, isDeep, cloneFunc) {
575
+ let array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
576
+ return arrayReduce(array, addSetEntry, new set.constructor());
577
+ }
578
+
579
+ function cloneSymbol(symbol) {
580
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
581
+ }
582
+
583
+ function cloneTypedArray(typedArray, isDeep) {
584
+ let buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
585
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
586
+ }
587
+
588
+ function copyArray(source, array) {
589
+ let index = -1,
590
+ length = source.length;
591
+
592
+ array || (array = Array(length));
593
+ while (++index < length) {
594
+ array[index] = source[index];
595
+ }
596
+ return array;
597
+ }
598
+
599
+ function copyObject(source, cloneDeepProps, object, customizer) {
600
+ object || (object = {});
601
+
602
+ let index = -1,
603
+ length = cloneDeepProps.length;
604
+
605
+ while (++index < length) {
606
+ let key = cloneDeepProps[index];
607
+
608
+ let newValue = customizer
609
+ ? customizer(object[key], source[key], key, object, source)
610
+ : undefined;
611
+
612
+ assignValue(object, key, newValue === undefined ? source[key] : newValue);
613
+ }
614
+ return object;
615
+ }
616
+
617
+ function copySymbols(source, object) {
618
+ return copyObject(source, getSymbols(source), object);
619
+ }
620
+
621
+ function getAllKeys(object) {
622
+ return baseGetAllKeys(object, keys, getSymbols);
623
+ }
624
+
625
+ function getMapData(map, key) {
626
+ let data = map.__data__;
627
+ return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
628
+ }
629
+
630
+ function getNative(object, key) {
631
+ let value = getValue(object, key);
632
+ return baseIsNative(value) ? value : undefined;
633
+ }
634
+
635
+ let getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
636
+ let getTag = baseGetTag;
637
+
638
+ if (
639
+ (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
640
+ (Map && getTag(new Map()) != mapTag) ||
641
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
642
+ (Set && getTag(new Set()) != setTag) ||
643
+ (WeakMap && getTag(new WeakMap()) != weakMapTag)
644
+ ) {
645
+ getTag = function (value) {
646
+ let result = objectToString.call(value),
647
+ Ctor = result == objectTag ? value.constructor : undefined,
648
+ ctorString = Ctor ? toSource(Ctor) : undefined;
649
+
650
+ if (ctorString) {
651
+ switch (ctorString) {
652
+ case dataViewCtorString:
653
+ return dataViewTag;
654
+ case mapCtorString:
655
+ return mapTag;
656
+ case promiseCtorString:
657
+ return promiseTag;
658
+ case setCtorString:
659
+ return setTag;
660
+ case weakMapCtorString:
661
+ return weakMapTag;
662
+ }
663
+ }
664
+ return result;
665
+ };
666
+ }
667
+
668
+ function initCloneArray(array) {
669
+ let length = array.length,
670
+ result = array.constructor(length);
671
+
672
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
673
+ result.index = array.index;
674
+ result.input = array.input;
675
+ }
676
+ return result;
677
+ }
678
+
679
+ function initCloneObject(object) {
680
+ return typeof object.constructor == 'function' && !isPrototype(object)
681
+ ? baseCreate(getPrototype(object))
682
+ : {};
683
+ }
684
+
685
+ function initCloneByTag(object, tag, cloneFunc, isDeep) {
686
+ let Ctor = object.constructor;
687
+ switch (tag) {
688
+ case arrayBufferTag:
689
+ return cloneArrayBuffer(object);
690
+
691
+ case boolTag:
692
+ case dateTag:
693
+ return new Ctor(+object);
694
+
695
+ case dataViewTag:
696
+ return cloneDataView(object, isDeep);
697
+
698
+ case float32Tag:
699
+ case float64Tag:
700
+ case int8Tag:
701
+ case int16Tag:
702
+ case int32Tag:
703
+ case uint8Tag:
704
+ case uint8ClampedTag:
705
+ case uint16Tag:
706
+ case uint32Tag:
707
+ return cloneTypedArray(object, isDeep);
708
+
709
+ case mapTag:
710
+ return cloneMap(object, isDeep, cloneFunc);
711
+
712
+ case numberTag:
713
+ case stringTag:
714
+ return new Ctor(object);
715
+
716
+ case regexpTag:
717
+ return cloneRegExp(object);
718
+
719
+ case setTag:
720
+ return cloneSet(object, isDeep, cloneFunc);
721
+
722
+ case symbolTag:
723
+ return cloneSymbol(object);
724
+ }
725
+ }
726
+
727
+ function isIndex(value, length) {
728
+ length = length == null ? MAX_SAFE_INTEGER : length;
729
+ return (
730
+ !!length &&
731
+ (typeof value == 'number' || reIsUint.test(value)) &&
732
+ value > -1 &&
733
+ value % 1 == 0 &&
734
+ value < length
735
+ );
736
+ }
737
+
738
+ function isKeyable(value) {
739
+ let type = typeof value;
740
+ return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean'
741
+ ? value !== '__proto__'
742
+ : value === null;
743
+ }
744
+
745
+ function isMasked(func) {
746
+ return !!maskSrcKey && maskSrcKey in func;
747
+ }
748
+
749
+ function isPrototype(value) {
750
+ let Ctor = value && value.constructor,
751
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
752
+
753
+ return value === proto;
754
+ }
755
+
756
+ function toSource(func) {
757
+ if (func != null) {
758
+ try {
759
+ return funcToString.call(func);
760
+ } catch (e) {}
761
+ try {
762
+ return func + '';
763
+ } catch (e) {}
764
+ }
765
+ return '';
766
+ }
767
+
768
+ function zxhiddenCustomCloneDeepByJeremyAshkenas(value) {
769
+ return baseClone(value, true, true);
770
+ }
771
+
772
+ function eq(value, other) {
773
+ return value === other || (value !== value && other !== other);
774
+ }
775
+
776
+ function isArguments(value) {
777
+ return (
778
+ isArrayLikeObject(value) &&
779
+ hasOwnProperty.call(value, 'callee') &&
780
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag)
781
+ );
782
+ }
783
+
784
+ let isArray = Array.isArray;
785
+
786
+ function isArrayLike(value) {
787
+ return value != null && isLength(value.length) && !isFunction(value);
788
+ }
789
+
790
+ function isArrayLikeObject(value) {
791
+ return isObjectLike(value) && isArrayLike(value);
792
+ }
793
+
794
+ let isBuffer = nativeIsBuffer || stubFalse;
795
+
796
+ function isFunction(value) {
797
+ let tag = isObject(value) ? objectToString.call(value) : '';
798
+ return tag == funcTag || tag == genTag;
799
+ }
800
+
801
+ function isLength(value) {
802
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
803
+ }
804
+
805
+ function isObject(value) {
806
+ let type = typeof value;
807
+ return !!value && (type == 'object' || type == 'function');
808
+ }
809
+
810
+ function isObjectLike(value) {
811
+ return !!value && typeof value == 'object';
812
+ }
813
+
814
+ function keys(object) {
815
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
816
+ }
817
+
818
+ function stubArray() {
819
+ return [];
820
+ }
821
+
822
+ function stubFalse() {
823
+ return false;
824
+ }
825
+
826
+ export default zxhiddenCustomCloneDeepByJeremyAshkenas;