@dereekb/util 13.7.0 → 13.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -354,43 +354,33 @@ function _unsupported_iterable_to_array$A(o, minLen) {
354
354
  * @returns An array containing the tuple(s)
355
355
  * @throws Error if input is not an array
356
356
  */ function wrapTuples(input) {
357
- if (Array.isArray(input)) {
358
- // check if the first item is an array. Tuples can contain arrays as the first value.
359
- if (input.length > 0) {
360
- var firstValueInPotentialTupleOrArray = input[0];
361
- var inputIsSingleTuple = false;
362
- if (Array.isArray(firstValueInPotentialTupleOrArray)) {
363
- // if the first nested value is an array then the top-level value may be an array and not a tuple. Check the length of all the other values in the array to see if they have the same length.
364
- var expectedLength = firstValueInPotentialTupleOrArray.length;
365
- // if it is an array of tuples, all values should be the same length and be arrays. If not an array, then we're looking at a tuple.
366
- var firstNonUniformTupleValueIndex = input.findIndex(function(x) {
367
- if (Array.isArray(x)) {
368
- return x.length !== expectedLength;
369
- } else {
370
- return true; // non-array value. The input is a tuple.
371
- }
372
- });
373
- inputIsSingleTuple = firstNonUniformTupleValueIndex !== -1;
374
- } else {
375
- inputIsSingleTuple = true;
376
- return [
377
- input
378
- ];
379
- }
380
- // first value of the tuple could also be an array. If it is, check the other tuples all have the same length.
381
- if (inputIsSingleTuple) {
382
- return [
383
- input
384
- ];
385
- } else {
386
- return input;
387
- }
357
+ if (!Array.isArray(input)) {
358
+ throw new Error('Input is not an array/tuple...');
359
+ }
360
+ var result;
361
+ // check if the first item is an array. Tuples can contain arrays as the first value.
362
+ if (input.length > 0) {
363
+ var firstValueInPotentialTupleOrArray = input[0];
364
+ var inputIsSingleTuple = false;
365
+ if (Array.isArray(firstValueInPotentialTupleOrArray)) {
366
+ // if the first nested value is an array then the top-level value may be an array and not a tuple. Check the length of all the other values in the array to see if they have the same length.
367
+ var expectedLength = firstValueInPotentialTupleOrArray.length;
368
+ // if it is an array of tuples, all values should be the same length and be arrays. If not an array, then we're looking at a tuple.
369
+ var firstNonUniformTupleValueIndex = input.findIndex(function(x) {
370
+ return Array.isArray(x) ? x.length !== expectedLength : true; // non-array value means the input is a tuple.
371
+ });
372
+ inputIsSingleTuple = firstNonUniformTupleValueIndex !== -1;
388
373
  } else {
389
- return input; // is an empty array.
374
+ inputIsSingleTuple = true;
390
375
  }
376
+ // first value of the tuple could also be an array. If it is, check the other tuples all have the same length.
377
+ result = inputIsSingleTuple ? [
378
+ input
379
+ ] : input;
391
380
  } else {
392
- throw new Error('Input is not an array/tuple...');
381
+ result = input; // is an empty array.
393
382
  }
383
+ return result;
394
384
  }
395
385
 
396
386
  function _array_like_to_array$z(arr, len) {
@@ -440,11 +430,7 @@ function _unsupported_iterable_to_array$z(o, minLen) {
440
430
  * @param arrayOrValue - single value, array, or nullish value to convert
441
431
  * @returns the input wrapped in an array, the input array itself, or an empty array if nullish
442
432
  */ function convertMaybeToArray(arrayOrValue) {
443
- if (arrayOrValue != null) {
444
- return convertToArray(arrayOrValue);
445
- } else {
446
- return [];
447
- }
433
+ return arrayOrValue != null ? convertToArray(arrayOrValue) : [];
448
434
  }
449
435
  /**
450
436
  * Alias for {@link convertMaybeToArray}. Converts a maybe value or array into an array, returning an empty array for nullish input.
@@ -476,11 +462,7 @@ function _unsupported_iterable_to_array$z(o, minLen) {
476
462
  * @param input - single value or array to retrieve from
477
463
  * @returns the last element of the array, or the input value itself
478
464
  */ function lastValue(input) {
479
- if (Array.isArray(input)) {
480
- return input[input.length - 1];
481
- } else {
482
- return input;
483
- }
465
+ return Array.isArray(input) ? input[input.length - 1] : input;
484
466
  }
485
467
  /**
486
468
  * Returns a tuple with the first and last value of the input.
@@ -504,11 +486,7 @@ function _unsupported_iterable_to_array$z(o, minLen) {
504
486
  * @param index - zero-based index of the element to retrieve
505
487
  * @returns the element at the specified index, or the input value itself if not an array
506
488
  */ function valueAtIndex(input, index) {
507
- if (Array.isArray(input)) {
508
- return input[index];
509
- } else {
510
- return input;
511
- }
489
+ return Array.isArray(input) ? input[index] : input;
512
490
  }
513
491
  /**
514
492
  * Concatenates the input arrays into a single array, filtering out nullish entries.
@@ -602,10 +580,9 @@ function _unsupported_iterable_to_array$z(o, minLen) {
602
580
  */ function pushItemOrArrayItemsIntoArray(target, value) {
603
581
  if (Array.isArray(value)) {
604
582
  return pushArrayItemsIntoArray(target, value);
605
- } else {
606
- target.push(value);
607
- return target;
608
583
  }
584
+ target.push(value);
585
+ return target;
609
586
  }
610
587
  /**
611
588
  * Merges all elements from the source array into the target array using push.
@@ -719,18 +696,19 @@ function _unsupported_iterable_to_array$z(o, minLen) {
719
696
  * ```
720
697
  */ function readKeysFunction(readKey) {
721
698
  return function(values) {
699
+ var result;
722
700
  if (Array.isArray(values)) {
723
- var keys = [];
701
+ result = [];
724
702
  values.forEach(function(x) {
725
703
  var key = readKey(x);
726
704
  if (key != null) {
727
- pushItemOrArrayItemsIntoArray(keys, key);
705
+ pushItemOrArrayItemsIntoArray(result, key);
728
706
  }
729
707
  });
730
- return keys;
731
708
  } else {
732
- return asArray(readKey(values));
709
+ result = asArray(readKey(values));
733
710
  }
711
+ return result;
734
712
  };
735
713
  }
736
714
  /**
@@ -755,24 +733,25 @@ function _unsupported_iterable_to_array$z(o, minLen) {
755
733
  * ```
756
734
  */ function readKeysSetFunction(readKey) {
757
735
  return function(values) {
736
+ var result;
758
737
  if (Array.isArray(values)) {
759
- var keys = new Set();
738
+ result = new Set();
760
739
  values.forEach(function(x) {
761
740
  var key = readKey(x);
762
741
  if (key != null) {
763
742
  if (Array.isArray(key)) {
764
743
  key.forEach(function(x) {
765
- return keys.add(x);
744
+ return result.add(x);
766
745
  });
767
746
  } else {
768
- keys.add(key);
747
+ result.add(key);
769
748
  }
770
749
  }
771
750
  });
772
- return keys;
773
751
  } else {
774
- return new Set(asArray(readKey(values)));
752
+ result = new Set(asArray(readKey(values)));
775
753
  }
754
+ return result;
776
755
  };
777
756
  }
778
757
  /**
@@ -1251,13 +1230,9 @@ function _unsupported_iterable_to_array$y(o, minLen) {
1251
1230
  */ function setContainsAnyValue(valuesSet, valuesToFind) {
1252
1231
  var emptyValuesToFindArrayResult = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
1253
1232
  var valuesToFindArray = iterableToArray(valuesToFind);
1254
- if (valuesToFindArray.length > 0) {
1255
- return valuesToFindArray.some(function(x) {
1256
- return valuesSet.has(x);
1257
- });
1258
- } else {
1259
- return emptyValuesToFindArrayResult;
1260
- }
1233
+ return valuesToFindArray.length > 0 ? valuesToFindArray.some(function(x) {
1234
+ return valuesSet.has(x);
1235
+ }) : emptyValuesToFindArrayResult;
1261
1236
  }
1262
1237
  /**
1263
1238
  * Returns true if values contains all values in valuesToFind.
@@ -1284,13 +1259,9 @@ function _unsupported_iterable_to_array$y(o, minLen) {
1284
1259
  */ function setContainsAllValues(valuesSet, valuesToFind) {
1285
1260
  var emptyValuesToFindArrayResult = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
1286
1261
  var valuesToFindArray = iterableToArray(valuesToFind);
1287
- if (valuesToFindArray.length > 0) {
1288
- return !valuesToFindArray.some(function(x) {
1289
- return !valuesSet.has(x);
1290
- });
1291
- } else {
1292
- return emptyValuesToFindArrayResult;
1293
- }
1262
+ return valuesToFindArray.length > 0 ? !valuesToFindArray.some(function(x) {
1263
+ return !valuesSet.has(x);
1264
+ }) : emptyValuesToFindArrayResult;
1294
1265
  }
1295
1266
  /**
1296
1267
  * Returns true if both iterables are defined (or are both null/undefined) and have the same values exactly.
@@ -1344,20 +1315,16 @@ function _unsupported_iterable_to_array$x(o, minLen) {
1344
1315
  * @returns The inverted function, or the original if invert is false
1345
1316
  */ function invertBooleanReturnFunction(decisionFn) {
1346
1317
  var invert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
1347
- if (invert) {
1348
- return function() {
1349
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
1350
- args[_key] = arguments[_key];
1351
- }
1352
- var _decisionFn;
1353
- var result = (_decisionFn = decisionFn).call.apply(_decisionFn, [
1354
- undefined
1355
- ].concat(_to_consumable_array$k(args)));
1356
- return !result;
1357
- };
1358
- } else {
1359
- return decisionFn;
1360
- }
1318
+ return invert ? function() {
1319
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
1320
+ args[_key] = arguments[_key];
1321
+ }
1322
+ var _decisionFn;
1323
+ var result = (_decisionFn = decisionFn).call.apply(_decisionFn, [
1324
+ undefined
1325
+ ].concat(_to_consumable_array$k(args)));
1326
+ return !result;
1327
+ } : decisionFn;
1361
1328
  }
1362
1329
 
1363
1330
  /**
@@ -1488,11 +1455,7 @@ function _type_of$l(obj) {
1488
1455
  * @param value - the value to check
1489
1456
  * @returns `true` if the value is non-nullish and not empty
1490
1457
  */ function hasValueOrNotEmpty(value) {
1491
- if (isIterable(value, false)) {
1492
- return !isEmptyIterable(value);
1493
- } else {
1494
- return isNotNullOrEmptyString(value);
1495
- }
1458
+ return isIterable(value, false) ? !isEmptyIterable(value) : isNotNullOrEmptyString(value);
1496
1459
  }
1497
1460
  /**
1498
1461
  * Type guard that checks whether the input has a meaningful value, including checking for empty objects.
@@ -1505,13 +1468,15 @@ function _type_of$l(obj) {
1505
1468
  * @param value - the value to check
1506
1469
  * @returns `true` if the value is non-nullish, non-empty, and not an empty object
1507
1470
  */ function hasValueOrNotEmptyObject(value) {
1471
+ var result;
1508
1472
  if (isIterable(value, true)) {
1509
- return !isEmptyIterable(value);
1473
+ result = !isEmptyIterable(value);
1510
1474
  } else if (isNotNullOrEmptyString(value)) {
1511
- return (typeof value === "undefined" ? "undefined" : _type_of$l(value)) === 'object' ? !objectHasNoKeys(value) : true;
1475
+ result = (typeof value === "undefined" ? "undefined" : _type_of$l(value)) === 'object' ? !objectHasNoKeys(value) : true;
1512
1476
  } else {
1513
- return false;
1477
+ result = false;
1514
1478
  }
1479
+ return result;
1515
1480
  }
1516
1481
  /**
1517
1482
  * Returns `true` if the input value is a non-empty string or is `true`.
@@ -1825,13 +1790,9 @@ function _type_of$l(obj) {
1825
1790
  }
1826
1791
  function chainMapFunction(a, b) {
1827
1792
  var apply = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
1828
- if (apply && b != null) {
1829
- return function(x) {
1830
- return b(a(x));
1831
- };
1832
- } else {
1833
- return a;
1834
- }
1793
+ return apply && b != null ? function(x) {
1794
+ return b(a(x));
1795
+ } : a;
1835
1796
  }
1836
1797
 
1837
1798
  function _array_like_to_array$w(arr, len) {
@@ -2786,24 +2747,23 @@ function reverseCompareFn(compareFn) {
2786
2747
  var _firstValueFromIterable;
2787
2748
  var min = (_firstValueFromIterable = firstValueFromIterable(values)) !== null && _firstValueFromIterable !== void 0 ? _firstValueFromIterable : undefined;
2788
2749
  var max = min;
2789
- if (min != null && max != null) {
2790
- forEachInIterable(values, function(x) {
2791
- var compareMin = compareFn(x, min);
2792
- var compareMax = compareFn(x, max);
2793
- if (compareMin < 0) {
2794
- min = x;
2795
- }
2796
- if (compareMax > 0) {
2797
- max = x;
2798
- }
2799
- });
2800
- return {
2801
- min: min,
2802
- max: max
2803
- };
2804
- } else {
2750
+ if (min == null || max == null) {
2805
2751
  return null;
2806
2752
  }
2753
+ forEachInIterable(values, function(x) {
2754
+ var compareMin = compareFn(x, min);
2755
+ var compareMax = compareFn(x, max);
2756
+ if (compareMin < 0) {
2757
+ min = x;
2758
+ }
2759
+ if (compareMax > 0) {
2760
+ max = x;
2761
+ }
2762
+ });
2763
+ return {
2764
+ min: min,
2765
+ max: max
2766
+ };
2807
2767
  };
2808
2768
  }
2809
2769
 
@@ -3427,11 +3387,7 @@ function _unsupported_iterable_to_array$r(o, minLen) {
3427
3387
  */ function bitwiseSetDencoder(maxIndex) {
3428
3388
  var decoder = maxIndex ? bitwiseSetDecoder(maxIndex) : dencodeBitwiseSet;
3429
3389
  return function(input) {
3430
- if (typeof input === 'number') {
3431
- return decoder(input);
3432
- } else {
3433
- return encodeBitwiseSet(input);
3434
- }
3390
+ return typeof input === 'number' ? decoder(input) : encodeBitwiseSet(input);
3435
3391
  };
3436
3392
  }
3437
3393
  /**
@@ -3471,11 +3427,7 @@ function _unsupported_iterable_to_array$r(o, minLen) {
3471
3427
  var encoder = bitwiseObjectEncoder(config.toSetFunction);
3472
3428
  var decoder = bitwiseObjectdecoder(config.fromSetFunction, config.maxIndex);
3473
3429
  return function(input) {
3474
- if (typeof input === 'number') {
3475
- return decoder(input);
3476
- } else {
3477
- return encoder(input);
3478
- }
3430
+ return typeof input === 'number' ? decoder(input) : encoder(input);
3479
3431
  };
3480
3432
  }
3481
3433
 
@@ -3533,11 +3485,7 @@ function _type_of$j(obj) {
3533
3485
  return isNonClassFunction(value);
3534
3486
  }
3535
3487
  function getValueFromGetter(input, args) {
3536
- if (isNonClassFunction(input)) {
3537
- return input(args);
3538
- } else {
3539
- return input;
3540
- }
3488
+ return isNonClassFunction(input) ? input(args) : input;
3541
3489
  }
3542
3490
  /**
3543
3491
  * Wraps the input as a Getter function. If it's already a function, returns it directly.
@@ -3545,13 +3493,9 @@ function getValueFromGetter(input, args) {
3545
3493
  * @param input - A value or getter function
3546
3494
  * @returns A Getter function that returns the value
3547
3495
  */ function asGetter(input) {
3548
- if (isNonClassFunction(input)) {
3496
+ return isNonClassFunction(input) ? input : function() {
3549
3497
  return input;
3550
- } else {
3551
- return function() {
3552
- return input;
3553
- };
3554
- }
3498
+ };
3555
3499
  }
3556
3500
  /**
3557
3501
  * Creates a factory that returns a shallow copy of the input value on each call.
@@ -3573,11 +3517,7 @@ function getValueFromGetter(input, args) {
3573
3517
  * @param copyFunction - Optional custom copy function
3574
3518
  * @returns An ObjectCopyFactory for the input
3575
3519
  */ function asObjectCopyFactory(input, copyFunction) {
3576
- if ((typeof input === "undefined" ? "undefined" : _type_of$j(input)) === 'object') {
3577
- return objectCopyFactory(input, copyFunction);
3578
- } else {
3579
- return asGetter(input);
3580
- }
3520
+ return (typeof input === "undefined" ? "undefined" : _type_of$j(input)) === 'object' ? objectCopyFactory(input, copyFunction) : asGetter(input);
3581
3521
  }
3582
3522
  /**
3583
3523
  * Wraps the input value in a Getter function that always returns it.
@@ -3680,13 +3620,15 @@ function makeWithFactoryInput(factory, input) {
3680
3620
  var distance = max - min;
3681
3621
  var isInBound = isInNumberBoundFunction(wrapNumberFunctionConfig);
3682
3622
  var fn = function fn(input) {
3623
+ var result;
3683
3624
  if (isInBound(input)) {
3684
- return input;
3625
+ result = input;
3685
3626
  } else {
3686
3627
  // when fencePosts is true, we're wrapping to the nearest fence post, meaning wraps are one value longer increased on that side.
3687
3628
  var fencePostOffset = fencePosts ? input < min ? 1 : -1 : 0;
3688
- return ((input - min) % distance + distance) % distance + min + fencePostOffset;
3629
+ result = ((input - min) % distance + distance) % distance + min + fencePostOffset;
3689
3630
  }
3631
+ return result;
3690
3632
  };
3691
3633
  fn._wrap = wrapNumberFunctionConfig;
3692
3634
  return fn;
@@ -3700,13 +3642,9 @@ function makeWithFactoryInput(factory, input) {
3700
3642
  * @returns A function that bounds input numbers into the configured range
3701
3643
  */ function boundNumberFunction(boundNumberFunctionConfig) {
3702
3644
  var min = boundNumberFunctionConfig.min, max = boundNumberFunctionConfig.max, wrap = boundNumberFunctionConfig.wrap;
3703
- if (wrap) {
3704
- return wrapNumberFunction(boundNumberFunctionConfig);
3705
- } else {
3706
- return function(input) {
3707
- return boundNumber(input, min, max);
3708
- };
3709
- }
3645
+ return wrap ? wrapNumberFunction(boundNumberFunctionConfig) : function(input) {
3646
+ return boundNumber(input, min, max);
3647
+ };
3710
3648
  }
3711
3649
  /**
3712
3650
  * Clamps the input number between the min and max values (inclusive).
@@ -3933,16 +3871,18 @@ function _type_of$h(obj) {
3933
3871
  * @returns A function that rounds numbers to the configured precision
3934
3872
  */ function roundToPrecisionFunction(precision) {
3935
3873
  var roundFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'round';
3874
+ var result;
3936
3875
  if (roundFn === 'cut') {
3937
- return function(value) {
3876
+ result = function result(value) {
3938
3877
  return cutToPrecision(value, precision);
3939
3878
  };
3940
3879
  } else {
3941
3880
  var rndFn = roundingFunction(roundFn);
3942
- return function(value) {
3881
+ result = function result(value) {
3943
3882
  return +(rndFn(Number(value + 'e+' + precision)) + 'e-' + precision);
3944
3883
  };
3945
3884
  }
3885
+ return result;
3946
3886
  }
3947
3887
  /**
3948
3888
  * Rounds a number to the specified decimal precision using `Math.round`.
@@ -4030,11 +3970,7 @@ var DOLLAR_AMOUNT_STRING_REGEX = /^\$?([0-9]+)\.?([0-9][0-9])$/;
4030
3970
  * @param number - The dollar amount to format
4031
3971
  * @returns Formatted string with two decimal places (e.g., "12.50")
4032
3972
  */ function dollarAmountString(number) {
4033
- if (number) {
4034
- return cutToPrecision(number, DOLLAR_AMOUNT_PRECISION).toFixed(DOLLAR_AMOUNT_PRECISION);
4035
- } else {
4036
- return '0.00';
4037
- }
3973
+ return number ? cutToPrecision(number, DOLLAR_AMOUNT_PRECISION).toFixed(DOLLAR_AMOUNT_PRECISION) : '0.00';
4038
3974
  }
4039
3975
  /**
4040
3976
  * Creates a function that formats dollar amounts as strings with a unit prefix (e.g., "$12.50").
@@ -4291,11 +4227,7 @@ var DOLLAR_AMOUNT_STRING_REGEX = /^\$?([0-9]+)\.?([0-9][0-9])$/;
4291
4227
  * @param emptyArrayValue - value to return when the array is empty
4292
4228
  * @returns the reduced result, or the empty array value if the array is empty
4293
4229
  */ function reduceNumbers(reduceFn, array, emptyArrayValue) {
4294
- if (array.length === 0) {
4295
- return emptyArrayValue;
4296
- } else {
4297
- return reduceNumbersFn(reduceFn, emptyArrayValue)(array);
4298
- }
4230
+ return array.length === 0 ? emptyArrayValue : reduceNumbersFn(reduceFn, emptyArrayValue)(array);
4299
4231
  }
4300
4232
  function reduceNumbersFn(reduceFn, emptyArrayValue) {
4301
4233
  var rFn = function rFn(array) {
@@ -4462,11 +4394,7 @@ function reduceNumbersFn(reduceFn, emptyArrayValue) {
4462
4394
  return function(values) {
4463
4395
  var minMax = findMinMax(values);
4464
4396
  var max = minMax === null || minMax === void 0 ? void 0 : minMax.max;
4465
- if (max != null) {
4466
- return readNextIndex(max);
4467
- } else {
4468
- return 0;
4469
- }
4397
+ return max != null ? readNextIndex(max) : 0;
4470
4398
  };
4471
4399
  }
4472
4400
  /**
@@ -4482,11 +4410,7 @@ function reduceNumbersFn(reduceFn, emptyArrayValue) {
4482
4410
  }; //return the max index + 1 by default.
4483
4411
  return function(sortedValues) {
4484
4412
  var lastValueInSorted = lastValue(sortedValues);
4485
- if (lastValueInSorted != null) {
4486
- return readNextIndex(lastValueInSorted);
4487
- } else {
4488
- return 0;
4489
- }
4413
+ return lastValueInSorted != null ? readNextIndex(lastValueInSorted) : 0;
4490
4414
  };
4491
4415
  }
4492
4416
  /**
@@ -4505,15 +4429,10 @@ function reduceNumbersFn(reduceFn, emptyArrayValue) {
4505
4429
  var minAndMaxItems = minAndMaxIndexItemsFunction(readIndex);
4506
4430
  var fn = function fn(values) {
4507
4431
  var result = minAndMaxItems(values);
4508
- if (result != null) {
4509
- var min = result.min, max = result.max;
4510
- return {
4511
- min: readIndex(min),
4512
- max: readIndex(max)
4513
- };
4514
- } else {
4515
- return null;
4516
- }
4432
+ return result != null ? {
4433
+ min: readIndex(result.min),
4434
+ max: readIndex(result.max)
4435
+ } : null;
4517
4436
  };
4518
4437
  fn._readIndex = readIndex;
4519
4438
  return fn;
@@ -4644,11 +4563,7 @@ function reduceNumbersFn(reduceFn, emptyArrayValue) {
4644
4563
  var ra = readIndexRange(a);
4645
4564
  var rb = readIndexRange(b);
4646
4565
  var comp = ra.minIndex - rb.minIndex; // sort by smaller minIndexes first
4647
- if (comp === 0) {
4648
- return ra.maxIndex - rb.maxIndex; // sort by larger maxIndexes first
4649
- } else {
4650
- return comp;
4651
- }
4566
+ return comp === 0 ? ra.maxIndex - rb.maxIndex : comp; // sort by larger maxIndexes first when equal
4652
4567
  };
4653
4568
  }
4654
4569
  /**
@@ -4672,14 +4587,10 @@ function reduceNumbersFn(reduceFn, emptyArrayValue) {
4672
4587
  * @param input - a single index number or an IndexRange
4673
4588
  * @returns the normalized IndexRange
4674
4589
  */ function indexRange(input) {
4675
- if (typeof input === 'number') {
4676
- return {
4677
- minIndex: input,
4678
- maxIndex: input + 1
4679
- };
4680
- } else {
4681
- return input;
4682
- }
4590
+ return typeof input === 'number' ? {
4591
+ minIndex: input,
4592
+ maxIndex: input + 1
4593
+ } : input;
4683
4594
  }
4684
4595
  /**
4685
4596
  * Creates a {@link FitToIndexRangeFunction} that clamps index numbers to the given range boundaries.
@@ -4730,16 +4641,15 @@ function indexRangeCheckReaderFunction(input) {
4730
4641
  }
4731
4642
  function indexRangeCheckFunctionConfigToIndexRange(param) {
4732
4643
  var indexRange = param.indexRange, inclusiveMaxIndex = param.inclusiveMaxIndex;
4733
- if (inclusiveMaxIndex) {
4734
- var minIndex = indexRange.minIndex, maxIndexInput = indexRange.maxIndex;
4735
- var maxIndex = maxIndexInput + 1;
4736
- return {
4737
- minIndex: minIndex,
4738
- maxIndex: maxIndex
4739
- };
4740
- } else {
4644
+ if (!inclusiveMaxIndex) {
4741
4645
  return indexRange;
4742
4646
  }
4647
+ var minIndex = indexRange.minIndex, maxIndexInput = indexRange.maxIndex;
4648
+ var maxIndex = maxIndexInput + 1;
4649
+ return {
4650
+ minIndex: minIndex,
4651
+ maxIndex: maxIndex
4652
+ };
4743
4653
  }
4744
4654
  /**
4745
4655
  * Normalizes an {@link IndexRangeFunctionInput} to a full {@link IndexRangeFunctionConfig},
@@ -5274,65 +5184,59 @@ function getArrayNextIndex(array, index) {
5274
5184
  return function() {
5275
5185
  return {};
5276
5186
  }; // no pairs to match on
5277
- } else {
5278
- // pairs sorted in ascending order
5279
- var pairs = values.map(pairFactory).sort(sortByIndexRangeAscendingCompareFunction(function(x) {
5280
- return x.range;
5281
- }));
5282
- return function(index) {
5283
- // find the first item that fits the
5284
- var matchIndex = -1;
5285
- var i;
5286
- for(i = 0; i < pairs.length; i += 1){
5287
- var comparison = pairs[i];
5288
- if (comparison.range.minIndex <= index) {
5289
- if (comparison.range.maxIndex > index) {
5290
- matchIndex = i;
5291
- break;
5292
- }
5293
- // continue otherwise.
5294
- } else {
5295
- break; // outside the min index, is not within these values at all
5187
+ }
5188
+ // pairs sorted in ascending order
5189
+ var pairs = values.map(pairFactory).sort(sortByIndexRangeAscendingCompareFunction(function(x) {
5190
+ return x.range;
5191
+ }));
5192
+ return function(index) {
5193
+ // find the first item that fits the
5194
+ var matchIndex = -1;
5195
+ var i;
5196
+ for(i = 0; i < pairs.length; i += 1){
5197
+ var comparison = pairs[i];
5198
+ if (comparison.range.minIndex <= index) {
5199
+ if (comparison.range.maxIndex > index) {
5200
+ matchIndex = i;
5201
+ break;
5296
5202
  }
5297
- }
5298
- var match;
5299
- var prev;
5300
- var next;
5301
- if (matchIndex === -1) {
5302
- var _pairs_, _pairs_i;
5303
- // no match
5304
- match = undefined;
5305
- // use i otherwise
5306
- prev = (_pairs_ = pairs[i - 1]) === null || _pairs_ === void 0 ? void 0 : _pairs_.value;
5307
- next = (_pairs_i = pairs[i]) === null || _pairs_i === void 0 ? void 0 : _pairs_i.value;
5203
+ // continue otherwise.
5308
5204
  } else {
5309
- var _pairs_matchIndex, _pairs_1, _pairs_2;
5310
- match = (_pairs_matchIndex = pairs[matchIndex]) === null || _pairs_matchIndex === void 0 ? void 0 : _pairs_matchIndex.value;
5311
- prev = (_pairs_1 = pairs[matchIndex - 1]) === null || _pairs_1 === void 0 ? void 0 : _pairs_1.value;
5312
- next = (_pairs_2 = pairs[matchIndex + 1]) === null || _pairs_2 === void 0 ? void 0 : _pairs_2.value;
5205
+ break; // outside the min index, is not within these values at all
5313
5206
  }
5314
- var info = {
5315
- prev: prev,
5316
- match: match,
5317
- next: next
5318
- };
5319
- return info;
5207
+ }
5208
+ var match;
5209
+ var prev;
5210
+ var next;
5211
+ if (matchIndex === -1) {
5212
+ var _pairs_, _pairs_i;
5213
+ // no match
5214
+ match = undefined;
5215
+ // use i otherwise
5216
+ prev = (_pairs_ = pairs[i - 1]) === null || _pairs_ === void 0 ? void 0 : _pairs_.value;
5217
+ next = (_pairs_i = pairs[i]) === null || _pairs_i === void 0 ? void 0 : _pairs_i.value;
5218
+ } else {
5219
+ var _pairs_matchIndex, _pairs_1, _pairs_2;
5220
+ match = (_pairs_matchIndex = pairs[matchIndex]) === null || _pairs_matchIndex === void 0 ? void 0 : _pairs_matchIndex.value;
5221
+ prev = (_pairs_1 = pairs[matchIndex - 1]) === null || _pairs_1 === void 0 ? void 0 : _pairs_1.value;
5222
+ next = (_pairs_2 = pairs[matchIndex + 1]) === null || _pairs_2 === void 0 ? void 0 : _pairs_2.value;
5223
+ }
5224
+ var info = {
5225
+ prev: prev,
5226
+ match: match,
5227
+ next: next
5320
5228
  };
5321
- }
5229
+ return info;
5230
+ };
5322
5231
  };
5323
5232
  }
5324
5233
 
5325
5234
  function limitArray(array, inputConfig) {
5326
5235
  if (array && (inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.limit) != null) {
5327
5236
  var limit = inputConfig.limit, limitFromEnd = inputConfig.limitFromEnd;
5328
- if (limitFromEnd) {
5329
- return takeLast(array, limit);
5330
- } else {
5331
- return takeFront(array, limit);
5332
- }
5333
- } else {
5334
- return array;
5237
+ return limitFromEnd ? takeLast(array, limit) : takeFront(array, limit);
5335
5238
  }
5239
+ return array;
5336
5240
  }
5337
5241
 
5338
5242
  /**
@@ -5417,12 +5321,7 @@ function generateIfDoesNotExist(keys, existing, readKey, generateFn) {
5417
5321
  * @param values - array to generate a random index for
5418
5322
  * @returns a random valid index within the array, or 0 if the array is empty
5419
5323
  */ function randomArrayIndex(values) {
5420
- if (values.length === 0) {
5421
- return 0;
5422
- } else {
5423
- var random = Math.random();
5424
- return Math.round(random * (values.length - 1));
5425
- }
5324
+ return values.length === 0 ? 0 : Math.round(Math.random() * (values.length - 1));
5426
5325
  }
5427
5326
  /**
5428
5327
  * Picks a single item randomly from the input array.
@@ -5469,12 +5368,11 @@ function generateIfDoesNotExist(keys, existing, readKey, generateFn) {
5469
5368
  */ function findIndexOfFirstDuplicateValue(values) {
5470
5369
  var encountered = new Set();
5471
5370
  return values.findIndex(function(x) {
5472
- if (encountered.has(x)) {
5473
- return true;
5474
- } else {
5371
+ var isDuplicate = encountered.has(x);
5372
+ if (!isDuplicate) {
5475
5373
  encountered.add(x);
5476
- return false;
5477
5374
  }
5375
+ return isDuplicate;
5478
5376
  });
5479
5377
  }
5480
5378
 
@@ -5605,11 +5503,7 @@ function caseInsensitiveString(input) {
5605
5503
  * @returns the prefixed string, or undefined if the input is null/undefined
5606
5504
  */ function addPlusPrefixToNumber(value) {
5607
5505
  var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '+';
5608
- if (value != null) {
5609
- return value > 0 ? "".concat(prefix).concat(value) : "".concat(value);
5610
- } else {
5611
- return undefined;
5612
- }
5506
+ return value != null ? value > 0 ? "".concat(prefix).concat(value) : "".concat(value) : undefined;
5613
5507
  }
5614
5508
  /**
5615
5509
  * Capitalizes the first letter of the input string.
@@ -5896,30 +5790,29 @@ function caseInsensitiveString(input) {
5896
5790
  var fromStart = config.fromStart, fromEnd = config.fromEnd;
5897
5791
  var takeFromStart = Math.abs(fromStart !== null && fromStart !== void 0 ? fromStart : 0);
5898
5792
  var takeFromEnd = Math.abs(fromEnd !== null && fromEnd !== void 0 ? fromEnd : 0);
5793
+ var result;
5899
5794
  if (fromStart && fromEnd) {
5900
- return function(input) {
5795
+ result = function result(input) {
5901
5796
  var totalTake = takeFromStart + takeFromEnd;
5902
- var result;
5903
5797
  if (totalTake >= input.length) {
5904
- result = input;
5905
- } else {
5906
- var startPart = input.slice(0, takeFromStart);
5907
- var endPart = input.slice(-takeFromEnd);
5908
- result = startPart + endPart;
5798
+ return input;
5909
5799
  }
5910
- return result;
5800
+ var startPart = input.slice(0, takeFromStart);
5801
+ var endPart = input.slice(-takeFromEnd);
5802
+ return startPart + endPart;
5911
5803
  };
5912
5804
  } else if (fromStart) {
5913
- return function(input) {
5805
+ result = function result(input) {
5914
5806
  return input.slice(0, takeFromStart);
5915
5807
  };
5916
5808
  } else if (fromEnd) {
5917
- return function(input) {
5809
+ result = function result(input) {
5918
5810
  return input.slice(-takeFromEnd);
5919
5811
  };
5920
5812
  } else {
5921
- return MAP_IDENTITY;
5813
+ result = MAP_IDENTITY;
5922
5814
  }
5815
+ return result;
5923
5816
  }
5924
5817
 
5925
5818
  /**
@@ -5957,11 +5850,7 @@ function caseInsensitiveString(input) {
5957
5850
  * @returns a function that applies the configured transformations to an array of strings
5958
5851
  */ function transformStrings(config) {
5959
5852
  var transform = transformStringFunction(config);
5960
- if (isMapIdentityFunction(transform)) {
5961
- return mapIdentityFunction();
5962
- } else {
5963
- return mapArrayFunction(transform);
5964
- }
5853
+ return isMapIdentityFunction(transform) ? mapIdentityFunction() : mapArrayFunction(transform);
5965
5854
  }
5966
5855
  /**
5967
5856
  * Converts an iterable of strings to a lowercase string array for case-insensitive operations.
@@ -6057,19 +5946,15 @@ function caseInsensitiveString(input) {
6057
5946
  var exclude = excludeInput ? asArray(excludeInput) : undefined;
6058
5947
  var transform = transformStrings(config);
6059
5948
  var caseInsensitiveCompare = config.caseInsensitive && !config.toLowercase && !config.toUppercase;
6060
- if (caseInsensitiveCompare) {
6061
- // transform after finding unique values
6062
- return function(input) {
6063
- return transform(filterUniqueCaseInsensitiveStrings(input, function(x) {
6064
- return x;
6065
- }, exclude));
6066
- };
6067
- } else {
6068
- // transform before, and then use a set to find unique values
6069
- return function(input) {
6070
- return unique(transform(input), exclude);
6071
- };
6072
- }
5949
+ // When case-insensitive compare is needed, transform after finding unique values.
5950
+ // Otherwise, transform before and then use a set to find unique values.
5951
+ return caseInsensitiveCompare ? function(input) {
5952
+ return transform(filterUniqueCaseInsensitiveStrings(input, function(x) {
5953
+ return x;
5954
+ }, exclude));
5955
+ } : function(input) {
5956
+ return unique(transform(input), exclude);
5957
+ };
6073
5958
  }
6074
5959
 
6075
5960
  function _assert_this_initialized$4(self) {
@@ -6585,14 +6470,16 @@ function _unsupported_iterable_to_array$q(o, minLen) {
6585
6470
  * // tuples: [['a', 1], ['c', 'hello']]
6586
6471
  * ```
6587
6472
  */ function filterKeyValueTuplesFunction(filter) {
6473
+ var result;
6588
6474
  if (filter != null) {
6589
6475
  var filterFn = filterKeyValueTupleFunction(filter);
6590
- return function(obj) {
6476
+ result = function result(obj) {
6591
6477
  return allKeyValueTuples(obj).filter(filterFn);
6592
6478
  };
6593
6479
  } else {
6594
- return allKeyValueTuples;
6480
+ result = allKeyValueTuples;
6595
6481
  }
6482
+ return result;
6596
6483
  }
6597
6484
  /**
6598
6485
  * Returns all key/value pairs from the object as tuples using `Object.entries`.
@@ -6645,13 +6532,9 @@ function _unsupported_iterable_to_array$q(o, minLen) {
6645
6532
  * @param input - Enum value or filter object
6646
6533
  * @returns Normalized filter object
6647
6534
  */ function filterKeyValueTuplesInputToFilter(input) {
6648
- if ((typeof input === "undefined" ? "undefined" : _type_of$f(input)) === 'object') {
6649
- return input;
6650
- } else {
6651
- return {
6652
- valueFilter: input
6653
- };
6654
- }
6535
+ return (typeof input === "undefined" ? "undefined" : _type_of$f(input)) === 'object' ? input : {
6536
+ valueFilter: input
6537
+ };
6655
6538
  }
6656
6539
  /**
6657
6540
  * Creates a filter predicate function for key/value tuples based on the provided filter configuration.
@@ -7666,11 +7549,7 @@ function isInSetDecisionFunction(set, inputReadValue) {
7666
7549
  * @param input
7667
7550
  * @returns
7668
7551
  */ function maybeSet(input) {
7669
- if (input != null) {
7670
- return new Set(asArray(input));
7671
- } else {
7672
- return input;
7673
- }
7552
+ return input != null ? new Set(asArray(input)) : input;
7674
7553
  }
7675
7554
 
7676
7555
  function _array_like_to_array$o(arr, len) {
@@ -7774,11 +7653,7 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
7774
7653
  return claimsValue;
7775
7654
  },
7776
7655
  decodeRolesFromValue: function decodeRolesFromValue(value) {
7777
- if (value === expectedValue) {
7778
- return [];
7779
- } else {
7780
- return claimRoles;
7781
- }
7656
+ return value === expectedValue ? [] : claimRoles;
7782
7657
  }
7783
7658
  };
7784
7659
  } else {
@@ -7793,11 +7668,7 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
7793
7668
  return claimsValue;
7794
7669
  },
7795
7670
  decodeRolesFromValue: function decodeRolesFromValue(value) {
7796
- if (value === expectedValue) {
7797
- return claimRoles;
7798
- } else {
7799
- return [];
7800
- }
7671
+ return value === expectedValue ? claimRoles : [];
7801
7672
  }
7802
7673
  };
7803
7674
  }
@@ -8018,11 +7889,7 @@ function _unsupported_iterable_to_array$n(o, minLen) {
8018
7889
  * @returns the modified string, or the original if the decision is false
8019
7890
  */ // eslint-disable-next-line @typescript-eslint/max-params
8020
7891
  function replaceCharacterAtIndexIf(input, index, replacement, decision) {
8021
- if (decision(input[index])) {
8022
- return replaceCharacterAtIndexWith(input, index, replacement);
8023
- } else {
8024
- return input;
8025
- }
7892
+ return decision(input[index]) ? replaceCharacterAtIndexWith(input, index, replacement) : input;
8026
7893
  }
8027
7894
  /**
8028
7895
  * Replaces the character at the given index with the replacement string.
@@ -8570,11 +8437,7 @@ function _unsupported_iterable_to_array$m(o, minLen) {
8570
8437
  */ function asDecisionFunction(valueOrFunction) {
8571
8438
  var defaultIfUndefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
8572
8439
  var input = valueOrFunction !== null && valueOrFunction !== void 0 ? valueOrFunction : defaultIfUndefined;
8573
- if (typeof input === 'boolean') {
8574
- return decisionFunction(input);
8575
- } else {
8576
- return input;
8577
- }
8440
+ return typeof input === 'boolean' ? decisionFunction(input) : input;
8578
8441
  }
8579
8442
  function isEqualToValueDecisionFunction(equalityValue) {
8580
8443
  var equalityValueCheckFunction;
@@ -9045,11 +8908,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
9045
8908
  if (isFolder) {
9046
8909
  joined = joined + SLASH_PATH_SEPARATOR; // end with a slash.
9047
8910
  }
9048
- if (startType === 'absolute' || path.startsWith(SLASH_PATH_SEPARATOR)) {
9049
- return toAbsoluteSlashPathStartType(joined);
9050
- } else {
9051
- return joined;
9052
- }
8911
+ return startType === 'absolute' || path.startsWith(SLASH_PATH_SEPARATOR) ? toAbsoluteSlashPathStartType(joined) : joined;
9053
8912
  };
9054
8913
  }
9055
8914
  /**
@@ -9717,11 +9576,7 @@ function _unsupported_iterable_to_array$k(o, minLen) {
9717
9576
  * @returns A `tel:` URL string with the extension appended using `;` if present.
9718
9577
  */ function telUrlStringForE164PhoneNumberPair(pair) {
9719
9578
  // https://stackoverflow.com/questions/9482633/how-do-i-include-extensions-in-the-tel-uri
9720
- if (pair.extension) {
9721
- return "tel:".concat(pair.number, ";").concat(pair.extension);
9722
- } else {
9723
- return "tel:".concat(pair.number);
9724
- }
9579
+ return pair.extension ? "tel:".concat(pair.number, ";").concat(pair.extension) : "tel:".concat(pair.number);
9725
9580
  }
9726
9581
 
9727
9582
  /**
@@ -9833,19 +9688,21 @@ function _unsupported_iterable_to_array$j(o, minLen) {
9833
9688
  * @returns A combined array of EmailParticipant objects
9834
9689
  */ function coerceToEmailParticipants(param) {
9835
9690
  var _param_participants = param.participants, participants = _param_participants === void 0 ? [] : _param_participants, _param_emails = param.emails, emails = _param_emails === void 0 ? [] : _param_emails;
9691
+ var result;
9836
9692
  if (!emails.length) {
9837
- return participants;
9693
+ result = participants;
9838
9694
  } else {
9839
9695
  var participantEmails = participants.map(function(x) {
9840
9696
  return x.email;
9841
9697
  });
9842
9698
  var emailsWithoutParticipants = excludeValuesFromArray(emails, participantEmails);
9843
- return _to_consumable_array$b(participants).concat(_to_consumable_array$b(emailsWithoutParticipants.map(function(email) {
9699
+ result = _to_consumable_array$b(participants).concat(_to_consumable_array$b(emailsWithoutParticipants.map(function(email) {
9844
9700
  return {
9845
9701
  email: email
9846
9702
  };
9847
9703
  })));
9848
9704
  }
9705
+ return result;
9849
9706
  }
9850
9707
 
9851
9708
  /**
@@ -11048,16 +10905,15 @@ function _unsupported_iterable_to_array$f(o, minLen) {
11048
10905
  return filterMaybeArrayValues(input.map(function(x) {
11049
10906
  return map.get(x);
11050
10907
  }));
11051
- } else {
11052
- var value = map.get(input);
10908
+ }
10909
+ var value = map.get(input);
10910
+ if (value == null) {
10911
+ value = defaultValue(input);
11053
10912
  if (value == null) {
11054
- value = defaultValue(input);
11055
- if (value == null) {
11056
- throw new Error("Encountered unknown value ".concat(input, " in primativeKeyDencoder."));
11057
- }
10913
+ throw new Error("Encountered unknown value ".concat(input, " in primativeKeyDencoder."));
11058
10914
  }
11059
- return value;
11060
10915
  }
10916
+ return value;
11061
10917
  };
11062
10918
  fn._map = map;
11063
10919
  return fn;
@@ -11100,10 +10956,9 @@ function _unsupported_iterable_to_array$f(o, minLen) {
11100
10956
  if (typeof input === 'string') {
11101
10957
  var split = splitEncodedValues(input);
11102
10958
  return dencoder(split);
11103
- } else {
11104
- var encoded = dencoder(input);
11105
- return encoded.join(joiner);
11106
10959
  }
10960
+ var encoded = dencoder(input);
10961
+ return encoded.join(joiner);
11107
10962
  };
11108
10963
  }
11109
10964
  /**
@@ -12403,11 +12258,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
12403
12258
  * @returns a function that returns `true` if the input is within the reference bound
12404
12259
  */ function isWithinLatLngBoundFunction(bound) {
12405
12260
  var fn = function fn(boundOrPoint) {
12406
- if (isLatLngPoint(boundOrPoint)) {
12407
- return isLatLngPointWithinLatLngBound(boundOrPoint, bound);
12408
- } else {
12409
- return isLatLngBoundWithinLatLngBound(boundOrPoint, bound);
12410
- }
12261
+ return isLatLngPoint(boundOrPoint) ? isLatLngPointWithinLatLngBound(boundOrPoint, bound) : isLatLngBoundWithinLatLngBound(boundOrPoint, bound);
12411
12262
  };
12412
12263
  fn._bound = bound;
12413
12264
  return fn;
@@ -12439,15 +12290,14 @@ function _unsupported_iterable_to_array$d(o, minLen) {
12439
12290
  var sw = within.sw, ne = within.ne;
12440
12291
  var lat = point.lat, lng = point.lng;
12441
12292
  var latIsBounded = lat >= sw.lat && lat <= ne.lat;
12442
- if (latIsBounded) {
12443
- if (latLngBoundStrictlyWrapsMap(within)) {
12444
- // included if between sw to the max possible value/bound (180), and ne to the min possible value/bound (-180)
12445
- return lng >= sw.lng || lng <= ne.lng;
12446
- } else {
12447
- return lng >= sw.lng && lng <= ne.lng;
12448
- }
12293
+ if (!latIsBounded) {
12294
+ return false;
12449
12295
  }
12450
- return false;
12296
+ if (latLngBoundStrictlyWrapsMap(within)) {
12297
+ // included if between sw to the max possible value/bound (180), and ne to the min possible value/bound (-180)
12298
+ return lng >= sw.lng || lng <= ne.lng;
12299
+ }
12300
+ return lng >= sw.lng && lng <= ne.lng;
12451
12301
  }
12452
12302
  /**
12453
12303
  * Checks whether two bounds overlap each other.
@@ -12468,11 +12318,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
12468
12318
  */ function overlapsLatLngBoundFunction(bound) {
12469
12319
  var a = boundToRectangle(bound);
12470
12320
  var fn = function fn(boundOrPoint) {
12471
- if (isLatLngPoint(boundOrPoint)) {
12472
- return isLatLngPointWithinLatLngBound(boundOrPoint, bound);
12473
- } else {
12474
- return rectangleOverlapsRectangle(a, boundToRectangle(boundOrPoint));
12475
- }
12321
+ return isLatLngPoint(boundOrPoint) ? isLatLngPointWithinLatLngBound(boundOrPoint, bound) : rectangleOverlapsRectangle(a, boundToRectangle(boundOrPoint));
12476
12322
  };
12477
12323
  fn._bound = bound;
12478
12324
  return fn;
@@ -12792,13 +12638,15 @@ function isConsideredUtcTimezoneString(timezone) {
12792
12638
  return "".concat(year, "-").concat(month, "-").concat(day);
12793
12639
  }
12794
12640
  function dateFromDateOrTimeMillisecondsNumber(input) {
12641
+ var result;
12795
12642
  if (input == null) {
12796
- return input;
12643
+ result = input;
12797
12644
  } else if (isDate(input)) {
12798
- return input;
12645
+ result = input;
12799
12646
  } else {
12800
- return unixMillisecondsNumberToDate(input);
12647
+ result = unixMillisecondsNumberToDate(input);
12801
12648
  }
12649
+ return result;
12802
12650
  }
12803
12651
  /**
12804
12652
  * Converts a unix timestamp number to a Date object.
@@ -13908,28 +13756,29 @@ function _object_spread$7(target) {
13908
13756
  * @param b - Second array (or single value) of partial objects
13909
13757
  * @returns 2D array where result[i][j] is `{ ...a[i], ...b[j] }`
13910
13758
  */ function objectMergeMatrix(a, b) {
13759
+ var result;
13911
13760
  if (a && b) {
13912
13761
  var aNorm = convertToArray(a);
13913
13762
  var bNorm = convertToArray(b);
13914
- var results = aNorm.map(function(a) {
13763
+ result = aNorm.map(function(a) {
13915
13764
  return bNorm.map(function(b) {
13916
13765
  return _object_spread$7({}, a, b);
13917
13766
  });
13918
13767
  });
13919
- return results;
13920
13768
  } else if (a) {
13921
- return [
13769
+ result = [
13922
13770
  convertToArray(a)
13923
13771
  ];
13924
13772
  } else if (b) {
13925
- return [
13773
+ result = [
13926
13774
  convertToArray(b)
13927
13775
  ];
13928
13776
  } else {
13929
- return [
13777
+ result = [
13930
13778
  []
13931
13779
  ];
13932
13780
  }
13781
+ return result;
13933
13782
  }
13934
13783
 
13935
13784
  function _type_of$6(obj) {
@@ -13981,13 +13830,15 @@ function _type_of$6(obj) {
13981
13830
  * @param input - Date object or unix timestamp number to convert
13982
13831
  * @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
13983
13832
  */ function unixDateTimeSecondsNumberFromDateOrTimeNumber(input) {
13833
+ var result;
13984
13834
  if (input == null) {
13985
- return input;
13835
+ result = input;
13986
13836
  } else if (isDate(input)) {
13987
- return unixDateTimeSecondsNumberFromDate(input);
13837
+ result = unixDateTimeSecondsNumberFromDate(input);
13988
13838
  } else {
13989
- return input;
13839
+ result = input;
13990
13840
  }
13841
+ return result;
13991
13842
  }
13992
13843
  /**
13993
13844
  * Gets the current time as a unix timestamp number.
@@ -14000,13 +13851,15 @@ function unixDateTimeSecondsNumberFromDate(date) {
14000
13851
  return date != null ? Math.ceil(date.getTime() / 1000) : date;
14001
13852
  }
14002
13853
  function dateFromDateOrTimeSecondsNumber(input) {
13854
+ var result;
14003
13855
  if (input == null) {
14004
- return input;
13856
+ result = input;
14005
13857
  } else if (isDate(input)) {
14006
- return input;
13858
+ result = input;
14007
13859
  } else {
14008
- return unixDateTimeSecondsNumberToDate(input);
13860
+ result = unixDateTimeSecondsNumberToDate(input);
14009
13861
  }
13862
+ return result;
14010
13863
  }
14011
13864
  /**
14012
13865
  * Converts a unix timestamp number to a Date object.
@@ -14362,13 +14215,15 @@ function _unsupported_iterable_to_array$a(o, minLen) {
14362
14215
  * @param days - The number of days to offset (positive or negative)
14363
14216
  * @returns The resulting DayOfWeek
14364
14217
  */ function getDayOffset(day, days) {
14218
+ var result;
14365
14219
  if (days === 0) {
14366
- return day;
14220
+ result = day;
14367
14221
  } else if (days < 0) {
14368
- return getPreviousDay(day, days);
14222
+ result = getPreviousDay(day, days);
14369
14223
  } else {
14370
- return getNextDay(day, days);
14224
+ result = getNextDay(day, days);
14371
14225
  }
14226
+ return result;
14372
14227
  }
14373
14228
  /**
14374
14229
  * Returns the DayOfWeek that is the given number of days before the input day.
@@ -14779,11 +14634,7 @@ function waitForMs(ms, value) {
14779
14634
  }
14780
14635
 
14781
14636
  function mapPromiseOrValue(input, mapFn) {
14782
- if (isPromise(input)) {
14783
- return input.then(mapFn);
14784
- } else {
14785
- return mapFn(input);
14786
- }
14637
+ return isPromise(input) ? input.then(mapFn) : mapFn(input);
14787
14638
  }
14788
14639
 
14789
14640
  function _define_property$a(obj, key, value) {
@@ -15408,21 +15259,19 @@ function _performAsyncTask(_0, _1) {
15408
15259
  return doNextTry();
15409
15260
  }) : doNextTry()
15410
15261
  ];
15411
- } else {
15412
- // Error out.
15413
- if (throwError) {
15414
- throw result[0];
15415
- } else {
15416
- return [
15417
- 2,
15418
- [
15419
- value,
15420
- undefined,
15421
- false
15422
- ]
15423
- ];
15424
- }
15425
15262
  }
15263
+ // Error out.
15264
+ if (throwError) {
15265
+ throw result[0];
15266
+ }
15267
+ return [
15268
+ 2,
15269
+ [
15270
+ value,
15271
+ undefined,
15272
+ false
15273
+ ]
15274
+ ];
15426
15275
  }
15427
15276
  });
15428
15277
  })();
@@ -15484,11 +15333,7 @@ function _performAsyncTask(_0, _1) {
15484
15333
  if (maxParallelTasks && !nonConcurrentTaskKeyFactory) {
15485
15334
  result = function result(input) {
15486
15335
  // if there is no custom nonConcurrentTaskKeyFactory, then we can just run all tasks at once and skip the overhead of performTasksInParallel if the input has less than the maxParallelTasks
15487
- if (input.length <= maxParallelTasks) {
15488
- return performAllTasksInUnlimitedParallel(input);
15489
- } else {
15490
- return performTasksWithInput(input);
15491
- }
15336
+ return input.length <= maxParallelTasks ? performAllTasksInUnlimitedParallel(input) : performTasksWithInput(input);
15492
15337
  };
15493
15338
  } else {
15494
15339
  result = performTasksWithInput;
@@ -15521,25 +15366,20 @@ function _performAsyncTask(_0, _1) {
15521
15366
  return [
15522
15367
  2
15523
15368
  ];
15369
+ }
15370
+ promiseRef = promiseReference();
15371
+ if (isFulfillingTask) {
15372
+ requestTasksQueue.push([
15373
+ parallelIndex,
15374
+ promiseRef
15375
+ ]);
15524
15376
  } else {
15525
- promiseRef = promiseReference();
15526
- if (isFulfillingTask) {
15527
- requestTasksQueue.push([
15528
- parallelIndex,
15529
- promiseRef
15530
- ]);
15531
- return [
15532
- 2,
15533
- promiseRef.promise
15534
- ];
15535
- } else {
15536
- void fulfillRequestMoreTasks(parallelIndex, promiseRef);
15537
- }
15538
- return [
15539
- 2,
15540
- promiseRef.promise
15541
- ];
15377
+ void fulfillRequestMoreTasks(parallelIndex, promiseRef);
15542
15378
  }
15379
+ return [
15380
+ 2,
15381
+ promiseRef.promise
15382
+ ];
15543
15383
  });
15544
15384
  })();
15545
15385
  };
@@ -15874,11 +15714,7 @@ function _object_spread$4(target) {
15874
15714
  currentCount = count + increasedExecutions;
15875
15715
  timeOfLastExecution = new Date();
15876
15716
  }
15877
- if (effectiveCount >= countForMaxWaitTime) {
15878
- return config.maxWaitTime;
15879
- } else {
15880
- return (Math.pow(config.exponentRate, Math.max(effectiveCount, 0)) - 1) * MS_IN_SECOND;
15881
- }
15717
+ return effectiveCount >= countForMaxWaitTime ? config.maxWaitTime : (Math.pow(config.exponentRate, Math.max(effectiveCount, 0)) - 1) * MS_IN_SECOND;
15882
15718
  }
15883
15719
  function getNextWaitTime(increase) {
15884
15720
  return _nextWaitTime(increase !== null && increase !== void 0 ? increase : 0);
@@ -16825,11 +16661,7 @@ function _is_native_reflect_construct$2() {
16825
16661
  * @returns a Date representing the estimated end time, or null if no duration remains
16826
16662
  */ function approximateTimerEndDate(timer) {
16827
16663
  var durationRemaining = timer.durationRemaining;
16828
- if (durationRemaining != null) {
16829
- return new Date(Date.now() + durationRemaining);
16830
- } else {
16831
- return null;
16832
- }
16664
+ return durationRemaining != null ? new Date(Date.now() + durationRemaining) : null;
16833
16665
  }
16834
16666
 
16835
16667
  /**
@@ -17846,11 +17678,7 @@ function _object_spread$2(target) {
17846
17678
  * @param config - The host and port configuration, or null/undefined
17847
17679
  * @returns The joined string, or null/undefined if config is null/undefined
17848
17680
  */ function joinHostAndPort(config) {
17849
- if (config) {
17850
- return "".concat(config.host, ":").concat(config.port);
17851
- } else {
17852
- return config;
17853
- }
17681
+ return config ? "".concat(config.host, ":").concat(config.port) : config;
17854
17682
  }
17855
17683
 
17856
17684
  function _array_like_to_array$4(arr, len) {
@@ -17964,9 +17792,8 @@ function _unsupported_iterable_to_array$4(o, minLen) {
17964
17792
  var _separateValues1 = separateValues(mods, mask), modModify = _separateValues1.included;
17965
17793
  var modifiedResults = this._modifyCollectionWithoutMask(currentModify, change, modModify, config);
17966
17794
  return this._mergeMaskResults(current, currentRetain, modifiedResults, readKey);
17967
- } else {
17968
- return this._modifyCollectionWithoutMask(current, change, mods, config);
17969
17795
  }
17796
+ return this._modifyCollectionWithoutMask(current, change, mods, config);
17970
17797
  }
17971
17798
  },
17972
17799
  {
@@ -18090,11 +17917,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
18090
17917
  * @returns the modified collection with all changes applied
18091
17918
  */ // eslint-disable-next-line @typescript-eslint/max-params
18092
17919
  function _modifyCollection(current, mods, modifyCollection, readType) {
18093
- if (readType) {
18094
- return ModelRelationUtility._modifyMultiTypeCollection(current, mods, readType, modifyCollection);
18095
- } else {
18096
- return modifyCollection(current, mods);
18097
- }
17920
+ return readType ? ModelRelationUtility._modifyMultiTypeCollection(current, mods, readType, modifyCollection) : modifyCollection(current, mods);
18098
17921
  }
18099
17922
  },
18100
17923
  {
@@ -18110,11 +17933,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
18110
17933
  var values = (_inputMap_get = inputMap.get(type)) !== null && _inputMap_get !== void 0 ? _inputMap_get : [];
18111
17934
  var _$mods = (_modsMap_get = modsMap.get(type)) !== null && _modsMap_get !== void 0 ? _modsMap_get : [];
18112
17935
  // Only modify if they've got changes for their type.
18113
- if (_$mods.length === 0) {
18114
- return values; // No mods, no change to those types.
18115
- } else {
18116
- return modifyCollection(values, _$mods);
18117
- }
17936
+ return _$mods.length === 0 ? values : modifyCollection(values, _$mods);
18118
17937
  });
18119
17938
  // Rejoin all changes.
18120
17939
  return modifiedSubcollections.reduce(function(x, y) {
@@ -18189,28 +18008,26 @@ function _unsupported_iterable_to_array$4(o, minLen) {
18189
18008
  * @returns The collection with matching items removed.
18190
18009
  */ // eslint-disable-next-line @typescript-eslint/max-params
18191
18010
  function removeFromCollection(current, remove, readKey, shouldRemove) {
18192
- if (current === null || current === void 0 ? void 0 : current.length) {
18193
- if (shouldRemove) {
18194
- var currentKeyPairs = makeKeyPairs(current, readKey);
18195
- var map = new Map(currentKeyPairs);
18196
- remove.forEach(function(x) {
18197
- var key = readKey(x);
18198
- var removalTarget = map.get(key);
18199
- if (removalTarget && shouldRemove(removalTarget)) {
18200
- map.delete(key); // Remove from the map.
18201
- }
18202
- });
18203
- return currentKeyPairs.filter(function(x) {
18204
- return map.has(x[0]);
18205
- }).map(function(x) {
18206
- return x[1];
18207
- }); // Retain order, remove from map.
18208
- } else {
18209
- return ModelRelationUtility.removeKeysFromCollection(current, remove.map(readKey), readKey);
18210
- }
18211
- } else {
18011
+ if (!(current === null || current === void 0 ? void 0 : current.length)) {
18212
18012
  return [];
18213
18013
  }
18014
+ if (shouldRemove) {
18015
+ var currentKeyPairs = makeKeyPairs(current, readKey);
18016
+ var map = new Map(currentKeyPairs);
18017
+ remove.forEach(function(x) {
18018
+ var key = readKey(x);
18019
+ var removalTarget = map.get(key);
18020
+ if (removalTarget && shouldRemove(removalTarget)) {
18021
+ map.delete(key); // Remove from the map.
18022
+ }
18023
+ });
18024
+ return currentKeyPairs.filter(function(x) {
18025
+ return map.has(x[0]);
18026
+ }).map(function(x) {
18027
+ return x[1];
18028
+ }); // Retain order, remove from map.
18029
+ }
18030
+ return ModelRelationUtility.removeKeysFromCollection(current, remove.map(readKey), readKey);
18214
18031
  }
18215
18032
  },
18216
18033
  {
@@ -19425,11 +19242,7 @@ function _unsupported_iterable_to_array(o, minLen) {
19425
19242
  var separator = config.separator, mergeMeta = config.mergeMeta;
19426
19243
  var value = inputValue.value, leafMeta = inputValue.leafMeta, nodeMeta = inputValue.nodeMeta;
19427
19244
  function nextMeta(node, nextMeta) {
19428
- if (mergeMeta && node.meta != null) {
19429
- return mergeMeta(node.meta, nextMeta);
19430
- } else {
19431
- return nextMeta;
19432
- }
19245
+ return mergeMeta && node.meta != null ? mergeMeta(node.meta, nextMeta) : nextMeta;
19433
19246
  }
19434
19247
  var parts = value.split(separator);
19435
19248
  var currentNode = tree;
@@ -19957,13 +19770,9 @@ function invertMaybeBoolean(x) {
19957
19770
  var rFn = function rFn(array) {
19958
19771
  return Boolean(array.reduce(reduceFn));
19959
19772
  };
19960
- if (emptyArrayValue != null) {
19961
- return function(array) {
19962
- return array.length ? rFn(array) : emptyArrayValue;
19963
- };
19964
- } else {
19965
- return rFn;
19966
- }
19773
+ return emptyArrayValue != null ? function(array) {
19774
+ return array.length ? rFn(array) : emptyArrayValue;
19775
+ } : rFn;
19967
19776
  }
19968
19777
  /**
19969
19778
  * Creates a new BooleanFactory that generates random boolean values based on chance.