es-toolkit 1.23.0-dev.743 → 1.23.0-dev.745

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.
Files changed (39) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.global.js +1 -1
  3. package/dist/browser.global.js.map +1 -1
  4. package/dist/compat/index.d.mts +73 -72
  5. package/dist/compat/index.d.ts +73 -72
  6. package/dist/compat/index.js +567 -554
  7. package/dist/compat/index.mjs +72 -71
  8. package/dist/compat/string/upperCase.mjs +1 -1
  9. package/dist/compat/util/times.d.mts +18 -0
  10. package/dist/compat/util/times.d.ts +18 -0
  11. package/dist/compat/util/times.mjs +15 -0
  12. package/dist/index.d.mts +32 -32
  13. package/dist/index.d.ts +32 -32
  14. package/dist/index.js +40 -40
  15. package/dist/index.mjs +32 -32
  16. package/dist/math/index.d.mts +2 -2
  17. package/dist/math/index.d.ts +2 -2
  18. package/dist/math/index.js +9 -9
  19. package/dist/math/index.mjs +2 -2
  20. package/dist/object/index.d.mts +7 -7
  21. package/dist/object/index.d.ts +7 -7
  22. package/dist/object/index.js +32 -32
  23. package/dist/object/index.mjs +7 -7
  24. package/dist/predicate/index.d.mts +10 -10
  25. package/dist/predicate/index.d.ts +10 -10
  26. package/dist/predicate/index.js +7 -7
  27. package/dist/predicate/index.mjs +10 -10
  28. package/dist/promise/index.d.mts +1 -1
  29. package/dist/promise/index.d.ts +1 -1
  30. package/dist/promise/index.mjs +1 -1
  31. package/dist/string/index.d.mts +12 -12
  32. package/dist/string/index.d.ts +12 -12
  33. package/dist/string/index.js +20 -20
  34. package/dist/string/index.mjs +12 -12
  35. package/package.json +5 -1
  36. package/dist/_chunk/{isWeakSet-CjpFwn.js → isWeakSet-Bd6nry.js} +45 -45
  37. package/dist/_chunk/{rangeRight-CtcxMd.js → sumBy-BkErWJ.js} +5 -5
  38. package/dist/_chunk/{isObjectLike-aywuSF.js → toMerged-BBJZIl.js} +86 -86
  39. package/dist/_chunk/{pad-BWiShN.js → upperFirst-BUECmK.js} +84 -84
@@ -6,12 +6,12 @@ const zipWith = require('../_chunk/zipWith-EOU_KZ.js');
6
6
  const promise_index = require('../_chunk/index-BGZDR9.js');
7
7
  const flowRight$1 = require('../_chunk/flowRight-Cf9ldK.js');
8
8
  const noop = require('../_chunk/noop-2IwLUk.js');
9
- const rangeRight = require('../_chunk/rangeRight-CtcxMd.js');
9
+ const sumBy = require('../_chunk/sumBy-BkErWJ.js');
10
10
  const randomInt = require('../_chunk/randomInt-CF7bZK.js');
11
- const isObjectLike = require('../_chunk/isObjectLike-aywuSF.js');
11
+ const toMerged = require('../_chunk/toMerged-BBJZIl.js');
12
12
  const isPlainObject$1 = require('../_chunk/isPlainObject-DgrsU7.js');
13
- const isWeakSet$1 = require('../_chunk/isWeakSet-CjpFwn.js');
14
- const pad$1 = require('../_chunk/pad-BWiShN.js');
13
+ const isWeakSet$1 = require('../_chunk/isWeakSet-Bd6nry.js');
14
+ const upperFirst = require('../_chunk/upperFirst-BUECmK.js');
15
15
 
