es-toolkit 1.26.1-dev.835 → 1.26.1-dev.837
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.
- package/dist/_chunk/deburr-BPmkoM.js +47 -0
- package/dist/_chunk/{isWeakSet-D8h8bS.js → isUndefined-C_iNqA.js} +239 -37
- package/dist/_chunk/partialRight-CRhV1h.js +53 -0
- package/dist/_chunk/{unary-CcTNuC.js → unary-DqRmr1.js} +0 -48
- package/dist/_chunk/{upperFirst-BUECmK.js → upperFirst-Dk8IW1.js} +29 -74
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/array/differenceBy.d.mts +8 -0
- package/dist/compat/array/differenceBy.d.ts +8 -0
- package/dist/compat/array/differenceBy.mjs +19 -0
- package/dist/compat/index.d.mts +2 -1
- package/dist/compat/index.d.ts +2 -1
- package/dist/compat/index.js +191 -333
- package/dist/compat/index.mjs +23 -22
- package/dist/compat/predicate/isDate.mjs +7 -0
- package/dist/compat/predicate/isEmpty.d.mts +78 -0
- package/dist/compat/predicate/isEmpty.d.ts +78 -0
- package/dist/compat/predicate/isEmpty.mjs +26 -0
- package/dist/compat/util/iteratee.d.mts +4 -4
- package/dist/compat/util/iteratee.d.ts +4 -4
- package/dist/compat/util/iteratee.mjs +2 -1
- package/dist/function/index.js +5 -5
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +30 -28
- package/dist/index.mjs +1 -0
- package/dist/predicate/index.d.mts +1 -0
- package/dist/predicate/index.d.ts +1 -0
- package/dist/predicate/index.js +22 -21
- package/dist/predicate/index.mjs +1 -0
- package/dist/predicate/isEmpty.d.mts +69 -0
- package/dist/predicate/isEmpty.d.ts +69 -0
- package/dist/predicate/isEmpty.mjs +31 -0
- package/dist/string/index.js +3 -2
- package/package.json +1 -1
- package/dist/_chunk/noop-2IwLUk.js +0 -5
package/dist/compat/index.js
CHANGED
|
@@ -4,14 +4,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const zipWith = require('../_chunk/zipWith-Dkv3D1.js');
|
|
6
6
|
const promise_index = require('../_chunk/index-BGZDR9.js');
|
|
7
|
-
const unary = require('../_chunk/unary-
|
|
8
|
-
const
|
|
7
|
+
const unary = require('../_chunk/unary-DqRmr1.js');
|
|
8
|
+
const partialRight = require('../_chunk/partialRight-CRhV1h.js');
|
|
9
9
|
const sumBy = require('../_chunk/sumBy-CRE6-A.js');
|
|
10
10
|
const randomInt = require('../_chunk/randomInt-CF7bZK.js');
|
|
11
11
|
const toMerged = require('../_chunk/toMerged-wNz52b.js');
|
|
12
12
|
const isPlainObject$1 = require('../_chunk/isPlainObject-octpoD.js');
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const isUndefined = require('../_chunk/isUndefined-C_iNqA.js');
|
|
14
|
+
const deburr = require('../_chunk/deburr-BPmkoM.js');
|
|
15
|
+
const upperFirst = require('../_chunk/upperFirst-Dk8IW1.js');
|
|
15
16
|
const util_index = require('../util/index.js');
|
|
16
17
|
|
|
17
18
|
function castArray(value) {
|
|
@@ -21,20 +22,16 @@ function castArray(value) {
|
|
|
21
22
|
return Array.isArray(value) ? value : [value];
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
function isArrayLike(value) {
|
|
25
|
-
return value != null && typeof value !== 'function' && isWeakSet$1.isLength(value.length);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
25
|
function chunk(arr, size = 1) {
|
|
29
26
|
size = Math.max(Math.floor(size), 0);
|
|
30
|
-
if (size === 0 || !isArrayLike(arr)) {
|
|
27
|
+
if (size === 0 || !isUndefined.isArrayLike(arr)) {
|
|
31
28
|
return [];
|
|
32
29
|
}
|
|
33
30
|
return zipWith.chunk(Array.from(arr), size);
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
function compact(arr) {
|
|
37
|
-
if (!isArrayLike(arr)) {
|
|
34
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
38
35
|
return [];
|
|
39
36
|
}
|
|
40
37
|
return zipWith.compact(Array.from(arr));
|
|
@@ -45,7 +42,7 @@ function concat(...values) {
|
|
|
45
42
|
}
|
|
46
43
|
|
|
47
44
|
function isArrayLikeObject(value) {
|
|
48
|
-
return toMerged.isObjectLike(value) && isArrayLike(value);
|
|
45
|
+
return toMerged.isObjectLike(value) && isUndefined.isArrayLike(value);
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
function difference(arr, ...values) {
|
|
@@ -63,49 +60,40 @@ function difference(arr, ...values) {
|
|
|
63
60
|
return zipWith.difference(arr1, arr2);
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (isSymbol(value)) {
|
|
72
|
-
return NaN;
|
|
73
|
-
}
|
|
74
|
-
return Number(value);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function toFinite(value) {
|
|
78
|
-
if (!value) {
|
|
79
|
-
return value === 0 ? value : 0;
|
|
80
|
-
}
|
|
81
|
-
value = toNumber(value);
|
|
82
|
-
if (value === Infinity || value === -Infinity) {
|
|
83
|
-
const sign = value < 0 ? -1 : 1;
|
|
84
|
-
return sign * Number.MAX_VALUE;
|
|
85
|
-
}
|
|
86
|
-
return value === value ? value : 0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function toInteger(value) {
|
|
90
|
-
const finite = toFinite(value);
|
|
91
|
-
const remainder = finite % 1;
|
|
92
|
-
return remainder ? finite - remainder : finite;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function drop(collection, itemsCount = 1, guard) {
|
|
96
|
-
if (!isArrayLike(collection)) {
|
|
97
|
-
return [];
|
|
63
|
+
function flatten(value, depth = 1) {
|
|
64
|
+
const result = [];
|
|
65
|
+
const flooredDepth = Math.floor(depth);
|
|
66
|
+
if (!isUndefined.isArrayLike(value)) {
|
|
67
|
+
return result;
|
|
98
68
|
}
|
|
99
|
-
|
|
100
|
-
|
|
69
|
+
const recursive = (arr, currentDepth) => {
|
|
70
|
+
for (let i = 0; i < arr.length; i++) {
|
|
71
|
+
const item = arr[i];
|
|
72
|
+
if (currentDepth < flooredDepth &&
|
|
73
|
+
(Array.isArray(item) ||
|
|
74
|
+
Boolean(item?.[Symbol.isConcatSpreadable]) ||
|
|
75
|
+
(item !== null && typeof item === 'object' && Object.prototype.toString.call(item) === '[object Arguments]'))) {
|
|
76
|
+
if (Array.isArray(item)) {
|
|
77
|
+
recursive(item, currentDepth + 1);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
recursive(Array.from(item), currentDepth + 1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
result.push(item);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
recursive(Array.from(value), 0);
|
|
89
|
+
return result;
|
|
101
90
|
}
|
|
102
91
|
|
|
103
|
-
function
|
|
104
|
-
if (!isArrayLike(
|
|
105
|
-
return
|
|
92
|
+
function last(array) {
|
|
93
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
94
|
+
return undefined;
|
|
106
95
|
}
|
|
107
|
-
|
|
108
|
-
return zipWith.dropRight(Array.from(collection), itemsCount);
|
|
96
|
+
return zipWith.last(Array.from(array));
|
|
109
97
|
}
|
|
110
98
|
|
|
111
99
|
function isDeepKey(key) {
|
|
@@ -286,7 +274,7 @@ function isMatch(target, source) {
|
|
|
286
274
|
}
|
|
287
275
|
default: {
|
|
288
276
|
if (!isObject(target)) {
|
|
289
|
-
return
|
|
277
|
+
return isUndefined.eq(target, source);
|
|
290
278
|
}
|
|
291
279
|
return !source;
|
|
292
280
|
}
|
|
@@ -348,14 +336,14 @@ function cloneDeep(obj) {
|
|
|
348
336
|
return toMerged.cloneDeep(obj);
|
|
349
337
|
}
|
|
350
338
|
switch (Object.prototype.toString.call(obj)) {
|
|
351
|
-
case
|
|
352
|
-
case
|
|
353
|
-
case
|
|
339
|
+
case isUndefined.numberTag:
|
|
340
|
+
case isUndefined.stringTag:
|
|
341
|
+
case isUndefined.booleanTag: {
|
|
354
342
|
const result = new obj.constructor(obj?.valueOf());
|
|
355
343
|
toMerged.copyProperties(result, obj);
|
|
356
344
|
return result;
|
|
357
345
|
}
|
|
358
|
-
case
|
|
346
|
+
case isUndefined.argumentsTag: {
|
|
359
347
|
const result = {};
|
|
360
348
|
toMerged.copyProperties(result, obj);
|
|
361
349
|
result.length = obj.length;
|
|
@@ -384,7 +372,7 @@ function isIndex(value) {
|
|
|
384
372
|
}
|
|
385
373
|
|
|
386
374
|
function isArguments(value) {
|
|
387
|
-
return value !== null && typeof value === 'object' &&
|
|
375
|
+
return value !== null && typeof value === 'object' && isUndefined.getTag(value) === '[object Arguments]';
|
|
388
376
|
}
|
|
389
377
|
|
|
390
378
|
function has(object, path) {
|
|
@@ -441,8 +429,79 @@ function matchesProperty(property, source) {
|
|
|
441
429
|
};
|
|
442
430
|
}
|
|
443
431
|
|
|
432
|
+
function iteratee(value) {
|
|
433
|
+
if (value == null) {
|
|
434
|
+
return unary.identity;
|
|
435
|
+
}
|
|
436
|
+
switch (typeof value) {
|
|
437
|
+
case 'function': {
|
|
438
|
+
return value;
|
|
439
|
+
}
|
|
440
|
+
case 'object': {
|
|
441
|
+
return Array.isArray(value) ? matchesProperty(value[0], value[1]) : matches(value);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return property(value);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function differenceBy(arr, ...values) {
|
|
448
|
+
if (!isArrayLikeObject(arr)) {
|
|
449
|
+
return [];
|
|
450
|
+
}
|
|
451
|
+
const iteratee$1 = last(values);
|
|
452
|
+
if (isArrayLikeObject(iteratee$1)) {
|
|
453
|
+
return zipWith.difference(Array.from(arr), flatten(values));
|
|
454
|
+
}
|
|
455
|
+
return zipWith.differenceBy(Array.from(arr), flatten(values.slice(0, -1)), iteratee(iteratee$1));
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function isSymbol(value) {
|
|
459
|
+
return typeof value === 'symbol' || value instanceof Symbol;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function toNumber(value) {
|
|
463
|
+
if (isSymbol(value)) {
|
|
464
|
+
return NaN;
|
|
465
|
+
}
|
|
466
|
+
return Number(value);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function toFinite(value) {
|
|
470
|
+
if (!value) {
|
|
471
|
+
return value === 0 ? value : 0;
|
|
472
|
+
}
|
|
473
|
+
value = toNumber(value);
|
|
474
|
+
if (value === Infinity || value === -Infinity) {
|
|
475
|
+
const sign = value < 0 ? -1 : 1;
|
|
476
|
+
return sign * Number.MAX_VALUE;
|
|
477
|
+
}
|
|
478
|
+
return value === value ? value : 0;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function toInteger(value) {
|
|
482
|
+
const finite = toFinite(value);
|
|
483
|
+
const remainder = finite % 1;
|
|
484
|
+
return remainder ? finite - remainder : finite;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function drop(collection, itemsCount = 1, guard) {
|
|
488
|
+
if (!isUndefined.isArrayLike(collection)) {
|
|
489
|
+
return [];
|
|
490
|
+
}
|
|
491
|
+
itemsCount = guard ? 1 : toInteger(itemsCount);
|
|
492
|
+
return zipWith.drop(Array.from(collection), itemsCount);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function dropRight(collection, itemsCount = 1, guard) {
|
|
496
|
+
if (!isUndefined.isArrayLike(collection)) {
|
|
497
|
+
return [];
|
|
498
|
+
}
|
|
499
|
+
itemsCount = guard ? 1 : toInteger(itemsCount);
|
|
500
|
+
return zipWith.dropRight(Array.from(collection), itemsCount);
|
|
501
|
+
}
|
|
502
|
+
|
|
444
503
|
function dropRightWhile(arr, predicate) {
|
|
445
|
-
if (!isArrayLike(arr)) {
|
|
504
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
446
505
|
return [];
|
|
447
506
|
}
|
|
448
507
|
return dropRightWhileImpl(Array.from(arr), predicate);
|
|
@@ -469,7 +528,7 @@ function dropRightWhileImpl(arr, predicate) {
|
|
|
469
528
|
}
|
|
470
529
|
|
|
471
530
|
function dropWhile(arr, predicate) {
|
|
472
|
-
if (!isArrayLike(arr)) {
|
|
531
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
473
532
|
return [];
|
|
474
533
|
}
|
|
475
534
|
return dropWhileImpl(Array.from(arr), predicate);
|
|
@@ -499,9 +558,9 @@ function isIterateeCall(value, index, object) {
|
|
|
499
558
|
if (!isObject(object)) {
|
|
500
559
|
return false;
|
|
501
560
|
}
|
|
502
|
-
if ((typeof index === 'number' && isArrayLike(object) && isIndex(index) && index < object.length) ||
|
|
561
|
+
if ((typeof index === 'number' && isUndefined.isArrayLike(object) && isIndex(index) && index < object.length) ||
|
|
503
562
|
(typeof index === 'string' && index in object)) {
|
|
504
|
-
return
|
|
563
|
+
return isUndefined.eq(object[index], value);
|
|
505
564
|
}
|
|
506
565
|
return false;
|
|
507
566
|
}
|
|
@@ -553,7 +612,7 @@ function isString(value) {
|
|
|
553
612
|
}
|
|
554
613
|
|
|
555
614
|
function fill(array, value, start = 0, end = array ? array.length : 0) {
|
|
556
|
-
if (!isArrayLike(array)) {
|
|
615
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
557
616
|
return [];
|
|
558
617
|
}
|
|
559
618
|
if (isString(array)) {
|
|
@@ -708,35 +767,6 @@ function findLastIndex(arr, doesMatch, fromIndex = arr ? arr.length - 1 : 0) {
|
|
|
708
767
|
}
|
|
709
768
|
}
|
|
710
769
|
|
|
711
|
-
function flatten(value, depth = 1) {
|
|
712
|
-
const result = [];
|
|
713
|
-
const flooredDepth = Math.floor(depth);
|
|
714
|
-
if (!isArrayLike(value)) {
|
|
715
|
-
return result;
|
|
716
|
-
}
|
|
717
|
-
const recursive = (arr, currentDepth) => {
|
|
718
|
-
for (let i = 0; i < arr.length; i++) {
|
|
719
|
-
const item = arr[i];
|
|
720
|
-
if (currentDepth < flooredDepth &&
|
|
721
|
-
(Array.isArray(item) ||
|
|
722
|
-
Boolean(item?.[Symbol.isConcatSpreadable]) ||
|
|
723
|
-
(item !== null && typeof item === 'object' && Object.prototype.toString.call(item) === '[object Arguments]'))) {
|
|
724
|
-
if (Array.isArray(item)) {
|
|
725
|
-
recursive(item, currentDepth + 1);
|
|
726
|
-
}
|
|
727
|
-
else {
|
|
728
|
-
recursive(Array.from(item), currentDepth + 1);
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
else {
|
|
732
|
-
result.push(item);
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
};
|
|
736
|
-
recursive(Array.from(value), 0);
|
|
737
|
-
return result;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
770
|
function flattenDeep(value) {
|
|
741
771
|
return flatten(value, Infinity);
|
|
742
772
|
}
|
|
@@ -746,7 +776,7 @@ function flattenDepth(value, depth = 1) {
|
|
|
746
776
|
}
|
|
747
777
|
|
|
748
778
|
function head(arr) {
|
|
749
|
-
if (!isArrayLike(arr)) {
|
|
779
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
750
780
|
return undefined;
|
|
751
781
|
}
|
|
752
782
|
return zipWith.head(Array.from(arr));
|
|
@@ -780,7 +810,7 @@ function includes(source, target, fromIndex, guard) {
|
|
|
780
810
|
}
|
|
781
811
|
for (let i = fromIndex; i < keys.length; i++) {
|
|
782
812
|
const value = Reflect.get(source, keys[i]);
|
|
783
|
-
if (
|
|
813
|
+
if (isUndefined.eq(value, target)) {
|
|
784
814
|
return true;
|
|
785
815
|
}
|
|
786
816
|
}
|
|
@@ -788,7 +818,7 @@ function includes(source, target, fromIndex, guard) {
|
|
|
788
818
|
}
|
|
789
819
|
|
|
790
820
|
function indexOf(array, searchElement, fromIndex) {
|
|
791
|
-
if (!isArrayLike(array)) {
|
|
821
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
792
822
|
return -1;
|
|
793
823
|
}
|
|
794
824
|
if (Number.isNaN(searchElement)) {
|
|
@@ -853,19 +883,12 @@ function intersectionBy(array, ...values) {
|
|
|
853
883
|
}
|
|
854
884
|
|
|
855
885
|
function join(array, separator = ',') {
|
|
856
|
-
if (!isArrayLike(array)) {
|
|
886
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
857
887
|
return '';
|
|
858
888
|
}
|
|
859
889
|
return Array.from(array).join(separator);
|
|
860
890
|
}
|
|
861
891
|
|
|
862
|
-
function last(array) {
|
|
863
|
-
if (!isArrayLike(array)) {
|
|
864
|
-
return undefined;
|
|
865
|
-
}
|
|
866
|
-
return zipWith.last(Array.from(array));
|
|
867
|
-
}
|
|
868
|
-
|
|
869
892
|
function getPriority(a) {
|
|
870
893
|
if (typeof a === 'symbol') {
|
|
871
894
|
return 1;
|
|
@@ -991,14 +1014,14 @@ function sample(collection) {
|
|
|
991
1014
|
if (collection == null) {
|
|
992
1015
|
return undefined;
|
|
993
1016
|
}
|
|
994
|
-
if (isArrayLike(collection)) {
|
|
1017
|
+
if (isUndefined.isArrayLike(collection)) {
|
|
995
1018
|
return zipWith.sample(Array.from(collection));
|
|
996
1019
|
}
|
|
997
1020
|
return zipWith.sample(Object.values(collection));
|
|
998
1021
|
}
|
|
999
1022
|
|
|
1000
1023
|
function size(target) {
|
|
1001
|
-
if (
|
|
1024
|
+
if (isUndefined.isNil(target)) {
|
|
1002
1025
|
return 0;
|
|
1003
1026
|
}
|
|
1004
1027
|
if (target instanceof Map || target instanceof Set) {
|
|
@@ -1008,7 +1031,7 @@ function size(target) {
|
|
|
1008
1031
|
}
|
|
1009
1032
|
|
|
1010
1033
|
function slice(array, start, end) {
|
|
1011
|
-
if (!isArrayLike(array)) {
|
|
1034
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
1012
1035
|
return [];
|
|
1013
1036
|
}
|
|
1014
1037
|
const length = array.length;
|
|
@@ -1095,7 +1118,7 @@ function sortBy(collection, ...criteria) {
|
|
|
1095
1118
|
}
|
|
1096
1119
|
|
|
1097
1120
|
function tail(arr) {
|
|
1098
|
-
if (!isArrayLike(arr)) {
|
|
1121
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
1099
1122
|
return [];
|
|
1100
1123
|
}
|
|
1101
1124
|
return zipWith.tail(Array.from(arr));
|
|
@@ -1103,7 +1126,7 @@ function tail(arr) {
|
|
|
1103
1126
|
|
|
1104
1127
|
function take(arr, count = 1, guard) {
|
|
1105
1128
|
count = guard ? 1 : toInteger(count);
|
|
1106
|
-
if (count < 1 || !isArrayLike(arr)) {
|
|
1129
|
+
if (count < 1 || !isUndefined.isArrayLike(arr)) {
|
|
1107
1130
|
return [];
|
|
1108
1131
|
}
|
|
1109
1132
|
return zipWith.take(Array.from(arr), count);
|
|
@@ -1111,14 +1134,14 @@ function take(arr, count = 1, guard) {
|
|
|
1111
1134
|
|
|
1112
1135
|
function takeRight(arr, count = 1, guard) {
|
|
1113
1136
|
count = guard ? 1 : toInteger(count);
|
|
1114
|
-
if (count <= 0 || !isArrayLike(arr)) {
|
|
1137
|
+
if (count <= 0 || !isUndefined.isArrayLike(arr)) {
|
|
1115
1138
|
return [];
|
|
1116
1139
|
}
|
|
1117
1140
|
return zipWith.takeRight(Array.from(arr), count);
|
|
1118
1141
|
}
|
|
1119
1142
|
|
|
1120
1143
|
function uniq(arr) {
|
|
1121
|
-
if (!isArrayLike(arr)) {
|
|
1144
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
1122
1145
|
return [];
|
|
1123
1146
|
}
|
|
1124
1147
|
return zipWith.uniq(Array.from(arr));
|
|
@@ -1149,10 +1172,10 @@ function set(obj, path, value) {
|
|
|
1149
1172
|
|
|
1150
1173
|
function zipObjectDeep(keys, values) {
|
|
1151
1174
|
const result = {};
|
|
1152
|
-
if (!isArrayLike(keys)) {
|
|
1175
|
+
if (!isUndefined.isArrayLike(keys)) {
|
|
1153
1176
|
return result;
|
|
1154
1177
|
}
|
|
1155
|
-
if (!isArrayLike(values)) {
|
|
1178
|
+
if (!isUndefined.isArrayLike(values)) {
|
|
1156
1179
|
values = [];
|
|
1157
1180
|
}
|
|
1158
1181
|
const zipped = zipWith.zip(Array.from(keys), Array.from(values));
|
|
@@ -1201,177 +1224,6 @@ function before(n, func) {
|
|
|
1201
1224
|
};
|
|
1202
1225
|
}
|
|
1203
1226
|
|
|
1204
|
-
function bind(func, thisObj, ...partialArgs) {
|
|
1205
|
-
const bound = function (...providedArgs) {
|
|
1206
|
-
const args = [];
|
|
1207
|
-
let startIndex = 0;
|
|
1208
|
-
for (let i = 0; i < partialArgs.length; i++) {
|
|
1209
|
-
const arg = partialArgs[i];
|
|
1210
|
-
if (arg === bind.placeholder) {
|
|
1211
|
-
args.push(providedArgs[startIndex++]);
|
|
1212
|
-
}
|
|
1213
|
-
else {
|
|
1214
|
-
args.push(arg);
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
1218
|
-
args.push(providedArgs[i]);
|
|
1219
|
-
}
|
|
1220
|
-
if (this instanceof bound) {
|
|
1221
|
-
return new func(...args);
|
|
1222
|
-
}
|
|
1223
|
-
return func.apply(thisObj, args);
|
|
1224
|
-
};
|
|
1225
|
-
return bound;
|
|
1226
|
-
}
|
|
1227
|
-
const bindPlaceholder = Symbol('bind.placeholder');
|
|
1228
|
-
bind.placeholder = bindPlaceholder;
|
|
1229
|
-
|
|
1230
|
-
function bindKey(object, key, ...partialArgs) {
|
|
1231
|
-
const bound = function (...providedArgs) {
|
|
1232
|
-
const args = [];
|
|
1233
|
-
let startIndex = 0;
|
|
1234
|
-
for (let i = 0; i < partialArgs.length; i++) {
|
|
1235
|
-
const arg = partialArgs[i];
|
|
1236
|
-
if (arg === bindKey.placeholder) {
|
|
1237
|
-
args.push(providedArgs[startIndex++]);
|
|
1238
|
-
}
|
|
1239
|
-
else {
|
|
1240
|
-
args.push(arg);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
1244
|
-
args.push(providedArgs[i]);
|
|
1245
|
-
}
|
|
1246
|
-
if (this instanceof bound) {
|
|
1247
|
-
return new object[key](...args);
|
|
1248
|
-
}
|
|
1249
|
-
return object[key].apply(object, args);
|
|
1250
|
-
};
|
|
1251
|
-
return bound;
|
|
1252
|
-
}
|
|
1253
|
-
const bindKeyPlaceholder = Symbol('bindKey.placeholder');
|
|
1254
|
-
bindKey.placeholder = bindKeyPlaceholder;
|
|
1255
|
-
|
|
1256
|
-
function curry(func, arity = func.length, guard) {
|
|
1257
|
-
arity = guard ? func.length : arity;
|
|
1258
|
-
arity = Number.parseInt(arity, 10);
|
|
1259
|
-
if (Number.isNaN(arity) || arity < 1) {
|
|
1260
|
-
arity = 0;
|
|
1261
|
-
}
|
|
1262
|
-
const wrapper = function (...partialArgs) {
|
|
1263
|
-
const holders = partialArgs.filter(item => item === curry.placeholder);
|
|
1264
|
-
const length = partialArgs.length - holders.length;
|
|
1265
|
-
if (length < arity) {
|
|
1266
|
-
return makeCurry(func, arity - length, partialArgs);
|
|
1267
|
-
}
|
|
1268
|
-
if (this instanceof wrapper) {
|
|
1269
|
-
return new func(...partialArgs);
|
|
1270
|
-
}
|
|
1271
|
-
return func.apply(this, partialArgs);
|
|
1272
|
-
};
|
|
1273
|
-
wrapper.placeholder = curryPlaceholder;
|
|
1274
|
-
return wrapper;
|
|
1275
|
-
}
|
|
1276
|
-
function makeCurry(func, arity, partialArgs) {
|
|
1277
|
-
function wrapper(...providedArgs) {
|
|
1278
|
-
const holders = providedArgs.filter(item => item === curry.placeholder);
|
|
1279
|
-
const length = providedArgs.length - holders.length;
|
|
1280
|
-
providedArgs = composeArgs$1(providedArgs, partialArgs);
|
|
1281
|
-
if (length < arity) {
|
|
1282
|
-
return makeCurry(func, arity - length, providedArgs);
|
|
1283
|
-
}
|
|
1284
|
-
if (this instanceof wrapper) {
|
|
1285
|
-
return new func(...providedArgs);
|
|
1286
|
-
}
|
|
1287
|
-
return func.apply(this, providedArgs);
|
|
1288
|
-
}
|
|
1289
|
-
wrapper.placeholder = curryPlaceholder;
|
|
1290
|
-
return wrapper;
|
|
1291
|
-
}
|
|
1292
|
-
function composeArgs$1(providedArgs, partialArgs) {
|
|
1293
|
-
const args = [];
|
|
1294
|
-
let startIndex = 0;
|
|
1295
|
-
for (let i = 0; i < partialArgs.length; i++) {
|
|
1296
|
-
const arg = partialArgs[i];
|
|
1297
|
-
if (arg === curry.placeholder && startIndex < providedArgs.length) {
|
|
1298
|
-
args.push(providedArgs[startIndex++]);
|
|
1299
|
-
}
|
|
1300
|
-
else {
|
|
1301
|
-
args.push(arg);
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
1305
|
-
args.push(providedArgs[i]);
|
|
1306
|
-
}
|
|
1307
|
-
return args;
|
|
1308
|
-
}
|
|
1309
|
-
const curryPlaceholder = Symbol('curry.placeholder');
|
|
1310
|
-
curry.placeholder = curryPlaceholder;
|
|
1311
|
-
|
|
1312
|
-
function curryRight(func, arity = func.length, guard) {
|
|
1313
|
-
arity = guard ? func.length : arity;
|
|
1314
|
-
arity = Number.parseInt(arity, 10);
|
|
1315
|
-
if (Number.isNaN(arity) || arity < 1) {
|
|
1316
|
-
arity = 0;
|
|
1317
|
-
}
|
|
1318
|
-
const wrapper = function (...partialArgs) {
|
|
1319
|
-
const holders = partialArgs.filter(item => item === curryRight.placeholder);
|
|
1320
|
-
const length = partialArgs.length - holders.length;
|
|
1321
|
-
if (length < arity) {
|
|
1322
|
-
return makeCurryRight(func, arity - length, partialArgs);
|
|
1323
|
-
}
|
|
1324
|
-
if (this instanceof wrapper) {
|
|
1325
|
-
return new func(...partialArgs);
|
|
1326
|
-
}
|
|
1327
|
-
return func.apply(this, partialArgs);
|
|
1328
|
-
};
|
|
1329
|
-
wrapper.placeholder = curryRightPlaceholder;
|
|
1330
|
-
return wrapper;
|
|
1331
|
-
}
|
|
1332
|
-
function makeCurryRight(func, arity, partialArgs) {
|
|
1333
|
-
function wrapper(...providedArgs) {
|
|
1334
|
-
const holders = providedArgs.filter(item => item === curryRight.placeholder);
|
|
1335
|
-
const length = providedArgs.length - holders.length;
|
|
1336
|
-
providedArgs = composeArgs(providedArgs, partialArgs);
|
|
1337
|
-
if (length < arity) {
|
|
1338
|
-
return makeCurryRight(func, arity - length, providedArgs);
|
|
1339
|
-
}
|
|
1340
|
-
if (this instanceof wrapper) {
|
|
1341
|
-
return new func(...providedArgs);
|
|
1342
|
-
}
|
|
1343
|
-
return func.apply(this, providedArgs);
|
|
1344
|
-
}
|
|
1345
|
-
wrapper.placeholder = curryRightPlaceholder;
|
|
1346
|
-
return wrapper;
|
|
1347
|
-
}
|
|
1348
|
-
function composeArgs(providedArgs, partialArgs) {
|
|
1349
|
-
const placeholderLength = partialArgs.filter(arg => arg === curryRight.placeholder).length;
|
|
1350
|
-
const rangeLength = Math.max(providedArgs.length - placeholderLength, 0);
|
|
1351
|
-
const args = [];
|
|
1352
|
-
let providedIndex = 0;
|
|
1353
|
-
for (let i = 0; i < rangeLength; i++) {
|
|
1354
|
-
args.push(providedArgs[providedIndex++]);
|
|
1355
|
-
}
|
|
1356
|
-
for (let i = 0; i < partialArgs.length; i++) {
|
|
1357
|
-
const arg = partialArgs[i];
|
|
1358
|
-
if (arg === curryRight.placeholder) {
|
|
1359
|
-
if (providedIndex < providedArgs.length) {
|
|
1360
|
-
args.push(providedArgs[providedIndex++]);
|
|
1361
|
-
}
|
|
1362
|
-
else {
|
|
1363
|
-
args.push(arg);
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
else {
|
|
1367
|
-
args.push(arg);
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
return args;
|
|
1371
|
-
}
|
|
1372
|
-
const curryRightPlaceholder = Symbol('curryRight.placeholder');
|
|
1373
|
-
curryRight.placeholder = curryRightPlaceholder;
|
|
1374
|
-
|
|
1375
1227
|
function debounce(func, debounceMs = 0, options = {}) {
|
|
1376
1228
|
if (typeof options !== 'object') {
|
|
1377
1229
|
options = {};
|
|
@@ -1661,7 +1513,7 @@ function defaults(object, ...sources) {
|
|
|
1661
1513
|
const key = keys[j];
|
|
1662
1514
|
const value = object[key];
|
|
1663
1515
|
if (value === undefined ||
|
|
1664
|
-
(!Object.hasOwn(object, key) &&
|
|
1516
|
+
(!Object.hasOwn(object, key) && isUndefined.eq(value, objectProto[key]))) {
|
|
1665
1517
|
object[key] = source[key];
|
|
1666
1518
|
}
|
|
1667
1519
|
}
|
|
@@ -1670,7 +1522,7 @@ function defaults(object, ...sources) {
|
|
|
1670
1522
|
}
|
|
1671
1523
|
|
|
1672
1524
|
function fromPairs(pairs) {
|
|
1673
|
-
if (!isArrayLike(pairs) && !(pairs instanceof Map)) {
|
|
1525
|
+
if (!isUndefined.isArrayLike(pairs) && !(pairs instanceof Map)) {
|
|
1674
1526
|
return {};
|
|
1675
1527
|
}
|
|
1676
1528
|
const result = {};
|
|
@@ -1682,7 +1534,7 @@ function fromPairs(pairs) {
|
|
|
1682
1534
|
|
|
1683
1535
|
function invertBy(object, iteratee) {
|
|
1684
1536
|
const result = {};
|
|
1685
|
-
if (
|
|
1537
|
+
if (isUndefined.isNil(object)) {
|
|
1686
1538
|
return result;
|
|
1687
1539
|
}
|
|
1688
1540
|
if (iteratee == null) {
|
|
@@ -1841,7 +1693,7 @@ function mergeWithDeep(target, source, merge, stack) {
|
|
|
1841
1693
|
}
|
|
1842
1694
|
|
|
1843
1695
|
function merge(object, ...sources) {
|
|
1844
|
-
return mergeWith(object, ...sources,
|
|
1696
|
+
return mergeWith(object, ...sources, partialRight.noop);
|
|
1845
1697
|
}
|
|
1846
1698
|
|
|
1847
1699
|
function unset(obj, path) {
|
|
@@ -2008,7 +1860,7 @@ function conforms(source) {
|
|
|
2008
1860
|
}
|
|
2009
1861
|
|
|
2010
1862
|
function isArrayBuffer(value) {
|
|
2011
|
-
return
|
|
1863
|
+
return isUndefined.isArrayBuffer(value);
|
|
2012
1864
|
}
|
|
2013
1865
|
|
|
2014
1866
|
function isBoolean(value) {
|
|
@@ -2016,14 +1868,34 @@ function isBoolean(value) {
|
|
|
2016
1868
|
}
|
|
2017
1869
|
|
|
2018
1870
|
function isDate(value) {
|
|
2019
|
-
return
|
|
1871
|
+
return isUndefined.isDate(value);
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
function isEmpty(value) {
|
|
1875
|
+
if (isUndefined.isArrayLike(value)) {
|
|
1876
|
+
if (typeof value.splice !== 'function' &&
|
|
1877
|
+
typeof value !== 'string' &&
|
|
1878
|
+
!Buffer.isBuffer(value) &&
|
|
1879
|
+
!isTypedArray(value) &&
|
|
1880
|
+
!isArguments(value)) {
|
|
1881
|
+
return false;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
if (typeof value === 'object' && value != null) {
|
|
1885
|
+
const constructor = value.constructor;
|
|
1886
|
+
const prototype = typeof constructor === 'function' ? constructor.prototype : Object.prototype;
|
|
1887
|
+
if (value === prototype) {
|
|
1888
|
+
return Object.keys(value).filter(x => x !== 'constructor').length === 0;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
return isUndefined.isEmpty(value);
|
|
2020
1892
|
}
|
|
2021
1893
|
|
|
2022
|
-
function isEqualWith(a, b, areValuesEqual =
|
|
1894
|
+
function isEqualWith(a, b, areValuesEqual = partialRight.noop) {
|
|
2023
1895
|
if (typeof areValuesEqual !== 'function') {
|
|
2024
|
-
areValuesEqual =
|
|
1896
|
+
areValuesEqual = partialRight.noop;
|
|
2025
1897
|
}
|
|
2026
|
-
return
|
|
1898
|
+
return isUndefined.isEqualWith(a, b, (...args) => {
|
|
2027
1899
|
const result = areValuesEqual(...args);
|
|
2028
1900
|
if (result !== undefined) {
|
|
2029
1901
|
return Boolean(result);
|
|
@@ -2038,7 +1910,7 @@ function isEqualWith(a, b, areValuesEqual = noop.noop) {
|
|
|
2038
1910
|
}
|
|
2039
1911
|
|
|
2040
1912
|
function isError(value) {
|
|
2041
|
-
return
|
|
1913
|
+
return isUndefined.getTag(value) === '[object Error]';
|
|
2042
1914
|
}
|
|
2043
1915
|
|
|
2044
1916
|
function isFinite(value) {
|
|
@@ -2050,7 +1922,7 @@ function isInteger(value) {
|
|
|
2050
1922
|
}
|
|
2051
1923
|
|
|
2052
1924
|
function isMap(value) {
|
|
2053
|
-
return
|
|
1925
|
+
return isUndefined.isMap(value);
|
|
2054
1926
|
}
|
|
2055
1927
|
|
|
2056
1928
|
function isNaN(value) {
|
|
@@ -2062,7 +1934,7 @@ function isNumber(value) {
|
|
|
2062
1934
|
}
|
|
2063
1935
|
|
|
2064
1936
|
function isRegExp(value) {
|
|
2065
|
-
return
|
|
1937
|
+
return isUndefined.isRegExp(value);
|
|
2066
1938
|
}
|
|
2067
1939
|
|
|
2068
1940
|
function isSafeInteger(value) {
|
|
@@ -2070,15 +1942,15 @@ function isSafeInteger(value) {
|
|
|
2070
1942
|
}
|
|
2071
1943
|
|
|
2072
1944
|
function isSet(value) {
|
|
2073
|
-
return
|
|
1945
|
+
return isUndefined.isSet(value);
|
|
2074
1946
|
}
|
|
2075
1947
|
|
|
2076
1948
|
function isWeakMap(value) {
|
|
2077
|
-
return
|
|
1949
|
+
return isUndefined.isWeakMap(value);
|
|
2078
1950
|
}
|
|
2079
1951
|
|
|
2080
1952
|
function isWeakSet(value) {
|
|
2081
|
-
return
|
|
1953
|
+
return isUndefined.isWeakSet(value);
|
|
2082
1954
|
}
|
|
2083
1955
|
|
|
2084
1956
|
function toString(value) {
|
|
@@ -2329,21 +2201,6 @@ function defaultTo(value, defaultValue) {
|
|
|
2329
2201
|
return value;
|
|
2330
2202
|
}
|
|
2331
2203
|
|
|
2332
|
-
function iteratee(value) {
|
|
2333
|
-
if (value == null) {
|
|
2334
|
-
return (value) => value;
|
|
2335
|
-
}
|
|
2336
|
-
switch (typeof value) {
|
|
2337
|
-
case 'function': {
|
|
2338
|
-
return value;
|
|
2339
|
-
}
|
|
2340
|
-
case 'object': {
|
|
2341
|
-
return Array.isArray(value) ? matchesProperty(value[0], value[1]) : matches(value);
|
|
2342
|
-
}
|
|
2343
|
-
}
|
|
2344
|
-
return property(value);
|
|
2345
|
-
}
|
|
2346
|
-
|
|
2347
2204
|
function times(n, getValue) {
|
|
2348
2205
|
n = toInteger(n);
|
|
2349
2206
|
if (n < 1 || !Number.isSafeInteger(n)) {
|
|
@@ -2383,7 +2240,6 @@ function uniqueId(prefix = '') {
|
|
|
2383
2240
|
|
|
2384
2241
|
exports.at = zipWith.at;
|
|
2385
2242
|
exports.countBy = zipWith.countBy;
|
|
2386
|
-
exports.differenceBy = zipWith.differenceBy;
|
|
2387
2243
|
exports.differenceWith = zipWith.differenceWith;
|
|
2388
2244
|
exports.flatMap = zipWith.flatMap;
|
|
2389
2245
|
exports.flatMapDeep = zipWith.flatMapDeep;
|
|
@@ -2425,10 +2281,10 @@ exports.identity = unary.identity;
|
|
|
2425
2281
|
exports.memoize = unary.memoize;
|
|
2426
2282
|
exports.negate = unary.negate;
|
|
2427
2283
|
exports.once = unary.once;
|
|
2428
|
-
exports.partial = unary.partial;
|
|
2429
|
-
exports.partialRight = unary.partialRight;
|
|
2430
2284
|
exports.unary = unary.unary;
|
|
2431
|
-
exports.noop =
|
|
2285
|
+
exports.noop = partialRight.noop;
|
|
2286
|
+
exports.partial = partialRight.partial;
|
|
2287
|
+
exports.partialRight = partialRight.partialRight;
|
|
2432
2288
|
exports.mean = sumBy.mean;
|
|
2433
2289
|
exports.meanBy = sumBy.meanBy;
|
|
2434
2290
|
exports.median = sumBy.median;
|
|
@@ -2446,21 +2302,26 @@ exports.omitBy = toMerged.omitBy;
|
|
|
2446
2302
|
exports.pickBy = toMerged.pickBy;
|
|
2447
2303
|
exports.toMerged = toMerged.toMerged;
|
|
2448
2304
|
exports.isPrimitive = isPlainObject$1.isPrimitive;
|
|
2449
|
-
exports.
|
|
2450
|
-
exports.
|
|
2451
|
-
exports.
|
|
2452
|
-
exports.
|
|
2453
|
-
exports.
|
|
2454
|
-
exports.
|
|
2455
|
-
exports.
|
|
2456
|
-
exports.
|
|
2457
|
-
exports.
|
|
2458
|
-
exports.
|
|
2459
|
-
exports.
|
|
2460
|
-
exports.
|
|
2305
|
+
exports.bind = isUndefined.bind;
|
|
2306
|
+
exports.bindKey = isUndefined.bindKey;
|
|
2307
|
+
exports.curry = isUndefined.curry;
|
|
2308
|
+
exports.curryRight = isUndefined.curryRight;
|
|
2309
|
+
exports.eq = isUndefined.eq;
|
|
2310
|
+
exports.isArrayLike = isUndefined.isArrayLike;
|
|
2311
|
+
exports.isBlob = isUndefined.isBlob;
|
|
2312
|
+
exports.isEqual = isUndefined.isEqual;
|
|
2313
|
+
exports.isFile = isUndefined.isFile;
|
|
2314
|
+
exports.isFunction = isUndefined.isFunction;
|
|
2315
|
+
exports.isJSONArray = isUndefined.isJSONArray;
|
|
2316
|
+
exports.isJSONObject = isUndefined.isJSONObject;
|
|
2317
|
+
exports.isJSONValue = isUndefined.isJSONValue;
|
|
2318
|
+
exports.isLength = isUndefined.isLength;
|
|
2319
|
+
exports.isNotNil = isUndefined.isNotNil;
|
|
2320
|
+
exports.isNull = isUndefined.isNull;
|
|
2321
|
+
exports.isUndefined = isUndefined.isUndefined;
|
|
2322
|
+
exports.deburr = deburr.deburr;
|
|
2461
2323
|
exports.capitalize = upperFirst.capitalize;
|
|
2462
2324
|
exports.constantCase = upperFirst.constantCase;
|
|
2463
|
-
exports.deburr = upperFirst.deburr;
|
|
2464
2325
|
exports.escapeRegExp = upperFirst.escapeRegExp;
|
|
2465
2326
|
exports.lowerFirst = upperFirst.lowerFirst;
|
|
2466
2327
|
exports.pascalCase = upperFirst.pascalCase;
|
|
@@ -2470,8 +2331,6 @@ exports.invariant = util_index.invariant;
|
|
|
2470
2331
|
exports.ary = ary;
|
|
2471
2332
|
exports.attempt = attempt;
|
|
2472
2333
|
exports.before = before;
|
|
2473
|
-
exports.bind = bind;
|
|
2474
|
-
exports.bindKey = bindKey;
|
|
2475
2334
|
exports.camelCase = camelCase;
|
|
2476
2335
|
exports.castArray = castArray;
|
|
2477
2336
|
exports.ceil = ceil;
|
|
@@ -2483,13 +2342,12 @@ exports.concat = concat;
|
|
|
2483
2342
|
exports.conforms = conforms;
|
|
2484
2343
|
exports.conformsTo = conformsTo;
|
|
2485
2344
|
exports.constant = constant;
|
|
2486
|
-
exports.curry = curry;
|
|
2487
|
-
exports.curryRight = curryRight;
|
|
2488
2345
|
exports.debounce = debounce;
|
|
2489
2346
|
exports.defaultTo = defaultTo;
|
|
2490
2347
|
exports.defaults = defaults;
|
|
2491
2348
|
exports.defer = defer;
|
|
2492
2349
|
exports.difference = difference;
|
|
2350
|
+
exports.differenceBy = differenceBy;
|
|
2493
2351
|
exports.drop = drop;
|
|
2494
2352
|
exports.dropRight = dropRight;
|
|
2495
2353
|
exports.dropRightWhile = dropRightWhile;
|
|
@@ -2523,10 +2381,10 @@ exports.invertBy = invertBy;
|
|
|
2523
2381
|
exports.isArguments = isArguments;
|
|
2524
2382
|
exports.isArray = isArray;
|
|
2525
2383
|
exports.isArrayBuffer = isArrayBuffer;
|
|
2526
|
-
exports.isArrayLike = isArrayLike;
|
|
2527
2384
|
exports.isArrayLikeObject = isArrayLikeObject;
|
|
2528
2385
|
exports.isBoolean = isBoolean;
|
|
2529
2386
|
exports.isDate = isDate;
|
|
2387
|
+
exports.isEmpty = isEmpty;
|
|
2530
2388
|
exports.isEqualWith = isEqualWith;
|
|
2531
2389
|
exports.isError = isError;
|
|
2532
2390
|
exports.isFinite = isFinite;
|