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