16
16
  function castArray(value) {
17
17
  if (arguments.length === 0) {
@@ -272,7 +272,7 @@ function isSetMatch(target, source) {
272
272
  }
273
273
 
274
274
  function matches(source) {
275
- source = isObjectLike.cloneDeep(source);
275
+ source = toMerged.cloneDeep(source);
276
276
  return (target) => {
277
277
  return isMatch(target, source);
278
278
  };
@@ -280,25 +280,25 @@ function matches(source) {
280
280
 
281
281
  function cloneDeep(obj) {
282
282
  if (typeof obj !== 'object') {
283
- return isObjectLike.cloneDeep(obj);
283
+ return toMerged.cloneDeep(obj);
284
284
  }
285
285
  switch (Object.prototype.toString.call(obj)) {
286
286
  case isWeakSet$1.numberTag:
287
287
  case isWeakSet$1.stringTag:
288
288
  case isWeakSet$1.booleanTag: {
289
289
  const result = new obj.constructor(obj?.valueOf());
290
- isObjectLike.copyProperties(result, obj);
290
+ toMerged.copyProperties(result, obj);
291
291
  return result;
292
292
  }
293
293
  case isWeakSet$1.argumentsTag: {
294
294
  const result = {};
295
- isObjectLike.copyProperties(result, obj);
295
+ toMerged.copyProperties(result, obj);
296
296
  result.length = obj.length;
297
297
  result[Symbol.iterator] = obj[Symbol.iterator];
298
298
  return result;
299
299
  }
300
300
  default: {
301
- return isObjectLike.cloneDeep(obj);
301
+ return toMerged.cloneDeep(obj);
302
302
  }
303
303
  }
304
304
  }
@@ -456,6 +456,43 @@ function fill(array, value, start = 0, end = array.length) {
456
456
  return zipWith.fill(array, value, start, end);
457
457
  }
458
458
 
459
+ function isArray(value) {
460
+ return Array.isArray(value);
461
+ }
462
+
463
+ function filter(source, predicate) {
464
+ if (!predicate) {
465
+ predicate = identity;
466
+ }
467
+ const collection = isArray(source) ? source : Object.values(source);
468
+ switch (typeof predicate) {
469
+ case 'function': {
470
+ if (!Array.isArray(source)) {
471
+ const result = [];
472
+ const entries = Object.entries(source);
473
+ for (let i = 0; i < entries.length; i++) {
474
+ const entry = entries[i];
475
+ const key = entry[0];
476
+ const value = entry[1];
477
+ if (predicate(value, key, source)) {
478
+ result.push(value);
479
+ }
480
+ }
481
+ return result;
482
+ }
483
+ return collection.filter(predicate);
484
+ }
485
+ case 'object': {
486
+ return isArray(predicate)
487
+ ? collection.filter(matchesProperty(predicate[0], predicate[1]))
488
+ : collection.filter(matches(predicate));
489
+ }
490
+ case 'string': {
491
+ return collection.filter(property(predicate));
492
+ }
493
+ }
494
+ }
495
+
459
496
  function find(source, doesMatch) {
460
497
  let values = source;
461
498
  if (!Array.isArray(source)) {
@@ -787,10 +824,6 @@ function orderBy(collection, criteria, orders) {
787
824
  .map(item => item.original);
788
825
  }
789
826
 
790
- function sortBy(collection, criteria) {
791
- return orderBy(collection, criteria, ['asc']);
792
- }
793
-
794
827
  function size(target) {
795
828
  if (isWeakSet$1.isNil(target)) {
796
829
  return 0;
@@ -831,6 +864,10 @@ function some(arr, predicate, guard) {
831
864
  }
832
865
  }
833
866
 
867
+ function sortBy(collection, criteria) {
868
+ return orderBy(collection, criteria, ['asc']);
869
+ }
870
+
834
871
  function take(arr, count) {
835
872
  if (count < 1) {
836
873
  return [];
@@ -866,43 +903,6 @@ function zipObjectDeep(keys, values) {
866
903
  return result;
867
904
  }
868
905
 
869
- function isArray(value) {
870
- return Array.isArray(value);
871
- }
872
-
873
- function filter(source, predicate) {
874
- if (!predicate) {
875
- predicate = identity;
876
- }
877
- const collection = isArray(source) ? source : Object.values(source);
878
- switch (typeof predicate) {
879
- case 'function': {
880
- if (!Array.isArray(source)) {
881
- const result = [];
882
- const entries = Object.entries(source);
883
- for (let i = 0; i < entries.length; i++) {
884
- const entry = entries[i];
885
- const key = entry[0];
886
- const value = entry[1];
887
- if (predicate(value, key, source)) {
888
- result.push(value);
889
- }
890
- }
891
- return result;
892
- }
893
- return collection.filter(predicate);
894
- }
895
- case 'object': {
896
- return isArray(predicate)
897
- ? collection.filter(matchesProperty(predicate[0], predicate[1]))
898
- : collection.filter(matches(predicate));
899
- }
900
- case 'string': {
901
- return collection.filter(property(predicate));
902
- }
903
- }
904
- }
905
-
906
906
  function ary(func, n = func.length, guard) {
907
907
  if (guard) {
908
908
  n = func.length;
@@ -913,6 +913,32 @@ function ary(func, n = func.length, guard) {
913
913
  return flowRight$1.ary(func, n);
914
914
  }
915
915
 
916
+ function attempt(func, ...args) {
917
+ try {
918
+ return func(...args);
919
+ }
920
+ catch (e) {
921
+ return e instanceof Error ? e : new Error(e);
922
+ }
923
+ }
924
+
925
+ function before(n, func) {
926
+ if (typeof func !== 'function') {
927
+ throw new TypeError('Expected a function');
928
+ }
929
+ let result;
930
+ n = toInteger(n);
931
+ return function (...args) {
932
+ if (--n > 0) {
933
+ result = func.apply(this, args);
934
+ }
935
+ if (n <= 1 && func) {
936
+ func = undefined;
937
+ }
938
+ return result;
939
+ };
940
+ }
941
+
916
942
  function bind(func, thisObj, ...partialArgs) {
917
943
  const bound = function (...providedArgs) {
918
944
  const args = [];
@@ -939,23 +965,6 @@ function bind(func, thisObj, ...partialArgs) {
939
965
  const bindPlaceholder = Symbol('bind.placeholder');
940
966
  bind.placeholder = bindPlaceholder;
941
967
 
942
- function before(n, func) {
943
- if (typeof func !== 'function') {
944
- throw new TypeError('Expected a function');
945
- }
946
- let result;
947
- n = toInteger(n);
948
- return function (...args) {
949
- if (--n > 0) {
950
- result = func.apply(this, args);
951
- }
952
- if (n <= 1 && func) {
953
- func = undefined;
954
- }
955
- return result;
956
- };
957
- }
958
-
959
968
  function bindKey(object, key, ...partialArgs) {
960
969
  const bound = function (...providedArgs) {
961
970
  const args = [];
@@ -982,56 +991,6 @@ function bindKey(object, key, ...partialArgs) {
982
991
  const bindKeyPlaceholder = Symbol('bindKey.placeholder');
983
992
  bindKey.placeholder = bindKeyPlaceholder;
984
993
 
985
- function defer(func, ...args) {
986
- if (typeof func !== 'function') {
987
- throw new TypeError('Expected a function');
988
- }
989
- return setTimeout(func, 1, ...args);
990
- }
991
-
992
- function rest(func, start = func.length - 1) {
993
- start = Number.parseInt(start, 10);
994
- if (Number.isNaN(start) || start < 0) {
995
- start = func.length - 1;
996
- }
997
- return flowRight$1.rest(func, start);
998
- }
999
-
1000
- function spread(func, argsIndex = 0) {
1001
- argsIndex = Number.parseInt(argsIndex, 10);
1002
- if (Number.isNaN(argsIndex) || argsIndex < 0) {
1003
- argsIndex = 0;
1004
- }
1005
- return function (...args) {
1006
- const array = args[argsIndex];
1007
- const params = args.slice(0, argsIndex);
1008
- if (array) {
1009
- params.push(...array);
1010
- }
1011
- return func.apply(this, params);
1012
- };
1013
- }
1014
-
1015
- function attempt(func, ...args) {
1016
- try {
1017
- return func(...args);
1018
- }
1019
- catch (e) {
1020
- return e instanceof Error ? e : new Error(e);
1021
- }
1022
- }
1023
-
1024
- function rearg(func, ...indices) {
1025
- const flattenIndices = flatten(indices);
1026
- return function (...args) {
1027
- const reorderedArgs = flattenIndices.map(i => args[i]).slice(0, args.length);
1028
- for (let i = reorderedArgs.length; i < args.length; i++) {
1029
- reorderedArgs.push(args[i]);
1030
- }
1031
- return func.apply(this, reorderedArgs);
1032
- };
1033
- }
1034
-
1035
994
  function curry(func, arity = func.length, guard) {
1036
995
  arity = guard ? func.length : arity;
1037
996
  arity = Number.parseInt(arity, 10);
@@ -1196,12 +1155,11 @@ function debounce(func, debounceMs = 0, options = {}) {
1196
1155
  return debounced;
1197
1156
  }
1198
1157
 
1199
- function throttle(func, throttleMs = 0, options = {}) {
1200
- if (typeof options !== 'object') {
1201
- options = {};
1158
+ function defer(func, ...args) {
1159
+ if (typeof func !== 'function') {
1160
+ throw new TypeError('Expected a function');
1202
1161
  }
1203
- const { leading = true, trailing = true, signal } = options;
1204
- return debounce(func, throttleMs, { leading, trailing, signal, maxWait: throttleMs });
1162
+ return setTimeout(func, 1, ...args);
1205
1163
  }
1206
1164
 
1207
1165
  function flip(func) {
@@ -1226,130 +1184,262 @@ function flowRight(...funcs) {
1226
1184
  return flowRight$1.flowRight(...flattenFuncs);
1227
1185
  }
1228
1186
 
1229
- function isNil(x) {
1230
- return x == null;
1187
+ function rearg(func, ...indices) {
1188
+ const flattenIndices = flatten(indices);
1189
+ return function (...args) {
1190
+ const reorderedArgs = flattenIndices.map(i => args[i]).slice(0, args.length);
1191
+ for (let i = reorderedArgs.length; i < args.length; i++) {
1192
+ reorderedArgs.push(args[i]);
1193
+ }
1194
+ return func.apply(this, reorderedArgs);
1195
+ };
1231
1196
  }
1232
1197
 
1233
- function pick(obj, ...keysArr) {
1234
- if (isNil(obj)) {
1235
- return {};
1198
+ function rest(func, start = func.length - 1) {
1199
+ start = Number.parseInt(start, 10);
1200
+ if (Number.isNaN(start) || start < 0) {
1201
+ start = func.length - 1;
1236
1202
  }
1237
- const result = {};
1238
- for (let i = 0; i < keysArr.length; i++) {
1239
- let keys = keysArr[i];
1240
- switch (typeof keys) {
1241
- case 'object': {
1242
- if (!Array.isArray(keys)) {
1243
- keys = Array.from(keys);
1244
- }
1245
- break;
1246
- }
1247
- case 'string':
1248
- case 'symbol':
1249
- case 'number': {
1250
- keys = [keys];
1251
- break;
1252
- }
1253
- }
1254
- for (const key of keys) {
1255
- const value = get(obj, key);
1256
- if (typeof key === 'string' && Object.hasOwn(obj, key)) {
1257
- result[key] = value;
1258
- }
1259
- else {
1260
- set(result, key, value);
1261
- }
1262
- }
1203
+ return flowRight$1.rest(func, start);
1204
+ }
1205
+
1206
+ function spread(func, argsIndex = 0) {
1207
+ argsIndex = Number.parseInt(argsIndex, 10);
1208
+ if (Number.isNaN(argsIndex) || argsIndex < 0) {
1209
+ argsIndex = 0;
1263
1210
  }
1264
- return result;
1211
+ return function (...args) {
1212
+ const array = args[argsIndex];
1213
+ const params = args.slice(0, argsIndex);
1214
+ if (array) {
1215
+ params.push(...array);
1216
+ }
1217
+ return func.apply(this, params);
1218
+ };
1265
1219
  }
1266
1220
 
1267
- function unset(obj, path) {
1268
- if (obj == null) {
1269
- return true;
1221
+ function throttle(func, throttleMs = 0, options = {}) {
1222
+ if (typeof options !== 'object') {
1223
+ options = {};
1270
1224
  }
1271
- switch (typeof path) {
1272
- case 'symbol':
1273
- case 'number':
1274
- case 'object': {
1275
- if (Array.isArray(path)) {
1276
- return unsetWithPath(obj, path);
1277
- }
1278
- if (typeof path === 'number') {
1279
- path = toKey(path);
1280
- }
1281
- else if (typeof path === 'object') {
1282
- if (Object.is(path?.valueOf(), -0)) {
1283
- path = '-0';
1284
- }
1285
- else {
1286
- path = String(path);
1287
- }
1225
+ const { leading = true, trailing = true, signal } = options;
1226
+ return debounce(func, throttleMs, { leading, trailing, signal, maxWait: throttleMs });
1227
+ }
1228
+
1229
+ function decimalAdjust(type, number, precision = 0) {
1230
+ number = Number(number);
1231
+ if (Object.is(number, -0)) {
1232
+ number = '-0';
1233
+ }
1234
+ precision = Math.min(Number.parseInt(precision, 10), 292);
1235
+ if (precision) {
1236
+ const [magnitude, exponent = 0] = number.toString().split('e');
1237
+ let adjustedValue = Math[type](Number(`${magnitude}e${Number(exponent) + precision}`));
1238
+ if (Object.is(adjustedValue, -0)) {
1239
+ adjustedValue = '-0';
1240
+ }
1241
+ const [newMagnitude, newExponent = 0] = adjustedValue.toString().split('e');
1242
+ return Number(`${newMagnitude}e${Number(newExponent) - precision}`);
1243
+ }
1244
+ return Math[type](Number(number));
1245
+ }
1246
+
1247
+ function ceil(number, precision = 0) {
1248
+ return decimalAdjust('ceil', number, precision);
1249
+ }
1250
+
1251
+ function clamp(value, bound1, bound2) {
1252
+ if (Number.isNaN(bound1)) {
1253
+ bound1 = 0;
1254
+ }
1255
+ if (Number.isNaN(bound2)) {
1256
+ bound2 = 0;
1257
+ }
1258
+ return sumBy.clamp(value, bound1, bound2);
1259
+ }
1260
+
1261
+ function floor(number, precision = 0) {
1262
+ return decimalAdjust('floor', number, precision);
1263
+ }
1264
+
1265
+ function inRange(value, minimum, maximum) {
1266
+ if (!minimum) {
1267
+ minimum = 0;
1268
+ }
1269
+ if (maximum != null && !maximum) {
1270
+ maximum = 0;
1271
+ }
1272
+ if (minimum != null && typeof minimum !== 'number') {
1273
+ minimum = Number(minimum);
1274
+ }
1275
+ if (maximum == null && minimum === 0) {
1276
+ return false;
1277
+ }
1278
+ if (maximum != null && typeof maximum !== 'number') {
1279
+ maximum = Number(maximum);
1280
+ }
1281
+ if (maximum != null && minimum > maximum) {
1282
+ [minimum, maximum] = [maximum, minimum];
1283
+ }
1284
+ if (minimum === maximum) {
1285
+ return false;
1286
+ }
1287
+ return sumBy.inRange(value, minimum, maximum);
1288
+ }
1289
+
1290
+ function max(items = []) {
1291
+ let maxElement = items[0];
1292
+ let max = undefined;
1293
+ for (let i = 0; i < items.length; i++) {
1294
+ const element = items[i];
1295
+ if (max == null || element > max) {
1296
+ max = element;
1297
+ maxElement = element;
1298
+ }
1299
+ }
1300
+ return maxElement;
1301
+ }
1302
+
1303
+ function min(items = []) {
1304
+ let minElement = items[0];
1305
+ let min = undefined;
1306
+ for (let i = 0; i < items.length; i++) {
1307
+ const element = items[i];
1308
+ if (min == null || element < min) {
1309
+ min = element;
1310
+ minElement = element;
1311
+ }
1312
+ }
1313
+ return minElement;
1314
+ }
1315
+
1316
+ function parseInt(string, radix = 0, guard) {
1317
+ if (guard) {
1318
+ radix = 0;
1319
+ }
1320
+ return Number.parseInt(string, radix);
1321
+ }
1322
+
1323
+ function random(...args) {
1324
+ let minimum = 0;
1325
+ let maximum = 1;
1326
+ let floating = false;
1327
+ switch (args.length) {
1328
+ case 1: {
1329
+ if (typeof args[0] === 'boolean') {
1330
+ floating = args[0];
1288
1331
  }
1289
- if (obj?.[path] === undefined) {
1290
- return true;
1332
+ else {
1333
+ maximum = args[0];
1291
1334
  }
1292
- try {
1293
- delete obj[path];
1294
- return true;
1335
+ break;
1336
+ }
1337
+ case 2: {
1338
+ if (typeof args[1] === 'boolean') {
1339
+ maximum = args[0];
1340
+ floating = args[1];
1295
1341
  }
1296
- catch {
1297
- return false;
1342
+ else {
1343
+ minimum = args[0];
1344
+ maximum = args[1];
1298
1345
  }
1299
1346
  }
1300
- case 'string': {
1301
- if (obj?.[path] === undefined && isDeepKey(path)) {
1302
- return unsetWithPath(obj, toPath(path));
1303
- }
1304
- try {
1305
- delete obj[path];
1306
- return true;
1347
+ case 3: {
1348
+ if (typeof args[2] === 'object' && args[2] != null && args[2][args[1]] === args[0]) {
1349
+ minimum = 0;
1350
+ maximum = args[0];
1351
+ floating = false;
1307
1352
  }
1308
- catch {
1309
- return false;
1353
+ else {
1354
+ minimum = args[0];
1355
+ maximum = args[1];
1356
+ floating = args[2];
1310
1357
  }
1311
1358
  }
1312
1359
  }
1313
- }
1314
- function unsetWithPath(obj, path) {
1315
- const parent = get(obj, path.slice(0, -1), obj);
1316
- const lastKey = path[path.length - 1];
1317
- if (parent?.[lastKey] === undefined) {
1318
- return true;
1360
+ if (typeof minimum !== 'number') {
1361
+ minimum = Number(minimum);
1319
1362
  }
1320
- try {
1321
- delete parent[lastKey];
1322
- return true;
1363
+ if (typeof maximum !== 'number') {
1364
+ minimum = Number(maximum);
1323
1365
  }
1324
- catch {
1325
- return false;
1366
+ if (!minimum) {
1367
+ minimum = 0;
1368
+ }
1369
+ if (!maximum) {
1370
+ maximum = 0;
1371
+ }
1372
+ if (minimum > maximum) {
1373
+ [minimum, maximum] = [maximum, minimum];
1374
+ }
1375
+ minimum = clamp(minimum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
1376
+ maximum = clamp(maximum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
1377
+ if (minimum === maximum) {
1378
+ return minimum;
1379
+ }
1380
+ if (floating) {
1381
+ return randomInt.random(minimum, maximum + 1);
1382
+ }
1383
+ else {
1384
+ return randomInt.randomInt(minimum, maximum + 1);
1326
1385
  }
1327
1386
  }
1328
1387
 
1329
- function omit(obj, ...keysArr) {
1330
- if (obj == null) {
1388
+ function round(number, precision = 0) {
1389
+ return decimalAdjust('round', number, precision);
1390
+ }
1391
+
1392
+ function defaults(object, ...sources) {
1393
+ object = Object(object);
1394
+ const objectProto = Object.prototype;
1395
+ for (let i = 0; i < sources.length; i++) {
1396
+ const source = sources[i];
1397
+ const keys = Object.keys(source);
1398
+ for (let j = 0; j < keys.length; j++) {
1399
+ const key = keys[j];
1400
+ const value = object[key];
1401
+ if (value === undefined ||
1402
+ (!Object.hasOwn(object, key) && isWeakSet$1.eq(value, objectProto[key]))) {
1403
+ object[key] = source[key];
1404
+ }
1405
+ }
1406
+ }
1407
+ return object;
1408
+ }
1409
+
1410
+ function isArrayLike(value) {
1411
+ return value != null && typeof value !== 'function' && isWeakSet$1.isLength(value.length);
1412
+ }
1413
+
1414
+ function fromPairs(pairs) {
1415
+ if (!isArrayLike(pairs) && !(pairs instanceof Map)) {
1331
1416
  return {};
1332
1417
  }
1333
- const result = isObjectLike.cloneDeep(obj);
1334
- for (let i = 0; i < keysArr.length; i++) {
1335
- let keys = keysArr[i];
1336
- switch (typeof keys) {
1337
- case 'object': {
1338
- if (!Array.isArray(keys)) {
1339
- keys = Array.from(keys);
1340
- }
1341
- for (let j = 0; j < keys.length; j++) {
1342
- const key = keys[j];
1343
- unset(result, key);
1344
- }
1345
- break;
1346
- }
1347
- case 'string':
1348
- case 'symbol':
1349
- case 'number': {
1350
- unset(result, keys);
1351
- break;
1352
- }
1418
+ const result = {};
1419
+ for (const [key, value] of pairs) {
1420
+ result[key] = value;
1421
+ }
1422
+ return result;
1423
+ }
1424
+
1425
+ function invertBy(object, iteratee) {
1426
+ const result = {};
1427
+ if (isWeakSet$1.isNil(object)) {
1428
+ return result;
1429
+ }
1430
+ if (iteratee == null) {
1431
+ iteratee = identity;
1432
+ }
1433
+ const keys = Object.keys(object);
1434
+ for (let i = 0; i < keys.length; i++) {
1435
+ const key = keys[i];
1436
+ const value = object[key];
1437
+ const valueStr = iteratee(value);
1438
+ if (Array.isArray(result[valueStr])) {
1439
+ result[valueStr].push(key);
1440
+ }
1441
+ else {
1442
+ result[valueStr] = [key];
1353
1443
  }
1354
1444
  }
1355
1445
  return result;
@@ -1362,10 +1452,10 @@ function mapKeys(object, getNewKey) {
1362
1452
  case 'symbol':
1363
1453
  case 'number':
1364
1454
  case 'object': {
1365
- return isObjectLike.mapKeys(object, property(getNewKey));
1455
+ return toMerged.mapKeys(object, property(getNewKey));
1366
1456
  }
1367
1457
  case 'function': {
1368
- return isObjectLike.mapKeys(object, getNewKey);
1458
+ return toMerged.mapKeys(object, getNewKey);
1369
1459
  }
1370
1460
  }
1371
1461
  }
@@ -1377,10 +1467,10 @@ function mapValues(object, getNewValue) {
1377
1467
  case 'symbol':
1378
1468
  case 'number':
1379
1469
  case 'object': {
1380
- return isObjectLike.mapValues(object, property(getNewValue));
1470
+ return toMerged.mapValues(object, property(getNewValue));
1381
1471
  }
1382
1472
  case 'function': {
1383
- return isObjectLike.mapValues(object, getNewValue);
1473
+ return toMerged.mapValues(object, getNewValue);
1384
1474
  }
1385
1475
  }
1386
1476
  }
@@ -1432,7 +1522,7 @@ function mergeWithDeep(target, source, merge, stack) {
1432
1522
  return target;
1433
1523
  }
1434
1524
  if (stack.has(source)) {
1435
- return isObjectLike.clone(stack.get(source));
1525
+ return toMerged.clone(stack.get(source));
1436
1526
  }
1437
1527
  stack.set(source, target);
1438
1528
  if (Array.isArray(source)) {
@@ -1476,7 +1566,7 @@ function mergeWithDeep(target, source, merge, stack) {
1476
1566
  else if (Array.isArray(sourceValue)) {
1477
1567
  target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
1478
1568
  }
1479
- else if (isObjectLike.isObjectLike(targetValue) && isObjectLike.isObjectLike(sourceValue)) {
1569
+ else if (toMerged.isObjectLike(targetValue) && toMerged.isObjectLike(sourceValue)) {
1480
1570
  target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
1481
1571
  }
1482
1572
  else if (targetValue == null && isPlainObject(sourceValue)) {
@@ -1496,60 +1586,133 @@ function merge(object, ...sources) {
1496
1586
  return mergeWith(object, ...sources, noop.noop);
1497
1587
  }
1498
1588
 
1499
- function isArrayLike(value) {
1500
- return value != null && typeof value !== 'function' && isWeakSet$1.isLength(value.length);
1589
+ function unset(obj, path) {
1590
+ if (obj == null) {
1591
+ return true;
1592
+ }
1593
+ switch (typeof path) {
1594
+ case 'symbol':
1595
+ case 'number':
1596
+ case 'object': {
1597
+ if (Array.isArray(path)) {
1598
+ return unsetWithPath(obj, path);
1599
+ }
1600
+ if (typeof path === 'number') {
1601
+ path = toKey(path);
1602
+ }
1603
+ else if (typeof path === 'object') {
1604
+ if (Object.is(path?.valueOf(), -0)) {
1605
+ path = '-0';
1606
+ }
1607
+ else {
1608
+ path = String(path);
1609
+ }
1610
+ }
1611
+ if (obj?.[path] === undefined) {
1612
+ return true;
1613
+ }
1614
+ try {
1615
+ delete obj[path];
1616
+ return true;
1617
+ }
1618
+ catch {
1619
+ return false;
1620
+ }
1621
+ }
1622
+ case 'string': {
1623
+ if (obj?.[path] === undefined && isDeepKey(path)) {
1624
+ return unsetWithPath(obj, toPath(path));
1625
+ }
1626
+ try {
1627
+ delete obj[path];
1628
+ return true;
1629
+ }
1630
+ catch {
1631
+ return false;
1632
+ }
1633
+ }
1634
+ }
1501
1635
  }
1502
-
1503
- function fromPairs(pairs) {
1504
- if (!isArrayLike(pairs) && !(pairs instanceof Map)) {
1505
- return {};
1636
+ function unsetWithPath(obj, path) {
1637
+ const parent = get(obj, path.slice(0, -1), obj);
1638
+ const lastKey = path[path.length - 1];
1639
+ if (parent?.[lastKey] === undefined) {
1640
+ return true;
1506
1641
  }
1507
- const result = {};
1508
- for (const [key, value] of pairs) {
1509
- result[key] = value;
1642
+ try {
1643
+ delete parent[lastKey];
1644
+ return true;
1645
+ }
1646
+ catch {
1647
+ return false;
1510
1648
  }
1511
- return result;
1512
1649
  }
1513
1650
 
1514
- function invertBy(object, iteratee) {
1515
- const result = {};
1516
- if (isWeakSet$1.isNil(object)) {
1517
- return result;
1518
- }
1519
- if (iteratee == null) {
1520
- iteratee = identity;
1651
+ function omit(obj, ...keysArr) {
1652
+ if (obj == null) {
1653
+ return {};
1521
1654
  }
1522
- const keys = Object.keys(object);
1523
- for (let i = 0; i < keys.length; i++) {
1524
- const key = keys[i];
1525
- const value = object[key];
1526
- const valueStr = iteratee(value);
1527
- if (Array.isArray(result[valueStr])) {
1528
- result[valueStr].push(key);
1529
- }
1530
- else {
1531
- result[valueStr] = [key];
1655
+ const result = toMerged.cloneDeep(obj);
1656
+ for (let i = 0; i < keysArr.length; i++) {
1657
+ let keys = keysArr[i];
1658
+ switch (typeof keys) {
1659
+ case 'object': {
1660
+ if (!Array.isArray(keys)) {
1661
+ keys = Array.from(keys);
1662
+ }
1663
+ for (let j = 0; j < keys.length; j++) {
1664
+ const key = keys[j];
1665
+ unset(result, key);
1666
+ }
1667
+ break;
1668
+ }
1669
+ case 'string':
1670
+ case 'symbol':
1671
+ case 'number': {
1672
+ unset(result, keys);
1673
+ break;
1674
+ }
1532
1675
  }
1533
1676
  }
1534
1677
  return result;
1535
1678
  }
1536
1679
 
1537
- function defaults(object, ...sources) {
1538
- object = Object(object);
1539
- const objectProto = Object.prototype;
1540
- for (let i = 0; i < sources.length; i++) {
1541
- const source = sources[i];
1542
- const keys = Object.keys(source);
1543
- for (let j = 0; j < keys.length; j++) {
1544
- const key = keys[j];
1545
- const value = object[key];
1546
- if (value === undefined ||
1547
- (!Object.hasOwn(object, key) && isWeakSet$1.eq(value, objectProto[key]))) {
1548
- object[key] = source[key];
1680
+ function isNil(x) {
1681
+ return x == null;
1682
+ }
1683
+
1684
+ function pick(obj, ...keysArr) {
1685
+ if (isNil(obj)) {
1686
+ return {};
1687
+ }
1688
+ const result = {};
1689
+ for (let i = 0; i < keysArr.length; i++) {
1690
+ let keys = keysArr[i];
1691
+ switch (typeof keys) {
1692
+ case 'object': {
1693
+ if (!Array.isArray(keys)) {
1694
+ keys = Array.from(keys);
1695
+ }
1696
+ break;
1697
+ }
1698
+ case 'string':
1699
+ case 'symbol':
1700
+ case 'number': {
1701
+ keys = [keys];
1702
+ break;
1703
+ }
1704
+ }
1705
+ for (const key of keys) {
1706
+ const value = get(obj, key);
1707
+ if (typeof key === 'string' && Object.hasOwn(obj, key)) {
1708
+ result[key] = value;
1709
+ }
1710
+ else {
1711
+ set(result, key, value);
1549
1712
  }
1550
1713
  }
1551
1714
  }
1552
- return object;
1715
+ return result;
1553
1716
  }
1554
1717
 
1555
1718
  function toDefaulted(object, ...sources) {
@@ -1557,42 +1720,6 @@ function toDefaulted(object, ...sources) {
1557
1720
  return defaults(cloned, ...sources);
1558
1721
  }
1559
1722
 
1560
- function isArrayBuffer(value) {
1561
- return isWeakSet$1.isArrayBuffer(value);
1562
- }
1563
-
1564
- function isBoolean(value) {
1565
- return typeof value === 'boolean' || value instanceof Boolean;
1566
- }
1567
-
1568
- function isError(value) {
1569
- return isWeakSet$1.getTag(value) === '[object Error]';
1570
- }
1571
-
1572
- function isFinite(value) {
1573
- return Number.isFinite(value);
1574
- }
1575
-
1576
- function isMap(value) {
1577
- return isWeakSet$1.isMap(value);
1578
- }
1579
-
1580
- function isSet(value) {
1581
- return isWeakSet$1.isSet(value);
1582
- }
1583
-
1584
- function isRegExp(value) {
1585
- return isWeakSet$1.isRegExp(value);
1586
- }
1587
-
1588
- function isWeakMap(value) {
1589
- return isWeakSet$1.isWeakMap(value);
1590
- }
1591
-
1592
- function isWeakSet(value) {
1593
- return isWeakSet$1.isWeakSet(value);
1594
- }
1595
-
1596
1723
  function conformsTo(target, source) {
1597
1724
  if (source == null) {
1598
1725
  return true;
@@ -1613,48 +1740,84 @@ function conformsTo(target, source) {
1613
1740
  }
1614
1741
 
1615
1742
  function conforms(source) {
1616
- source = isObjectLike.cloneDeep(source);
1743
+ source = toMerged.cloneDeep(source);
1617
1744
  return function (object) {
1618
1745
  return conformsTo(object, source);
1619
1746
  };
1620
1747
  }
1621
1748
 
1749
+ function isArrayBuffer(value) {
1750
+ return isWeakSet$1.isArrayBuffer(value);
1751
+ }
1752
+
1753
+ function isArrayLikeObject(value) {
1754
+ return toMerged.isObjectLike(value) && isArrayLike(value);
1755
+ }
1756
+
1757
+ function isBoolean(value) {
1758
+ return typeof value === 'boolean' || value instanceof Boolean;
1759
+ }
1760
+
1761
+ function isEqualWith(a, b, areValuesEqual = noop.noop) {
1762
+ if (typeof areValuesEqual !== 'function') {
1763
+ areValuesEqual = noop.noop;
1764
+ }
1765
+ return isWeakSet$1.isEqualWith(a, b, (...args) => {
1766
+ const result = areValuesEqual(...args);
1767
+ if (result !== undefined) {
1768
+ return !!result;
1769
+ }
1770
+ if (a instanceof Map && b instanceof Map) {
1771
+ return isEqualWith(Array.from(a), Array.from(b), flowRight$1.after(2, areValuesEqual));
1772
+ }
1773
+ if (a instanceof Set && b instanceof Set) {
1774
+ return isEqualWith(Array.from(a), Array.from(b), flowRight$1.after(2, areValuesEqual));
1775
+ }
1776
+ });
1777
+ }
1778
+
1779
+ function isError(value) {
1780
+ return isWeakSet$1.getTag(value) === '[object Error]';
1781
+ }
1782
+
1783
+ function isFinite(value) {
1784
+ return Number.isFinite(value);
1785
+ }
1786
+
1622
1787
  function isInteger(value) {
1623
1788
  return Number.isInteger(value);
1624
1789
  }
1625
1790
 
1626
- function isSafeInteger(value) {
1627
- return Number.isSafeInteger(value);
1791
+ function isMap(value) {
1792
+ return isWeakSet$1.isMap(value);
1793
+ }
1794
+
1795
+ function isNaN(value) {
1796
+ return Number.isNaN(value);
1628
1797
  }
1629
1798
 
1630
1799
  function isNumber(value) {
1631
1800
  return typeof value === 'number' || value instanceof Number;
1632
1801
  }
1633
1802
 
1634
- function isNaN(value) {
1635
- return Number.isNaN(value);
1803
+ function isRegExp(value) {
1804
+ return isWeakSet$1.isRegExp(value);
1636
1805
  }
1637
1806
 
1638
- function isArrayLikeObject(value) {
1639
- return isObjectLike.isObjectLike(value) && isArrayLike(value);
1807
+ function isSafeInteger(value) {
1808
+ return Number.isSafeInteger(value);
1640
1809
  }
1641
1810
 
1642
- function isEqualWith(a, b, areValuesEqual = noop.noop) {
1643
- if (typeof areValuesEqual !== 'function') {
1644
- areValuesEqual = noop.noop;
1645
- }
1646
- return isWeakSet$1.isEqualWith(a, b, (...args) => {
1647
- const result = areValuesEqual(...args);
1648
- if (result !== undefined) {
1649
- return !!result;
1650
- }
1651
- if (a instanceof Map && b instanceof Map) {
1652
- return isEqualWith(Array.from(a), Array.from(b), flowRight$1.after(2, areValuesEqual));
1653
- }
1654
- if (a instanceof Set && b instanceof Set) {
1655
- return isEqualWith(Array.from(a), Array.from(b), flowRight$1.after(2, areValuesEqual));
1656
- }
1657
- });
1811
+ function isSet(value) {
1812
+ return isWeakSet$1.isSet(value);
1813
+ }
1814
+
1815
+ function isWeakMap(value) {
1816
+ return isWeakSet$1.isWeakMap(value);
1817
+ }
1818
+
1819
+ function isWeakSet(value) {
1820
+ return isWeakSet$1.isWeakSet(value);
1658
1821
  }
1659
1822
 
1660
1823
  function toString(value) {
@@ -1679,19 +1842,43 @@ function normalizeForCase(str) {
1679
1842
  }
1680
1843
 
1681
1844
  function camelCase(str) {
1682
- return pad$1.camelCase(normalizeForCase(str));
1845
+ return upperFirst.camelCase(normalizeForCase(str));
1846
+ }
1847
+
1848
+ function endsWith(str, target, position = str.length) {
1849
+ return str.endsWith(target, position);
1683
1850
  }
1684
1851
 
1685
1852
  function kebabCase(str) {
1686
- return pad$1.kebabCase(normalizeForCase(str));
1853
+ return upperFirst.kebabCase(normalizeForCase(str));
1854
+ }
1855
+
1856
+ function lowerCase(str) {
1857
+ return upperFirst.lowerCase(normalizeForCase(str));
1858
+ }
1859
+
1860
+ function pad(str, length, chars = ' ') {
1861
+ return upperFirst.pad(toString(str), length, chars);
1862
+ }
1863
+
1864
+ function padEnd(str, length = 0, chars = ' ') {
1865
+ return toString(str).padEnd(length, chars);
1866
+ }
1867
+
1868
+ function padStart(str, length = 0, chars = ' ') {
1869
+ return toString(str).padStart(length, chars);
1870
+ }
1871
+
1872
+ function repeat(str, n) {
1873
+ return str.repeat(n);
1687
1874
  }
1688
1875
 
1689
1876
  function snakeCase(str) {
1690
- return pad$1.snakeCase(normalizeForCase(str));
1877
+ return upperFirst.snakeCase(normalizeForCase(str));
1691
1878
  }
1692
1879
 
1693
1880
  function startCase(str) {
1694
- const words = pad$1.getWords(normalizeForCase(str).trim());
1881
+ const words = upperFirst.getWords(normalizeForCase(str).trim());
1695
1882
  let result = '';
1696
1883
  for (let i = 0; i < words.length; i++) {
1697
1884
  const word = words[i];
@@ -1708,36 +1895,12 @@ function startCase(str) {
1708
1895
  return result;
1709
1896
  }
1710
1897
 
1711
- function lowerCase(str) {
1712
- return pad$1.lowerCase(normalizeForCase(str));
1713
- }
1714
-
1715
- function upperCase(str) {
1716
- return pad$1.upperCase(normalizeForCase(str));
1717
- }
1718
-
1719
1898
  function startsWith(str, target, position = 0) {
1720
1899
  return str.startsWith(target, position);
1721
1900
  }
1722
1901
 
1723
- function endsWith(str, target, position = str.length) {
1724
- return str.endsWith(target, position);
1725
- }
1726
-
1727
- function pad(str, length, chars = ' ') {
1728
- return pad$1.pad(toString(str), length, chars);
1729
- }
1730
-
1731
- function padStart(str, length = 0, chars = ' ') {
1732
- return toString(str).padStart(length, chars);
1733
- }
1734
-
1735
- function padEnd(str, length = 0, chars = ' ') {
1736
- return toString(str).padEnd(length, chars);
1737
- }
1738
-
1739
- function repeat(str, n) {
1740
- return str.repeat(n);
1902
+ function upperCase(str) {
1903
+ return upperFirst.upperCase(normalizeForCase(str));
1741
1904
  }
1742
1905
 
1743
1906
  function trim(str, chars, guard) {
@@ -1749,228 +1912,77 @@ function trim(str, chars, guard) {
1749
1912
  }
1750
1913
  switch (typeof chars) {
1751
1914
  case 'string': {
1752
- return pad$1.trim(str, chars.toString().split(''));
1915
+ return upperFirst.trim(str, chars.toString().split(''));
1753
1916
  }
1754
1917
  case 'object': {
1755
1918
  if (Array.isArray(chars)) {
1756
- return pad$1.trim(str, chars.map(x => x.toString()));
1919
+ return upperFirst.trim(str, chars.map(x => x.toString()));
1757
1920
  }
1758
1921
  else {
1759
- return pad$1.trim(str, chars.toString().split(''));
1922
+ return upperFirst.trim(str, chars.toString().split(''));
1760
1923
  }
1761
1924
  }
1762
1925
  }
1763
1926
  }
1764
1927
 
1765
- function trimStart(str, chars, guard) {
1928
+ function trimEnd(str, chars, guard) {
1766
1929
  if (str == null) {
1767
1930
  return '';
1768
1931
  }
1769
1932
  if (guard != null || chars == null) {
1770
- return str.toString().trimStart();
1933
+ return str.toString().trimEnd();
1771
1934
  }
1772
1935
  switch (typeof chars) {
1773
1936
  case 'string': {
1774
- return pad$1.trimStart(str, chars.toString().split(''));
1937
+ return upperFirst.trimEnd(str, chars.toString().split(''));
1775
1938
  }
1776
1939
  case 'object': {
1777
1940
  if (Array.isArray(chars)) {
1778
- return pad$1.trimStart(str, chars.map(x => x.toString()));
1941
+ return upperFirst.trimEnd(str, chars.map(x => x.toString()));
1779
1942
  }
1780
1943
  else {
1781
- return pad$1.trimStart(str, chars.toString().split(''));
1944
+ return upperFirst.trimEnd(str, chars.toString().split(''));
1782
1945
  }
1783
1946
  }
1784
1947
  }
1785
1948
  }
1786
1949
 
1787
- function trimEnd(str, chars, guard) {
1950
+ function trimStart(str, chars, guard) {
1788
1951
  if (str == null) {
1789
1952
  return '';
1790
1953
  }
1791
1954
  if (guard != null || chars == null) {
1792
- return str.toString().trimEnd();
1955
+ return str.toString().trimStart();
1793
1956
  }
1794
1957
  switch (typeof chars) {
1795
1958
  case 'string': {
1796
- return pad$1.trimEnd(str, chars.toString().split(''));
1959
+ return upperFirst.trimStart(str, chars.toString().split(''));
1797
1960
  }
1798
1961
  case 'object': {
1799
1962
  if (Array.isArray(chars)) {
1800
- return pad$1.trimEnd(str, chars.map(x => x.toString()));
1963
+ return upperFirst.trimStart(str, chars.map(x => x.toString()));
1801
1964
  }
1802
1965
  else {
1803
- return pad$1.trimEnd(str, chars.toString().split(''));
1966
+ return upperFirst.trimStart(str, chars.toString().split(''));
1804
1967
  }
1805
1968
  }
1806
1969
  }
1807
1970
  }
1808
1971
 
1809
- function clamp(value, bound1, bound2) {
1810
- if (Number.isNaN(bound1)) {
1811
- bound1 = 0;
1812
- }
1813
- if (Number.isNaN(bound2)) {
1814
- bound2 = 0;
1815
- }
1816
- return rangeRight.clamp(value, bound1, bound2);
1817
- }
1818
-
1819
- function max(items = []) {
1820
- let maxElement = items[0];
1821
- let max = undefined;
1822
- for (let i = 0; i < items.length; i++) {
1823
- const element = items[i];
1824
- if (max == null || element > max) {
1825
- max = element;
1826
- maxElement = element;
1827
- }
1828
- }
1829
- return maxElement;
1830
- }
1831
-
1832
- function min(items = []) {
1833
- let minElement = items[0];
1834
- let min = undefined;
1835
- for (let i = 0; i < items.length; i++) {
1836
- const element = items[i];
1837
- if (min == null || element < min) {
1838
- min = element;
1839
- minElement = element;
1840
- }
1841
- }
1842
- return minElement;
1843
- }
1844
-
1845
- function decimalAdjust(type, number, precision = 0) {
1846
- number = Number(number);
1847
- if (Object.is(number, -0)) {
1848
- number = '-0';
1849
- }
1850
- precision = Math.min(Number.parseInt(precision, 10), 292);
1851
- if (precision) {
1852
- const [magnitude, exponent = 0] = number.toString().split('e');
1853
- let adjustedValue = Math[type](Number(`${magnitude}e${Number(exponent) + precision}`));
1854
- if (Object.is(adjustedValue, -0)) {
1855
- adjustedValue = '-0';
1856
- }
1857
- const [newMagnitude, newExponent = 0] = adjustedValue.toString().split('e');
1858
- return Number(`${newMagnitude}e${Number(newExponent) - precision}`);
1859
- }
1860
- return Math[type](Number(number));
1861
- }
1862
-
1863
- function ceil(number, precision = 0) {
1864
- return decimalAdjust('ceil', number, precision);
1865
- }
1866
-
1867
- function floor(number, precision = 0) {
1868
- return decimalAdjust('floor', number, precision);
1869
- }
1870
-
1871
- function round(number, precision = 0) {
1872
- return decimalAdjust('round', number, precision);
1873
- }
1874
-
1875
- function parseInt(string, radix = 0, guard) {
1876
- if (guard) {
1877
- radix = 0;
1878
- }
1879
- return Number.parseInt(string, radix);
1880
- }
1881
-
1882
- function inRange(value, minimum, maximum) {
1883
- if (!minimum) {
1884
- minimum = 0;
1885
- }
1886
- if (maximum != null && !maximum) {
1887
- maximum = 0;
1888
- }
1889
- if (minimum != null && typeof minimum !== 'number') {
1890
- minimum = Number(minimum);
1891
- }
1892
- if (maximum == null && minimum === 0) {
1893
- return false;
1894
- }
1895
- if (maximum != null && typeof maximum !== 'number') {
1896
- maximum = Number(maximum);
1897
- }
1898
- if (maximum != null && minimum > maximum) {
1899
- [minimum, maximum] = [maximum, minimum];
1900
- }
1901
- if (minimum === maximum) {
1902
- return false;
1903
- }
1904
- return rangeRight.inRange(value, minimum, maximum);
1972
+ function constant(value) {
1973
+ return () => value;
1905
1974
  }
1906
1975
 
1907
- function random(...args) {
1908
- let minimum = 0;
1909
- let maximum = 1;
1910
- let floating = false;
1911
- switch (args.length) {
1912
- case 1: {
1913
- if (typeof args[0] === 'boolean') {
1914
- floating = args[0];
1915
- }
1916
- else {
1917
- maximum = args[0];
1918
- }
1919
- break;
1920
- }
1921
- case 2: {
1922
- if (typeof args[1] === 'boolean') {
1923
- maximum = args[0];
1924
- floating = args[1];
1925
- }
1926
- else {
1927
- minimum = args[0];
1928
- maximum = args[1];
1929
- }
1930
- }
1931
- case 3: {
1932
- if (typeof args[2] === 'object' && args[2] != null && args[2][args[1]] === args[0]) {
1933
- minimum = 0;
1934
- maximum = args[0];
1935
- floating = false;
1936
- }
1937
- else {
1938
- minimum = args[0];
1939
- maximum = args[1];
1940
- floating = args[2];
1941
- }
1942
- }
1943
- }
1944
- if (typeof minimum !== 'number') {
1945
- minimum = Number(minimum);
1946
- }
1947
- if (typeof maximum !== 'number') {
1948
- minimum = Number(maximum);
1949
- }
1950
- if (!minimum) {
1951
- minimum = 0;
1952
- }
1953
- if (!maximum) {
1954
- maximum = 0;
1955
- }
1956
- if (minimum > maximum) {
1957
- [minimum, maximum] = [maximum, minimum];
1958
- }
1959
- minimum = clamp(minimum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
1960
- maximum = clamp(maximum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
1961
- if (minimum === maximum) {
1962
- return minimum;
1963
- }
1964
- if (floating) {
1965
- return randomInt.random(minimum, maximum + 1);
1976
+ function times(n, iteratee) {
1977
+ n = toInteger(n);
1978
+ if (n < 1 || !Number.isSafeInteger(n)) {
1979
+ return [];
1966
1980
  }
1967
- else {
1968
- return randomInt.randomInt(minimum, maximum + 1);
1981
+ const result = new Array(n);
1982
+ for (let i = 0; i < n; i++) {
1983
+ result[i] = typeof iteratee === 'function' ? iteratee(i) : i;
1969
1984
  }
1970
- }
1971
-
1972
- function constant(value) {
1973
- return () => value;
1985
+ return result;
1974
1986
  }
1975
1987
 
1976
1988
  exports.at = zipWith.at;
@@ -2033,20 +2045,20 @@ exports.partial = flowRight$1.partial;
2033
2045
  exports.partialRight = flowRight$1.partialRight;
2034
2046
  exports.unary = flowRight$1.unary;
2035
2047
  exports.noop = noop.noop;
2036
- exports.mean = rangeRight.mean;
2037
- exports.meanBy = rangeRight.meanBy;
2038
- exports.range = rangeRight.range;
2039
- exports.rangeRight = rangeRight.rangeRight;
2040
- exports.sum = rangeRight.sum;
2041
- exports.sumBy = rangeRight.sumBy;
2048
+ exports.mean = sumBy.mean;
2049
+ exports.meanBy = sumBy.meanBy;
2050
+ exports.range = sumBy.range;
2051
+ exports.rangeRight = sumBy.rangeRight;
2052
+ exports.sum = sumBy.sum;
2053
+ exports.sumBy = sumBy.sumBy;
2042
2054
  exports.randomInt = randomInt.randomInt;
2043
- exports.clone = isObjectLike.clone;
2044
- exports.flattenObject = isObjectLike.flattenObject;
2045
- exports.invert = isObjectLike.invert;
2046
- exports.isObjectLike = isObjectLike.isObjectLike;
2047
- exports.omitBy = isObjectLike.omitBy;
2048
- exports.pickBy = isObjectLike.pickBy;
2049
- exports.toMerged = isObjectLike.toMerged;
2055
+ exports.clone = toMerged.clone;
2056
+ exports.flattenObject = toMerged.flattenObject;
2057
+ exports.invert = toMerged.invert;
2058
+ exports.isObjectLike = toMerged.isObjectLike;
2059
+ exports.omitBy = toMerged.omitBy;
2060
+ exports.pickBy = toMerged.pickBy;
2061
+ exports.toMerged = toMerged.toMerged;
2050
2062
  exports.isPrimitive = isPlainObject$1.isPrimitive;
2051
2063
  exports.eq = isWeakSet$1.eq;
2052
2064
  exports.isBlob = isWeakSet$1.isBlob;
@@ -2060,15 +2072,15 @@ exports.isLength = isWeakSet$1.isLength;
2060
2072
  exports.isNotNil = isWeakSet$1.isNotNil;
2061
2073
  exports.isNull = isWeakSet$1.isNull;
2062
2074
  exports.isUndefined = isWeakSet$1.isUndefined;
2063
- exports.capitalize = pad$1.capitalize;
2064
- exports.constantCase = pad$1.constantCase;
2065
- exports.deburr = pad$1.deburr;
2066
- exports.escape = pad$1.escape;
2067
- exports.escapeRegExp = pad$1.escapeRegExp;
2068
- exports.lowerFirst = pad$1.lowerFirst;
2069
- exports.pascalCase = pad$1.pascalCase;
2070
- exports.unescape = pad$1.unescape;
2071
- exports.upperFirst = pad$1.upperFirst;
2075
+ exports.capitalize = upperFirst.capitalize;
2076
+ exports.constantCase = upperFirst.constantCase;
2077
+ exports.deburr = upperFirst.deburr;
2078
+ exports.escape = upperFirst.escape;
2079
+ exports.escapeRegExp = upperFirst.escapeRegExp;
2080
+ exports.lowerFirst = upperFirst.lowerFirst;
2081
+ exports.pascalCase = upperFirst.pascalCase;
2082
+ exports.unescape = upperFirst.unescape;
2083
+ exports.upperFirst = upperFirst.upperFirst;
2072
2084
  exports.ary = ary;
2073
2085
  exports.attempt = attempt;
2074
2086
  exports.before = before;
@@ -2172,6 +2184,7 @@ exports.startCase = startCase;
2172
2184
  exports.startsWith = startsWith;
2173
2185
  exports.take = take;
2174
2186
  exports.throttle = throttle;
2187
+ exports.times = times;
2175
2188
  exports.toDefaulted = toDefaulted;
2176
2189
  exports.toFinite = toFinite;
2177
2190
  exports.toInteger = toInteger;