es-toolkit 1.26.1-dev.836 → 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/index.d.mts +1 -0
- package/dist/compat/index.d.ts +1 -0
- package/dist/compat/index.js +93 -246
- package/dist/compat/index.mjs +22 -21
- 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/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.d.mts
CHANGED
|
@@ -167,6 +167,7 @@ export { isArrayLike } from './predicate/isArrayLike.mjs';
|
|
|
167
167
|
export { isArrayLikeObject } from './predicate/isArrayLikeObject.mjs';
|
|
168
168
|
export { isBoolean } from './predicate/isBoolean.mjs';
|
|
169
169
|
export { isDate } from './predicate/isDate.mjs';
|
|
170
|
+
export { isEmpty } from './predicate/isEmpty.mjs';
|
|
170
171
|
export { isEqualWith } from './predicate/isEqualWith.mjs';
|
|
171
172
|
export { isError } from './predicate/isError.mjs';
|
|
172
173
|
export { isFinite } from './predicate/isFinite.mjs';
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -167,6 +167,7 @@ export { isArrayLike } from './predicate/isArrayLike.js';
|
|
|
167
167
|
export { isArrayLikeObject } from './predicate/isArrayLikeObject.js';
|
|
168
168
|
export { isBoolean } from './predicate/isBoolean.js';
|
|
169
169
|
export { isDate } from './predicate/isDate.js';
|
|
170
|
+
export { isEmpty } from './predicate/isEmpty.js';
|
|
170
171
|
export { isEqualWith } from './predicate/isEqualWith.js';
|
|
171
172
|
export { isError } from './predicate/isError.js';
|
|
172
173
|
export { isFinite } from './predicate/isFinite.js';
|
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) {
|
|
@@ -66,7 +63,7 @@ function difference(arr, ...values) {
|
|
|
66
63
|
function flatten(value, depth = 1) {
|
|
67
64
|
const result = [];
|
|
68
65
|
const flooredDepth = Math.floor(depth);
|
|
69
|
-
if (!isArrayLike(value)) {
|
|
66
|
+
if (!isUndefined.isArrayLike(value)) {
|
|
70
67
|
return result;
|
|
71
68
|
}
|
|
72
69
|
const recursive = (arr, currentDepth) => {
|
|
@@ -93,7 +90,7 @@ function flatten(value, depth = 1) {
|
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
function last(array) {
|
|
96
|
-
if (!isArrayLike(array)) {
|
|
93
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
97
94
|
return undefined;
|
|
98
95
|
}
|
|
99
96
|
return zipWith.last(Array.from(array));
|
|
@@ -277,7 +274,7 @@ function isMatch(target, source) {
|
|
|
277
274
|
}
|
|
278
275
|
default: {
|
|
279
276
|
if (!isObject(target)) {
|
|
280
|
-
return
|
|
277
|
+
return isUndefined.eq(target, source);
|
|
281
278
|
}
|
|
282
279
|
return !source;
|
|
283
280
|
}
|
|
@@ -339,14 +336,14 @@ function cloneDeep(obj) {
|
|
|
339
336
|
return toMerged.cloneDeep(obj);
|
|
340
337
|
}
|
|
341
338
|
switch (Object.prototype.toString.call(obj)) {
|
|
342
|
-
case
|
|
343
|
-
case
|
|
344
|
-
case
|
|
339
|
+
case isUndefined.numberTag:
|
|
340
|
+
case isUndefined.stringTag:
|
|
341
|
+
case isUndefined.booleanTag: {
|
|
345
342
|
const result = new obj.constructor(obj?.valueOf());
|
|
346
343
|
toMerged.copyProperties(result, obj);
|
|
347
344
|
return result;
|
|
348
345
|
}
|
|
349
|
-
case
|
|
346
|
+
case isUndefined.argumentsTag: {
|
|
350
347
|
const result = {};
|
|
351
348
|
toMerged.copyProperties(result, obj);
|
|
352
349
|
result.length = obj.length;
|
|
@@ -375,7 +372,7 @@ function isIndex(value) {
|
|
|
375
372
|
}
|
|
376
373
|
|
|
377
374
|
function isArguments(value) {
|
|
378
|
-
return value !== null && typeof value === 'object' &&
|
|
375
|
+
return value !== null && typeof value === 'object' && isUndefined.getTag(value) === '[object Arguments]';
|
|
379
376
|
}
|
|
380
377
|
|
|
381
378
|
function has(object, path) {
|
|
@@ -488,7 +485,7 @@ function toInteger(value) {
|
|
|
488
485
|
}
|
|
489
486
|
|
|
490
487
|
function drop(collection, itemsCount = 1, guard) {
|
|
491
|
-
if (!isArrayLike(collection)) {
|
|
488
|
+
if (!isUndefined.isArrayLike(collection)) {
|
|
492
489
|
return [];
|
|
493
490
|
}
|
|
494
491
|
itemsCount = guard ? 1 : toInteger(itemsCount);
|
|
@@ -496,7 +493,7 @@ function drop(collection, itemsCount = 1, guard) {
|
|
|
496
493
|
}
|
|
497
494
|
|
|
498
495
|
function dropRight(collection, itemsCount = 1, guard) {
|
|
499
|
-
if (!isArrayLike(collection)) {
|
|
496
|
+
if (!isUndefined.isArrayLike(collection)) {
|
|
500
497
|
return [];
|
|
501
498
|
}
|
|
502
499
|
itemsCount = guard ? 1 : toInteger(itemsCount);
|
|
@@ -504,7 +501,7 @@ function dropRight(collection, itemsCount = 1, guard) {
|
|
|
504
501
|
}
|
|
505
502
|
|
|
506
503
|
function dropRightWhile(arr, predicate) {
|
|
507
|
-
if (!isArrayLike(arr)) {
|
|
504
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
508
505
|
return [];
|
|
509
506
|
}
|
|
510
507
|
return dropRightWhileImpl(Array.from(arr), predicate);
|
|
@@ -531,7 +528,7 @@ function dropRightWhileImpl(arr, predicate) {
|
|
|
531
528
|
}
|
|
532
529
|
|
|
533
530
|
function dropWhile(arr, predicate) {
|
|
534
|
-
if (!isArrayLike(arr)) {
|
|
531
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
535
532
|
return [];
|
|
536
533
|
}
|
|
537
534
|
return dropWhileImpl(Array.from(arr), predicate);
|
|
@@ -561,9 +558,9 @@ function isIterateeCall(value, index, object) {
|
|
|
561
558
|
if (!isObject(object)) {
|
|
562
559
|
return false;
|
|
563
560
|
}
|
|
564
|
-
if ((typeof index === 'number' && isArrayLike(object) && isIndex(index) && index < object.length) ||
|
|
561
|
+
if ((typeof index === 'number' && isUndefined.isArrayLike(object) && isIndex(index) && index < object.length) ||
|
|
565
562
|
(typeof index === 'string' && index in object)) {
|
|
566
|
-
return
|
|
563
|
+
return isUndefined.eq(object[index], value);
|
|
567
564
|
}
|
|
568
565
|
return false;
|
|
569
566
|
}
|
|
@@ -615,7 +612,7 @@ function isString(value) {
|
|
|
615
612
|
}
|
|
616
613
|
|
|
617
614
|
function fill(array, value, start = 0, end = array ? array.length : 0) {
|
|
618
|
-
if (!isArrayLike(array)) {
|
|
615
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
619
616
|
return [];
|
|
620
617
|
}
|
|
621
618
|
if (isString(array)) {
|
|
@@ -779,7 +776,7 @@ function flattenDepth(value, depth = 1) {
|
|
|
779
776
|
}
|
|
780
777
|
|
|
781
778
|
function head(arr) {
|
|
782
|
-
if (!isArrayLike(arr)) {
|
|
779
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
783
780
|
return undefined;
|
|
784
781
|
}
|
|
785
782
|
return zipWith.head(Array.from(arr));
|
|
@@ -813,7 +810,7 @@ function includes(source, target, fromIndex, guard) {
|
|
|
813
810
|
}
|
|
814
811
|
for (let i = fromIndex; i < keys.length; i++) {
|
|
815
812
|
const value = Reflect.get(source, keys[i]);
|
|
816
|
-
if (
|
|
813
|
+
if (isUndefined.eq(value, target)) {
|
|
817
814
|
return true;
|
|
818
815
|
}
|
|
819
816
|
}
|
|
@@ -821,7 +818,7 @@ function includes(source, target, fromIndex, guard) {
|
|
|
821
818
|
}
|
|
822
819
|
|
|
823
820
|
function indexOf(array, searchElement, fromIndex) {
|
|
824
|
-
if (!isArrayLike(array)) {
|
|
821
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
825
822
|
return -1;
|
|
826
823
|
}
|
|
827
824
|
if (Number.isNaN(searchElement)) {
|
|
@@ -886,7 +883,7 @@ function intersectionBy(array, ...values) {
|
|
|
886
883
|
}
|
|
887
884
|
|
|
888
885
|
function join(array, separator = ',') {
|
|
889
|
-
if (!isArrayLike(array)) {
|
|
886
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
890
887
|
return '';
|
|
891
888
|
}
|
|
892
889
|
return Array.from(array).join(separator);
|
|
@@ -1017,14 +1014,14 @@ function sample(collection) {
|
|
|
1017
1014
|
if (collection == null) {
|
|
1018
1015
|
return undefined;
|
|
1019
1016
|
}
|
|
1020
|
-
if (isArrayLike(collection)) {
|
|
1017
|
+
if (isUndefined.isArrayLike(collection)) {
|
|
1021
1018
|
return zipWith.sample(Array.from(collection));
|
|
1022
1019
|
}
|
|
1023
1020
|
return zipWith.sample(Object.values(collection));
|
|
1024
1021
|
}
|
|
1025
1022
|
|
|
1026
1023
|
function size(target) {
|
|
1027
|
-
if (
|
|
1024
|
+
if (isUndefined.isNil(target)) {
|
|
1028
1025
|
return 0;
|
|
1029
1026
|
}
|
|
1030
1027
|
if (target instanceof Map || target instanceof Set) {
|
|
@@ -1034,7 +1031,7 @@ function size(target) {
|
|
|
1034
1031
|
}
|
|
1035
1032
|
|
|
1036
1033
|
function slice(array, start, end) {
|
|
1037
|
-
if (!isArrayLike(array)) {
|
|
1034
|
+
if (!isUndefined.isArrayLike(array)) {
|
|
1038
1035
|
return [];
|
|
1039
1036
|
}
|
|
1040
1037
|
const length = array.length;
|
|
@@ -1121,7 +1118,7 @@ function sortBy(collection, ...criteria) {
|
|
|
1121
1118
|
}
|
|
1122
1119
|
|
|
1123
1120
|
function tail(arr) {
|
|
1124
|
-
if (!isArrayLike(arr)) {
|
|
1121
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
1125
1122
|
return [];
|
|
1126
1123
|
}
|
|
1127
1124
|
return zipWith.tail(Array.from(arr));
|
|
@@ -1129,7 +1126,7 @@ function tail(arr) {
|
|
|
1129
1126
|
|
|
1130
1127
|
function take(arr, count = 1, guard) {
|
|
1131
1128
|
count = guard ? 1 : toInteger(count);
|
|
1132
|
-
if (count < 1 || !isArrayLike(arr)) {
|
|
1129
|
+
if (count < 1 || !isUndefined.isArrayLike(arr)) {
|
|
1133
1130
|
return [];
|
|
1134
1131
|
}
|
|
1135
1132
|
return zipWith.take(Array.from(arr), count);
|
|
@@ -1137,14 +1134,14 @@ function take(arr, count = 1, guard) {
|
|
|
1137
1134
|
|
|
1138
1135
|
function takeRight(arr, count = 1, guard) {
|
|
1139
1136
|
count = guard ? 1 : toInteger(count);
|
|
1140
|
-
if (count <= 0 || !isArrayLike(arr)) {
|
|
1137
|
+
if (count <= 0 || !isUndefined.isArrayLike(arr)) {
|
|
1141
1138
|
return [];
|
|
1142
1139
|
}
|
|
1143
1140
|
return zipWith.takeRight(Array.from(arr), count);
|
|
1144
1141
|
}
|
|
1145
1142
|
|
|
1146
1143
|
function uniq(arr) {
|
|
1147
|
-
if (!isArrayLike(arr)) {
|
|
1144
|
+
if (!isUndefined.isArrayLike(arr)) {
|
|
1148
1145
|
return [];
|
|
1149
1146
|
}
|
|
1150
1147
|
return zipWith.uniq(Array.from(arr));
|
|
@@ -1175,10 +1172,10 @@ function set(obj, path, value) {
|
|
|
1175
1172
|
|
|
1176
1173
|
function zipObjectDeep(keys, values) {
|
|
1177
1174
|
const result = {};
|
|
1178
|
-
if (!isArrayLike(keys)) {
|
|
1175
|
+
if (!isUndefined.isArrayLike(keys)) {
|
|
1179
1176
|
return result;
|
|
1180
1177
|
}
|
|
1181
|
-
if (!isArrayLike(values)) {
|
|
1178
|
+
if (!isUndefined.isArrayLike(values)) {
|
|
1182
1179
|
values = [];
|
|
1183
1180
|
}
|
|
1184
1181
|
const zipped = zipWith.zip(Array.from(keys), Array.from(values));
|
|
@@ -1227,177 +1224,6 @@ function before(n, func) {
|
|
|
1227
1224
|
};
|
|
1228
1225
|
}
|
|
1229
1226
|
|
|
1230
|
-
function bind(func, thisObj, ...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 === bind.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 func(...args);
|
|
1248
|
-
}
|
|
1249
|
-
return func.apply(thisObj, args);
|
|
1250
|
-
};
|
|
1251
|
-
return bound;
|
|
1252
|
-
}
|
|
1253
|
-
const bindPlaceholder = Symbol('bind.placeholder');
|
|
1254
|
-
bind.placeholder = bindPlaceholder;
|
|
1255
|
-
|
|
1256
|
-
function bindKey(object, key, ...partialArgs) {
|
|
1257
|
-
const bound = function (...providedArgs) {
|
|
1258
|
-
const args = [];
|
|
1259
|
-
let startIndex = 0;
|
|
1260
|
-
for (let i = 0; i < partialArgs.length; i++) {
|
|
1261
|
-
const arg = partialArgs[i];
|
|
1262
|
-
if (arg === bindKey.placeholder) {
|
|
1263
|
-
args.push(providedArgs[startIndex++]);
|
|
1264
|
-
}
|
|
1265
|
-
else {
|
|
1266
|
-
args.push(arg);
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
1270
|
-
args.push(providedArgs[i]);
|
|
1271
|
-
}
|
|
1272
|
-
if (this instanceof bound) {
|
|
1273
|
-
return new object[key](...args);
|
|
1274
|
-
}
|
|
1275
|
-
return object[key].apply(object, args);
|
|
1276
|
-
};
|
|
1277
|
-
return bound;
|
|
1278
|
-
}
|
|
1279
|
-
const bindKeyPlaceholder = Symbol('bindKey.placeholder');
|
|
1280
|
-
bindKey.placeholder = bindKeyPlaceholder;
|
|
1281
|
-
|
|
1282
|
-
function curry(func, arity = func.length, guard) {
|
|
1283
|
-
arity = guard ? func.length : arity;
|
|
1284
|
-
arity = Number.parseInt(arity, 10);
|
|
1285
|
-
if (Number.isNaN(arity) || arity < 1) {
|
|
1286
|
-
arity = 0;
|
|
1287
|
-
}
|
|
1288
|
-
const wrapper = function (...partialArgs) {
|
|
1289
|
-
const holders = partialArgs.filter(item => item === curry.placeholder);
|
|
1290
|
-
const length = partialArgs.length - holders.length;
|
|
1291
|
-
if (length < arity) {
|
|
1292
|
-
return makeCurry(func, arity - length, partialArgs);
|
|
1293
|
-
}
|
|
1294
|
-
if (this instanceof wrapper) {
|
|
1295
|
-
return new func(...partialArgs);
|
|
1296
|
-
}
|
|
1297
|
-
return func.apply(this, partialArgs);
|
|
1298
|
-
};
|
|
1299
|
-
wrapper.placeholder = curryPlaceholder;
|
|
1300
|
-
return wrapper;
|
|
1301
|
-
}
|
|
1302
|
-
function makeCurry(func, arity, partialArgs) {
|
|
1303
|
-
function wrapper(...providedArgs) {
|
|
1304
|
-
const holders = providedArgs.filter(item => item === curry.placeholder);
|
|
1305
|
-
const length = providedArgs.length - holders.length;
|
|
1306
|
-
providedArgs = composeArgs$1(providedArgs, partialArgs);
|
|
1307
|
-
if (length < arity) {
|
|
1308
|
-
return makeCurry(func, arity - length, providedArgs);
|
|
1309
|
-
}
|
|
1310
|
-
if (this instanceof wrapper) {
|
|
1311
|
-
return new func(...providedArgs);
|
|
1312
|
-
}
|
|
1313
|
-
return func.apply(this, providedArgs);
|
|
1314
|
-
}
|
|
1315
|
-
wrapper.placeholder = curryPlaceholder;
|
|
1316
|
-
return wrapper;
|
|
1317
|
-
}
|
|
1318
|
-
function composeArgs$1(providedArgs, partialArgs) {
|
|
1319
|
-
const args = [];
|
|
1320
|
-
let startIndex = 0;
|
|
1321
|
-
for (let i = 0; i < partialArgs.length; i++) {
|
|
1322
|
-
const arg = partialArgs[i];
|
|
1323
|
-
if (arg === curry.placeholder && startIndex < providedArgs.length) {
|
|
1324
|
-
args.push(providedArgs[startIndex++]);
|
|
1325
|
-
}
|
|
1326
|
-
else {
|
|
1327
|
-
args.push(arg);
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
1331
|
-
args.push(providedArgs[i]);
|
|
1332
|
-
}
|
|
1333
|
-
return args;
|
|
1334
|
-
}
|
|
1335
|
-
const curryPlaceholder = Symbol('curry.placeholder');
|
|
1336
|
-
curry.placeholder = curryPlaceholder;
|
|
1337
|
-
|
|
1338
|
-
function curryRight(func, arity = func.length, guard) {
|
|
1339
|
-
arity = guard ? func.length : arity;
|
|
1340
|
-
arity = Number.parseInt(arity, 10);
|
|
1341
|
-
if (Number.isNaN(arity) || arity < 1) {
|
|
1342
|
-
arity = 0;
|
|
1343
|
-
}
|
|
1344
|
-
const wrapper = function (...partialArgs) {
|
|
1345
|
-
const holders = partialArgs.filter(item => item === curryRight.placeholder);
|
|
1346
|
-
const length = partialArgs.length - holders.length;
|
|
1347
|
-
if (length < arity) {
|
|
1348
|
-
return makeCurryRight(func, arity - length, partialArgs);
|
|
1349
|
-
}
|
|
1350
|
-
if (this instanceof wrapper) {
|
|
1351
|
-
return new func(...partialArgs);
|
|
1352
|
-
}
|
|
1353
|
-
return func.apply(this, partialArgs);
|
|
1354
|
-
};
|
|
1355
|
-
wrapper.placeholder = curryRightPlaceholder;
|
|
1356
|
-
return wrapper;
|
|
1357
|
-
}
|
|
1358
|
-
function makeCurryRight(func, arity, partialArgs) {
|
|
1359
|
-
function wrapper(...providedArgs) {
|
|
1360
|
-
const holders = providedArgs.filter(item => item === curryRight.placeholder);
|
|
1361
|
-
const length = providedArgs.length - holders.length;
|
|
1362
|
-
providedArgs = composeArgs(providedArgs, partialArgs);
|
|
1363
|
-
if (length < arity) {
|
|
1364
|
-
return makeCurryRight(func, arity - length, providedArgs);
|
|
1365
|
-
}
|
|
1366
|
-
if (this instanceof wrapper) {
|
|
1367
|
-
return new func(...providedArgs);
|
|
1368
|
-
}
|
|
1369
|
-
return func.apply(this, providedArgs);
|
|
1370
|
-
}
|
|
1371
|
-
wrapper.placeholder = curryRightPlaceholder;
|
|
1372
|
-
return wrapper;
|
|
1373
|
-
}
|
|
1374
|
-
function composeArgs(providedArgs, partialArgs) {
|
|
1375
|
-
const placeholderLength = partialArgs.filter(arg => arg === curryRight.placeholder).length;
|
|
1376
|
-
const rangeLength = Math.max(providedArgs.length - placeholderLength, 0);
|
|
1377
|
-
const args = [];
|
|
1378
|
-
let providedIndex = 0;
|
|
1379
|
-
for (let i = 0; i < rangeLength; i++) {
|
|
1380
|
-
args.push(providedArgs[providedIndex++]);
|
|
1381
|
-
}
|
|
1382
|
-
for (let i = 0; i < partialArgs.length; i++) {
|
|
1383
|
-
const arg = partialArgs[i];
|
|
1384
|
-
if (arg === curryRight.placeholder) {
|
|
1385
|
-
if (providedIndex < providedArgs.length) {
|
|
1386
|
-
args.push(providedArgs[providedIndex++]);
|
|
1387
|
-
}
|
|
1388
|
-
else {
|
|
1389
|
-
args.push(arg);
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
else {
|
|
1393
|
-
args.push(arg);
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
return args;
|
|
1397
|
-
}
|
|
1398
|
-
const curryRightPlaceholder = Symbol('curryRight.placeholder');
|
|
1399
|
-
curryRight.placeholder = curryRightPlaceholder;
|
|
1400
|
-
|
|
1401
1227
|
function debounce(func, debounceMs = 0, options = {}) {
|
|
1402
1228
|
if (typeof options !== 'object') {
|
|
1403
1229
|
options = {};
|
|
@@ -1687,7 +1513,7 @@ function defaults(object, ...sources) {
|
|
|
1687
1513
|
const key = keys[j];
|
|
1688
1514
|
const value = object[key];
|
|
1689
1515
|
if (value === undefined ||
|
|
1690
|
-
(!Object.hasOwn(object, key) &&
|
|
1516
|
+
(!Object.hasOwn(object, key) && isUndefined.eq(value, objectProto[key]))) {
|
|
1691
1517
|
object[key] = source[key];
|
|
1692
1518
|
}
|
|
1693
1519
|
}
|
|
@@ -1696,7 +1522,7 @@ function defaults(object, ...sources) {
|
|
|
1696
1522
|
}
|
|
1697
1523
|
|
|
1698
1524
|
function fromPairs(pairs) {
|
|
1699
|
-
if (!isArrayLike(pairs) && !(pairs instanceof Map)) {
|
|
1525
|
+
if (!isUndefined.isArrayLike(pairs) && !(pairs instanceof Map)) {
|
|
1700
1526
|
return {};
|
|
1701
1527
|
}
|
|
1702
1528
|
const result = {};
|
|
@@ -1708,7 +1534,7 @@ function fromPairs(pairs) {
|
|
|
1708
1534
|
|
|
1709
1535
|
function invertBy(object, iteratee) {
|
|
1710
1536
|
const result = {};
|
|
1711
|
-
if (
|
|
1537
|
+
if (isUndefined.isNil(object)) {
|
|
1712
1538
|
return result;
|
|
1713
1539
|
}
|
|
1714
1540
|
if (iteratee == null) {
|
|
@@ -1867,7 +1693,7 @@ function mergeWithDeep(target, source, merge, stack) {
|
|
|
1867
1693
|
}
|
|
1868
1694
|
|
|
1869
1695
|
function merge(object, ...sources) {
|
|
1870
|
-
return mergeWith(object, ...sources,
|
|
1696
|
+
return mergeWith(object, ...sources, partialRight.noop);
|
|
1871
1697
|
}
|
|
1872
1698
|
|
|
1873
1699
|
function unset(obj, path) {
|
|
@@ -2034,7 +1860,7 @@ function conforms(source) {
|
|
|
2034
1860
|
}
|
|
2035
1861
|
|
|
2036
1862
|
function isArrayBuffer(value) {
|
|
2037
|
-
return
|
|
1863
|
+
return isUndefined.isArrayBuffer(value);
|
|
2038
1864
|
}
|
|
2039
1865
|
|
|
2040
1866
|
function isBoolean(value) {
|
|
@@ -2042,14 +1868,34 @@ function isBoolean(value) {
|
|
|
2042
1868
|
}
|
|
2043
1869
|
|
|
2044
1870
|
function isDate(value) {
|
|
2045
|
-
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);
|
|
2046
1892
|
}
|
|
2047
1893
|
|
|
2048
|
-
function isEqualWith(a, b, areValuesEqual =
|
|
1894
|
+
function isEqualWith(a, b, areValuesEqual = partialRight.noop) {
|
|
2049
1895
|
if (typeof areValuesEqual !== 'function') {
|
|
2050
|
-
areValuesEqual =
|
|
1896
|
+
areValuesEqual = partialRight.noop;
|
|
2051
1897
|
}
|
|
2052
|
-
return
|
|
1898
|
+
return isUndefined.isEqualWith(a, b, (...args) => {
|
|
2053
1899
|
const result = areValuesEqual(...args);
|
|
2054
1900
|
if (result !== undefined) {
|
|
2055
1901
|
return Boolean(result);
|
|
@@ -2064,7 +1910,7 @@ function isEqualWith(a, b, areValuesEqual = noop.noop) {
|
|
|
2064
1910
|
}
|
|
2065
1911
|
|
|
2066
1912
|
function isError(value) {
|
|
2067
|
-
return
|
|
1913
|
+
return isUndefined.getTag(value) === '[object Error]';
|
|
2068
1914
|
}
|
|
2069
1915
|
|
|
2070
1916
|
function isFinite(value) {
|
|
@@ -2076,7 +1922,7 @@ function isInteger(value) {
|
|
|
2076
1922
|
}
|
|
2077
1923
|
|
|
2078
1924
|
function isMap(value) {
|
|
2079
|
-
return
|
|
1925
|
+
return isUndefined.isMap(value);
|
|
2080
1926
|
}
|
|
2081
1927
|
|
|
2082
1928
|
function isNaN(value) {
|
|
@@ -2088,7 +1934,7 @@ function isNumber(value) {
|
|
|
2088
1934
|
}
|
|
2089
1935
|
|
|
2090
1936
|
function isRegExp(value) {
|
|
2091
|
-
return
|
|
1937
|
+
return isUndefined.isRegExp(value);
|
|
2092
1938
|
}
|
|
2093
1939
|
|
|
2094
1940
|
function isSafeInteger(value) {
|
|
@@ -2096,15 +1942,15 @@ function isSafeInteger(value) {
|
|
|
2096
1942
|
}
|
|
2097
1943
|
|
|
2098
1944
|
function isSet(value) {
|
|
2099
|
-
return
|
|
1945
|
+
return isUndefined.isSet(value);
|
|
2100
1946
|
}
|
|
2101
1947
|
|
|
2102
1948
|
function isWeakMap(value) {
|
|
2103
|
-
return
|
|
1949
|
+
return isUndefined.isWeakMap(value);
|
|
2104
1950
|
}
|
|
2105
1951
|
|
|
2106
1952
|
function isWeakSet(value) {
|
|
2107
|
-
return
|
|
1953
|
+
return isUndefined.isWeakSet(value);
|
|
2108
1954
|
}
|
|
2109
1955
|
|
|
2110
1956
|
function toString(value) {
|
|
@@ -2435,10 +2281,10 @@ exports.identity = unary.identity;
|
|
|
2435
2281
|
exports.memoize = unary.memoize;
|
|
2436
2282
|
exports.negate = unary.negate;
|
|
2437
2283
|
exports.once = unary.once;
|
|
2438
|
-
exports.partial = unary.partial;
|
|
2439
|
-
exports.partialRight = unary.partialRight;
|
|
2440
2284
|
exports.unary = unary.unary;
|
|
2441
|
-
exports.noop =
|
|
2285
|
+
exports.noop = partialRight.noop;
|
|
2286
|
+
exports.partial = partialRight.partial;
|
|
2287
|
+
exports.partialRight = partialRight.partialRight;
|
|
2442
2288
|
exports.mean = sumBy.mean;
|
|
2443
2289
|
exports.meanBy = sumBy.meanBy;
|
|
2444
2290
|
exports.median = sumBy.median;
|
|
@@ -2456,21 +2302,26 @@ exports.omitBy = toMerged.omitBy;
|
|
|
2456
2302
|
exports.pickBy = toMerged.pickBy;
|
|
2457
2303
|
exports.toMerged = toMerged.toMerged;
|
|
2458
2304
|
exports.isPrimitive = isPlainObject$1.isPrimitive;
|
|
2459
|
-
exports.
|
|
2460
|
-
exports.
|
|
2461
|
-
exports.
|
|
2462
|
-
exports.
|
|
2463
|
-
exports.
|
|
2464
|
-
exports.
|
|
2465
|
-
exports.
|
|
2466
|
-
exports.
|
|
2467
|
-
exports.
|
|
2468
|
-
exports.
|
|
2469
|
-
exports.
|
|
2470
|
-
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;
|
|
2471
2323
|
exports.capitalize = upperFirst.capitalize;
|
|
2472
2324
|
exports.constantCase = upperFirst.constantCase;
|
|
2473
|
-
exports.deburr = upperFirst.deburr;
|
|
2474
2325
|
exports.escapeRegExp = upperFirst.escapeRegExp;
|
|
2475
2326
|
exports.lowerFirst = upperFirst.lowerFirst;
|
|
2476
2327
|
exports.pascalCase = upperFirst.pascalCase;
|
|
@@ -2480,8 +2331,6 @@ exports.invariant = util_index.invariant;
|
|
|
2480
2331
|
exports.ary = ary;
|
|
2481
2332
|
exports.attempt = attempt;
|
|
2482
2333
|
exports.before = before;
|
|
2483
|
-
exports.bind = bind;
|
|
2484
|
-
exports.bindKey = bindKey;
|
|
2485
2334
|
exports.camelCase = camelCase;
|
|
2486
2335
|
exports.castArray = castArray;
|
|
2487
2336
|
exports.ceil = ceil;
|
|
@@ -2493,8 +2342,6 @@ exports.concat = concat;
|
|
|
2493
2342
|
exports.conforms = conforms;
|
|
2494
2343
|
exports.conformsTo = conformsTo;
|
|
2495
2344
|
exports.constant = constant;
|
|
2496
|
-
exports.curry = curry;
|
|
2497
|
-
exports.curryRight = curryRight;
|
|
2498
2345
|
exports.debounce = debounce;
|
|
2499
2346
|
exports.defaultTo = defaultTo;
|
|
2500
2347
|
exports.defaults = defaults;
|
|
@@ -2534,10 +2381,10 @@ exports.invertBy = invertBy;
|
|
|
2534
2381
|
exports.isArguments = isArguments;
|
|
2535
2382
|
exports.isArray = isArray;
|
|
2536
2383
|
exports.isArrayBuffer = isArrayBuffer;
|
|
2537
|
-
exports.isArrayLike = isArrayLike;
|
|
2538
2384
|
exports.isArrayLikeObject = isArrayLikeObject;
|
|
2539
2385
|
exports.isBoolean = isBoolean;
|
|
2540
2386
|
exports.isDate = isDate;
|
|
2387
|
+
exports.isEmpty = isEmpty;
|
|
2541
2388
|
exports.isEqualWith = isEqualWith;
|
|
2542
2389
|
exports.isError = isError;
|
|
2543
2390
|
exports.isFinite = isFinite;
|