@dereekb/util 13.7.0 → 13.9.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/fetch/index.cjs.js +8 -13
- package/fetch/index.esm.js +8 -13
- package/fetch/package.json +2 -2
- package/index.cjs.js +305 -489
- package/index.esm.js +305 -489
- package/package.json +1 -1
- package/src/lib/array/array.number.d.ts +2 -1
- package/src/lib/getter/getter.cache.d.ts +4 -0
- package/src/lib/string/html.d.ts +4 -0
- package/test/index.cjs.js +12 -5
- package/test/index.esm.js +12 -5
- package/test/package.json +2 -2
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
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
701
|
+
result = [];
|
|
724
702
|
values.forEach(function(x) {
|
|
725
703
|
var key = readKey(x);
|
|
726
704
|
if (key != null) {
|
|
727
|
-
pushItemOrArrayItemsIntoArray(
|
|
705
|
+
pushItemOrArrayItemsIntoArray(result, key);
|
|
728
706
|
}
|
|
729
707
|
});
|
|
730
|
-
return keys;
|
|
731
708
|
} else {
|
|
732
|
-
|
|
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
|
-
|
|
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
|
|
744
|
+
return result.add(x);
|
|
766
745
|
});
|
|
767
746
|
} else {
|
|
768
|
-
|
|
747
|
+
result.add(key);
|
|
769
748
|
}
|
|
770
749
|
}
|
|
771
750
|
});
|
|
772
|
-
return keys;
|
|
773
751
|
} else {
|
|
774
|
-
|
|
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
|
-
|
|
1255
|
-
return
|
|
1256
|
-
|
|
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
|
-
|
|
1288
|
-
return !
|
|
1289
|
-
|
|
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
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1473
|
+
result = !isEmptyIterable(value);
|
|
1510
1474
|
} else if (isNotNullOrEmptyString(value)) {
|
|
1511
|
-
|
|
1475
|
+
result = (typeof value === "undefined" ? "undefined" : _type_of$l(value)) === 'object' ? !objectHasNoKeys(value) : true;
|
|
1512
1476
|
} else {
|
|
1513
|
-
|
|
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
|
-
|
|
1829
|
-
return
|
|
1830
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3496
|
+
return isNonClassFunction(input) ? input : function() {
|
|
3549
3497
|
return input;
|
|
3550
|
-
}
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3704
|
-
return
|
|
3705
|
-
}
|
|
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
|
-
|
|
3876
|
+
result = function result(value) {
|
|
3938
3877
|
return cutToPrecision(value, precision);
|
|
3939
3878
|
};
|
|
3940
3879
|
} else {
|
|
3941
3880
|
var rndFn = roundingFunction(roundFn);
|
|
3942
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
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
|
-
}
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5473
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5795
|
+
result = function result(input) {
|
|
5901
5796
|
var totalTake = takeFromStart + takeFromEnd;
|
|
5902
|
-
var result;
|
|
5903
5797
|
if (totalTake >= input.length) {
|
|
5904
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5805
|
+
result = function result(input) {
|
|
5914
5806
|
return input.slice(0, takeFromStart);
|
|
5915
5807
|
};
|
|
5916
5808
|
} else if (fromEnd) {
|
|
5917
|
-
|
|
5809
|
+
result = function result(input) {
|
|
5918
5810
|
return input.slice(-takeFromEnd);
|
|
5919
5811
|
};
|
|
5920
5812
|
} else {
|
|
5921
|
-
|
|
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
|
-
|
|
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
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
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
|
-
|
|
6476
|
+
result = function result(obj) {
|
|
6591
6477
|
return allKeyValueTuples(obj).filter(filterFn);
|
|
6592
6478
|
};
|
|
6593
6479
|
} else {
|
|
6594
|
-
|
|
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
|
-
|
|
6649
|
-
|
|
6650
|
-
}
|
|
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.
|
|
@@ -6773,6 +6656,9 @@ function cachedGetter(factory) {
|
|
|
6773
6656
|
return loaded = undefined;
|
|
6774
6657
|
};
|
|
6775
6658
|
result.init = init;
|
|
6659
|
+
result.used = function() {
|
|
6660
|
+
return Boolean(loaded);
|
|
6661
|
+
};
|
|
6776
6662
|
return result;
|
|
6777
6663
|
}
|
|
6778
6664
|
|
|
@@ -7666,11 +7552,7 @@ function isInSetDecisionFunction(set, inputReadValue) {
|
|
|
7666
7552
|
* @param input
|
|
7667
7553
|
* @returns
|
|
7668
7554
|
*/ function maybeSet(input) {
|
|
7669
|
-
|
|
7670
|
-
return new Set(asArray(input));
|
|
7671
|
-
} else {
|
|
7672
|
-
return input;
|
|
7673
|
-
}
|
|
7555
|
+
return input != null ? new Set(asArray(input)) : input;
|
|
7674
7556
|
}
|
|
7675
7557
|
|
|
7676
7558
|
function _array_like_to_array$o(arr, len) {
|
|
@@ -7774,11 +7656,7 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
|
|
|
7774
7656
|
return claimsValue;
|
|
7775
7657
|
},
|
|
7776
7658
|
decodeRolesFromValue: function decodeRolesFromValue(value) {
|
|
7777
|
-
|
|
7778
|
-
return [];
|
|
7779
|
-
} else {
|
|
7780
|
-
return claimRoles;
|
|
7781
|
-
}
|
|
7659
|
+
return value === expectedValue ? [] : claimRoles;
|
|
7782
7660
|
}
|
|
7783
7661
|
};
|
|
7784
7662
|
} else {
|
|
@@ -7793,11 +7671,7 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
|
|
|
7793
7671
|
return claimsValue;
|
|
7794
7672
|
},
|
|
7795
7673
|
decodeRolesFromValue: function decodeRolesFromValue(value) {
|
|
7796
|
-
|
|
7797
|
-
return claimRoles;
|
|
7798
|
-
} else {
|
|
7799
|
-
return [];
|
|
7800
|
-
}
|
|
7674
|
+
return value === expectedValue ? claimRoles : [];
|
|
7801
7675
|
}
|
|
7802
7676
|
};
|
|
7803
7677
|
}
|
|
@@ -8018,11 +7892,7 @@ function _unsupported_iterable_to_array$n(o, minLen) {
|
|
|
8018
7892
|
* @returns the modified string, or the original if the decision is false
|
|
8019
7893
|
*/ // eslint-disable-next-line @typescript-eslint/max-params
|
|
8020
7894
|
function replaceCharacterAtIndexIf(input, index, replacement, decision) {
|
|
8021
|
-
|
|
8022
|
-
return replaceCharacterAtIndexWith(input, index, replacement);
|
|
8023
|
-
} else {
|
|
8024
|
-
return input;
|
|
8025
|
-
}
|
|
7895
|
+
return decision(input[index]) ? replaceCharacterAtIndexWith(input, index, replacement) : input;
|
|
8026
7896
|
}
|
|
8027
7897
|
/**
|
|
8028
7898
|
* Replaces the character at the given index with the replacement string.
|
|
@@ -8570,11 +8440,7 @@ function _unsupported_iterable_to_array$m(o, minLen) {
|
|
|
8570
8440
|
*/ function asDecisionFunction(valueOrFunction) {
|
|
8571
8441
|
var defaultIfUndefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
8572
8442
|
var input = valueOrFunction !== null && valueOrFunction !== void 0 ? valueOrFunction : defaultIfUndefined;
|
|
8573
|
-
|
|
8574
|
-
return decisionFunction(input);
|
|
8575
|
-
} else {
|
|
8576
|
-
return input;
|
|
8577
|
-
}
|
|
8443
|
+
return typeof input === 'boolean' ? decisionFunction(input) : input;
|
|
8578
8444
|
}
|
|
8579
8445
|
function isEqualToValueDecisionFunction(equalityValue) {
|
|
8580
8446
|
var equalityValueCheckFunction;
|
|
@@ -9045,11 +8911,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
|
|
|
9045
8911
|
if (isFolder) {
|
|
9046
8912
|
joined = joined + SLASH_PATH_SEPARATOR; // end with a slash.
|
|
9047
8913
|
}
|
|
9048
|
-
|
|
9049
|
-
return toAbsoluteSlashPathStartType(joined);
|
|
9050
|
-
} else {
|
|
9051
|
-
return joined;
|
|
9052
|
-
}
|
|
8914
|
+
return startType === 'absolute' || path.startsWith(SLASH_PATH_SEPARATOR) ? toAbsoluteSlashPathStartType(joined) : joined;
|
|
9053
8915
|
};
|
|
9054
8916
|
}
|
|
9055
8917
|
/**
|
|
@@ -9717,11 +9579,7 @@ function _unsupported_iterable_to_array$k(o, minLen) {
|
|
|
9717
9579
|
* @returns A `tel:` URL string with the extension appended using `;` if present.
|
|
9718
9580
|
*/ function telUrlStringForE164PhoneNumberPair(pair) {
|
|
9719
9581
|
// https://stackoverflow.com/questions/9482633/how-do-i-include-extensions-in-the-tel-uri
|
|
9720
|
-
|
|
9721
|
-
return "tel:".concat(pair.number, ";").concat(pair.extension);
|
|
9722
|
-
} else {
|
|
9723
|
-
return "tel:".concat(pair.number);
|
|
9724
|
-
}
|
|
9582
|
+
return pair.extension ? "tel:".concat(pair.number, ";").concat(pair.extension) : "tel:".concat(pair.number);
|
|
9725
9583
|
}
|
|
9726
9584
|
|
|
9727
9585
|
/**
|
|
@@ -9833,19 +9691,21 @@ function _unsupported_iterable_to_array$j(o, minLen) {
|
|
|
9833
9691
|
* @returns A combined array of EmailParticipant objects
|
|
9834
9692
|
*/ function coerceToEmailParticipants(param) {
|
|
9835
9693
|
var _param_participants = param.participants, participants = _param_participants === void 0 ? [] : _param_participants, _param_emails = param.emails, emails = _param_emails === void 0 ? [] : _param_emails;
|
|
9694
|
+
var result;
|
|
9836
9695
|
if (!emails.length) {
|
|
9837
|
-
|
|
9696
|
+
result = participants;
|
|
9838
9697
|
} else {
|
|
9839
9698
|
var participantEmails = participants.map(function(x) {
|
|
9840
9699
|
return x.email;
|
|
9841
9700
|
});
|
|
9842
9701
|
var emailsWithoutParticipants = excludeValuesFromArray(emails, participantEmails);
|
|
9843
|
-
|
|
9702
|
+
result = _to_consumable_array$b(participants).concat(_to_consumable_array$b(emailsWithoutParticipants.map(function(email) {
|
|
9844
9703
|
return {
|
|
9845
9704
|
email: email
|
|
9846
9705
|
};
|
|
9847
9706
|
})));
|
|
9848
9707
|
}
|
|
9708
|
+
return result;
|
|
9849
9709
|
}
|
|
9850
9710
|
|
|
9851
9711
|
/**
|
|
@@ -11048,16 +10908,15 @@ function _unsupported_iterable_to_array$f(o, minLen) {
|
|
|
11048
10908
|
return filterMaybeArrayValues(input.map(function(x) {
|
|
11049
10909
|
return map.get(x);
|
|
11050
10910
|
}));
|
|
11051
|
-
}
|
|
11052
|
-
|
|
10911
|
+
}
|
|
10912
|
+
var value = map.get(input);
|
|
10913
|
+
if (value == null) {
|
|
10914
|
+
value = defaultValue(input);
|
|
11053
10915
|
if (value == null) {
|
|
11054
|
-
|
|
11055
|
-
if (value == null) {
|
|
11056
|
-
throw new Error("Encountered unknown value ".concat(input, " in primativeKeyDencoder."));
|
|
11057
|
-
}
|
|
10916
|
+
throw new Error("Encountered unknown value ".concat(input, " in primativeKeyDencoder."));
|
|
11058
10917
|
}
|
|
11059
|
-
return value;
|
|
11060
10918
|
}
|
|
10919
|
+
return value;
|
|
11061
10920
|
};
|
|
11062
10921
|
fn._map = map;
|
|
11063
10922
|
return fn;
|
|
@@ -11100,10 +10959,9 @@ function _unsupported_iterable_to_array$f(o, minLen) {
|
|
|
11100
10959
|
if (typeof input === 'string') {
|
|
11101
10960
|
var split = splitEncodedValues(input);
|
|
11102
10961
|
return dencoder(split);
|
|
11103
|
-
} else {
|
|
11104
|
-
var encoded = dencoder(input);
|
|
11105
|
-
return encoded.join(joiner);
|
|
11106
10962
|
}
|
|
10963
|
+
var encoded = dencoder(input);
|
|
10964
|
+
return encoded.join(joiner);
|
|
11107
10965
|
};
|
|
11108
10966
|
}
|
|
11109
10967
|
/**
|
|
@@ -12403,11 +12261,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
|
|
|
12403
12261
|
* @returns a function that returns `true` if the input is within the reference bound
|
|
12404
12262
|
*/ function isWithinLatLngBoundFunction(bound) {
|
|
12405
12263
|
var fn = function fn(boundOrPoint) {
|
|
12406
|
-
|
|
12407
|
-
return isLatLngPointWithinLatLngBound(boundOrPoint, bound);
|
|
12408
|
-
} else {
|
|
12409
|
-
return isLatLngBoundWithinLatLngBound(boundOrPoint, bound);
|
|
12410
|
-
}
|
|
12264
|
+
return isLatLngPoint(boundOrPoint) ? isLatLngPointWithinLatLngBound(boundOrPoint, bound) : isLatLngBoundWithinLatLngBound(boundOrPoint, bound);
|
|
12411
12265
|
};
|
|
12412
12266
|
fn._bound = bound;
|
|
12413
12267
|
return fn;
|
|
@@ -12439,15 +12293,14 @@ function _unsupported_iterable_to_array$d(o, minLen) {
|
|
|
12439
12293
|
var sw = within.sw, ne = within.ne;
|
|
12440
12294
|
var lat = point.lat, lng = point.lng;
|
|
12441
12295
|
var latIsBounded = lat >= sw.lat && lat <= ne.lat;
|
|
12442
|
-
if (latIsBounded) {
|
|
12443
|
-
|
|
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
|
-
}
|
|
12296
|
+
if (!latIsBounded) {
|
|
12297
|
+
return false;
|
|
12449
12298
|
}
|
|
12450
|
-
|
|
12299
|
+
if (latLngBoundStrictlyWrapsMap(within)) {
|
|
12300
|
+
// included if between sw to the max possible value/bound (180), and ne to the min possible value/bound (-180)
|
|
12301
|
+
return lng >= sw.lng || lng <= ne.lng;
|
|
12302
|
+
}
|
|
12303
|
+
return lng >= sw.lng && lng <= ne.lng;
|
|
12451
12304
|
}
|
|
12452
12305
|
/**
|
|
12453
12306
|
* Checks whether two bounds overlap each other.
|
|
@@ -12468,11 +12321,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
|
|
|
12468
12321
|
*/ function overlapsLatLngBoundFunction(bound) {
|
|
12469
12322
|
var a = boundToRectangle(bound);
|
|
12470
12323
|
var fn = function fn(boundOrPoint) {
|
|
12471
|
-
|
|
12472
|
-
return isLatLngPointWithinLatLngBound(boundOrPoint, bound);
|
|
12473
|
-
} else {
|
|
12474
|
-
return rectangleOverlapsRectangle(a, boundToRectangle(boundOrPoint));
|
|
12475
|
-
}
|
|
12324
|
+
return isLatLngPoint(boundOrPoint) ? isLatLngPointWithinLatLngBound(boundOrPoint, bound) : rectangleOverlapsRectangle(a, boundToRectangle(boundOrPoint));
|
|
12476
12325
|
};
|
|
12477
12326
|
fn._bound = bound;
|
|
12478
12327
|
return fn;
|
|
@@ -12792,13 +12641,15 @@ function isConsideredUtcTimezoneString(timezone) {
|
|
|
12792
12641
|
return "".concat(year, "-").concat(month, "-").concat(day);
|
|
12793
12642
|
}
|
|
12794
12643
|
function dateFromDateOrTimeMillisecondsNumber(input) {
|
|
12644
|
+
var result;
|
|
12795
12645
|
if (input == null) {
|
|
12796
|
-
|
|
12646
|
+
result = input;
|
|
12797
12647
|
} else if (isDate(input)) {
|
|
12798
|
-
|
|
12648
|
+
result = input;
|
|
12799
12649
|
} else {
|
|
12800
|
-
|
|
12650
|
+
result = unixMillisecondsNumberToDate(input);
|
|
12801
12651
|
}
|
|
12652
|
+
return result;
|
|
12802
12653
|
}
|
|
12803
12654
|
/**
|
|
12804
12655
|
* Converts a unix timestamp number to a Date object.
|
|
@@ -13908,28 +13759,29 @@ function _object_spread$7(target) {
|
|
|
13908
13759
|
* @param b - Second array (or single value) of partial objects
|
|
13909
13760
|
* @returns 2D array where result[i][j] is `{ ...a[i], ...b[j] }`
|
|
13910
13761
|
*/ function objectMergeMatrix(a, b) {
|
|
13762
|
+
var result;
|
|
13911
13763
|
if (a && b) {
|
|
13912
13764
|
var aNorm = convertToArray(a);
|
|
13913
13765
|
var bNorm = convertToArray(b);
|
|
13914
|
-
|
|
13766
|
+
result = aNorm.map(function(a) {
|
|
13915
13767
|
return bNorm.map(function(b) {
|
|
13916
13768
|
return _object_spread$7({}, a, b);
|
|
13917
13769
|
});
|
|
13918
13770
|
});
|
|
13919
|
-
return results;
|
|
13920
13771
|
} else if (a) {
|
|
13921
|
-
|
|
13772
|
+
result = [
|
|
13922
13773
|
convertToArray(a)
|
|
13923
13774
|
];
|
|
13924
13775
|
} else if (b) {
|
|
13925
|
-
|
|
13776
|
+
result = [
|
|
13926
13777
|
convertToArray(b)
|
|
13927
13778
|
];
|
|
13928
13779
|
} else {
|
|
13929
|
-
|
|
13780
|
+
result = [
|
|
13930
13781
|
[]
|
|
13931
13782
|
];
|
|
13932
13783
|
}
|
|
13784
|
+
return result;
|
|
13933
13785
|
}
|
|
13934
13786
|
|
|
13935
13787
|
function _type_of$6(obj) {
|
|
@@ -13981,13 +13833,15 @@ function _type_of$6(obj) {
|
|
|
13981
13833
|
* @param input - Date object or unix timestamp number to convert
|
|
13982
13834
|
* @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
|
|
13983
13835
|
*/ function unixDateTimeSecondsNumberFromDateOrTimeNumber(input) {
|
|
13836
|
+
var result;
|
|
13984
13837
|
if (input == null) {
|
|
13985
|
-
|
|
13838
|
+
result = input;
|
|
13986
13839
|
} else if (isDate(input)) {
|
|
13987
|
-
|
|
13840
|
+
result = unixDateTimeSecondsNumberFromDate(input);
|
|
13988
13841
|
} else {
|
|
13989
|
-
|
|
13842
|
+
result = input;
|
|
13990
13843
|
}
|
|
13844
|
+
return result;
|
|
13991
13845
|
}
|
|
13992
13846
|
/**
|
|
13993
13847
|
* Gets the current time as a unix timestamp number.
|
|
@@ -14000,13 +13854,15 @@ function unixDateTimeSecondsNumberFromDate(date) {
|
|
|
14000
13854
|
return date != null ? Math.ceil(date.getTime() / 1000) : date;
|
|
14001
13855
|
}
|
|
14002
13856
|
function dateFromDateOrTimeSecondsNumber(input) {
|
|
13857
|
+
var result;
|
|
14003
13858
|
if (input == null) {
|
|
14004
|
-
|
|
13859
|
+
result = input;
|
|
14005
13860
|
} else if (isDate(input)) {
|
|
14006
|
-
|
|
13861
|
+
result = input;
|
|
14007
13862
|
} else {
|
|
14008
|
-
|
|
13863
|
+
result = unixDateTimeSecondsNumberToDate(input);
|
|
14009
13864
|
}
|
|
13865
|
+
return result;
|
|
14010
13866
|
}
|
|
14011
13867
|
/**
|
|
14012
13868
|
* Converts a unix timestamp number to a Date object.
|
|
@@ -14362,13 +14218,15 @@ function _unsupported_iterable_to_array$a(o, minLen) {
|
|
|
14362
14218
|
* @param days - The number of days to offset (positive or negative)
|
|
14363
14219
|
* @returns The resulting DayOfWeek
|
|
14364
14220
|
*/ function getDayOffset(day, days) {
|
|
14221
|
+
var result;
|
|
14365
14222
|
if (days === 0) {
|
|
14366
|
-
|
|
14223
|
+
result = day;
|
|
14367
14224
|
} else if (days < 0) {
|
|
14368
|
-
|
|
14225
|
+
result = getPreviousDay(day, days);
|
|
14369
14226
|
} else {
|
|
14370
|
-
|
|
14227
|
+
result = getNextDay(day, days);
|
|
14371
14228
|
}
|
|
14229
|
+
return result;
|
|
14372
14230
|
}
|
|
14373
14231
|
/**
|
|
14374
14232
|
* Returns the DayOfWeek that is the given number of days before the input day.
|
|
@@ -14779,11 +14637,7 @@ function waitForMs(ms, value) {
|
|
|
14779
14637
|
}
|
|
14780
14638
|
|
|
14781
14639
|
function mapPromiseOrValue(input, mapFn) {
|
|
14782
|
-
|
|
14783
|
-
return input.then(mapFn);
|
|
14784
|
-
} else {
|
|
14785
|
-
return mapFn(input);
|
|
14786
|
-
}
|
|
14640
|
+
return isPromise(input) ? input.then(mapFn) : mapFn(input);
|
|
14787
14641
|
}
|
|
14788
14642
|
|
|
14789
14643
|
function _define_property$a(obj, key, value) {
|
|
@@ -15408,21 +15262,19 @@ function _performAsyncTask(_0, _1) {
|
|
|
15408
15262
|
return doNextTry();
|
|
15409
15263
|
}) : doNextTry()
|
|
15410
15264
|
];
|
|
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
15265
|
}
|
|
15266
|
+
// Error out.
|
|
15267
|
+
if (throwError) {
|
|
15268
|
+
throw result[0];
|
|
15269
|
+
}
|
|
15270
|
+
return [
|
|
15271
|
+
2,
|
|
15272
|
+
[
|
|
15273
|
+
value,
|
|
15274
|
+
undefined,
|
|
15275
|
+
false
|
|
15276
|
+
]
|
|
15277
|
+
];
|
|
15426
15278
|
}
|
|
15427
15279
|
});
|
|
15428
15280
|
})();
|
|
@@ -15484,11 +15336,7 @@ function _performAsyncTask(_0, _1) {
|
|
|
15484
15336
|
if (maxParallelTasks && !nonConcurrentTaskKeyFactory) {
|
|
15485
15337
|
result = function result(input) {
|
|
15486
15338
|
// 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
|
-
|
|
15488
|
-
return performAllTasksInUnlimitedParallel(input);
|
|
15489
|
-
} else {
|
|
15490
|
-
return performTasksWithInput(input);
|
|
15491
|
-
}
|
|
15339
|
+
return input.length <= maxParallelTasks ? performAllTasksInUnlimitedParallel(input) : performTasksWithInput(input);
|
|
15492
15340
|
};
|
|
15493
15341
|
} else {
|
|
15494
15342
|
result = performTasksWithInput;
|
|
@@ -15521,25 +15369,20 @@ function _performAsyncTask(_0, _1) {
|
|
|
15521
15369
|
return [
|
|
15522
15370
|
2
|
|
15523
15371
|
];
|
|
15372
|
+
}
|
|
15373
|
+
promiseRef = promiseReference();
|
|
15374
|
+
if (isFulfillingTask) {
|
|
15375
|
+
requestTasksQueue.push([
|
|
15376
|
+
parallelIndex,
|
|
15377
|
+
promiseRef
|
|
15378
|
+
]);
|
|
15524
15379
|
} else {
|
|
15525
|
-
|
|
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
|
-
];
|
|
15380
|
+
void fulfillRequestMoreTasks(parallelIndex, promiseRef);
|
|
15542
15381
|
}
|
|
15382
|
+
return [
|
|
15383
|
+
2,
|
|
15384
|
+
promiseRef.promise
|
|
15385
|
+
];
|
|
15543
15386
|
});
|
|
15544
15387
|
})();
|
|
15545
15388
|
};
|
|
@@ -15874,11 +15717,7 @@ function _object_spread$4(target) {
|
|
|
15874
15717
|
currentCount = count + increasedExecutions;
|
|
15875
15718
|
timeOfLastExecution = new Date();
|
|
15876
15719
|
}
|
|
15877
|
-
|
|
15878
|
-
return config.maxWaitTime;
|
|
15879
|
-
} else {
|
|
15880
|
-
return (Math.pow(config.exponentRate, Math.max(effectiveCount, 0)) - 1) * MS_IN_SECOND;
|
|
15881
|
-
}
|
|
15720
|
+
return effectiveCount >= countForMaxWaitTime ? config.maxWaitTime : (Math.pow(config.exponentRate, Math.max(effectiveCount, 0)) - 1) * MS_IN_SECOND;
|
|
15882
15721
|
}
|
|
15883
15722
|
function getNextWaitTime(increase) {
|
|
15884
15723
|
return _nextWaitTime(increase !== null && increase !== void 0 ? increase : 0);
|
|
@@ -16825,11 +16664,7 @@ function _is_native_reflect_construct$2() {
|
|
|
16825
16664
|
* @returns a Date representing the estimated end time, or null if no duration remains
|
|
16826
16665
|
*/ function approximateTimerEndDate(timer) {
|
|
16827
16666
|
var durationRemaining = timer.durationRemaining;
|
|
16828
|
-
|
|
16829
|
-
return new Date(Date.now() + durationRemaining);
|
|
16830
|
-
} else {
|
|
16831
|
-
return null;
|
|
16832
|
-
}
|
|
16667
|
+
return durationRemaining != null ? new Date(Date.now() + durationRemaining) : null;
|
|
16833
16668
|
}
|
|
16834
16669
|
|
|
16835
16670
|
/**
|
|
@@ -17097,6 +16932,10 @@ function _unsupported_iterable_to_array$7(o, minLen) {
|
|
|
17097
16932
|
// check self
|
|
17098
16933
|
if (a === b) {
|
|
17099
16934
|
result = true;
|
|
16935
|
+
} else if (isDate(a) || isDate(b)) {
|
|
16936
|
+
// Check Date before applying the pojoFilter — the spread copy in
|
|
16937
|
+
// filterFromPOJOFunction destroys Date instances (producing {}).
|
|
16938
|
+
result = isDate(a) && isDate(b) && isEqualDate(a, b);
|
|
17100
16939
|
} else {
|
|
17101
16940
|
// run pojo filter before comparison
|
|
17102
16941
|
a = pojoFilter(a, true);
|
|
@@ -17846,11 +17685,7 @@ function _object_spread$2(target) {
|
|
|
17846
17685
|
* @param config - The host and port configuration, or null/undefined
|
|
17847
17686
|
* @returns The joined string, or null/undefined if config is null/undefined
|
|
17848
17687
|
*/ function joinHostAndPort(config) {
|
|
17849
|
-
|
|
17850
|
-
return "".concat(config.host, ":").concat(config.port);
|
|
17851
|
-
} else {
|
|
17852
|
-
return config;
|
|
17853
|
-
}
|
|
17688
|
+
return config ? "".concat(config.host, ":").concat(config.port) : config;
|
|
17854
17689
|
}
|
|
17855
17690
|
|
|
17856
17691
|
function _array_like_to_array$4(arr, len) {
|
|
@@ -17964,9 +17799,8 @@ function _unsupported_iterable_to_array$4(o, minLen) {
|
|
|
17964
17799
|
var _separateValues1 = separateValues(mods, mask), modModify = _separateValues1.included;
|
|
17965
17800
|
var modifiedResults = this._modifyCollectionWithoutMask(currentModify, change, modModify, config);
|
|
17966
17801
|
return this._mergeMaskResults(current, currentRetain, modifiedResults, readKey);
|
|
17967
|
-
} else {
|
|
17968
|
-
return this._modifyCollectionWithoutMask(current, change, mods, config);
|
|
17969
17802
|
}
|
|
17803
|
+
return this._modifyCollectionWithoutMask(current, change, mods, config);
|
|
17970
17804
|
}
|
|
17971
17805
|
},
|
|
17972
17806
|
{
|
|
@@ -18090,11 +17924,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
|
|
|
18090
17924
|
* @returns the modified collection with all changes applied
|
|
18091
17925
|
*/ // eslint-disable-next-line @typescript-eslint/max-params
|
|
18092
17926
|
function _modifyCollection(current, mods, modifyCollection, readType) {
|
|
18093
|
-
|
|
18094
|
-
return ModelRelationUtility._modifyMultiTypeCollection(current, mods, readType, modifyCollection);
|
|
18095
|
-
} else {
|
|
18096
|
-
return modifyCollection(current, mods);
|
|
18097
|
-
}
|
|
17927
|
+
return readType ? ModelRelationUtility._modifyMultiTypeCollection(current, mods, readType, modifyCollection) : modifyCollection(current, mods);
|
|
18098
17928
|
}
|
|
18099
17929
|
},
|
|
18100
17930
|
{
|
|
@@ -18110,11 +17940,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
|
|
|
18110
17940
|
var values = (_inputMap_get = inputMap.get(type)) !== null && _inputMap_get !== void 0 ? _inputMap_get : [];
|
|
18111
17941
|
var _$mods = (_modsMap_get = modsMap.get(type)) !== null && _modsMap_get !== void 0 ? _modsMap_get : [];
|
|
18112
17942
|
// Only modify if they've got changes for their type.
|
|
18113
|
-
|
|
18114
|
-
return values; // No mods, no change to those types.
|
|
18115
|
-
} else {
|
|
18116
|
-
return modifyCollection(values, _$mods);
|
|
18117
|
-
}
|
|
17943
|
+
return _$mods.length === 0 ? values : modifyCollection(values, _$mods);
|
|
18118
17944
|
});
|
|
18119
17945
|
// Rejoin all changes.
|
|
18120
17946
|
return modifiedSubcollections.reduce(function(x, y) {
|
|
@@ -18189,28 +18015,26 @@ function _unsupported_iterable_to_array$4(o, minLen) {
|
|
|
18189
18015
|
* @returns The collection with matching items removed.
|
|
18190
18016
|
*/ // eslint-disable-next-line @typescript-eslint/max-params
|
|
18191
18017
|
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 {
|
|
18018
|
+
if (!(current === null || current === void 0 ? void 0 : current.length)) {
|
|
18212
18019
|
return [];
|
|
18213
18020
|
}
|
|
18021
|
+
if (shouldRemove) {
|
|
18022
|
+
var currentKeyPairs = makeKeyPairs(current, readKey);
|
|
18023
|
+
var map = new Map(currentKeyPairs);
|
|
18024
|
+
remove.forEach(function(x) {
|
|
18025
|
+
var key = readKey(x);
|
|
18026
|
+
var removalTarget = map.get(key);
|
|
18027
|
+
if (removalTarget && shouldRemove(removalTarget)) {
|
|
18028
|
+
map.delete(key); // Remove from the map.
|
|
18029
|
+
}
|
|
18030
|
+
});
|
|
18031
|
+
return currentKeyPairs.filter(function(x) {
|
|
18032
|
+
return map.has(x[0]);
|
|
18033
|
+
}).map(function(x) {
|
|
18034
|
+
return x[1];
|
|
18035
|
+
}); // Retain order, remove from map.
|
|
18036
|
+
}
|
|
18037
|
+
return ModelRelationUtility.removeKeysFromCollection(current, remove.map(readKey), readKey);
|
|
18214
18038
|
}
|
|
18215
18039
|
},
|
|
18216
18040
|
{
|
|
@@ -19425,11 +19249,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
19425
19249
|
var separator = config.separator, mergeMeta = config.mergeMeta;
|
|
19426
19250
|
var value = inputValue.value, leafMeta = inputValue.leafMeta, nodeMeta = inputValue.nodeMeta;
|
|
19427
19251
|
function nextMeta(node, nextMeta) {
|
|
19428
|
-
|
|
19429
|
-
return mergeMeta(node.meta, nextMeta);
|
|
19430
|
-
} else {
|
|
19431
|
-
return nextMeta;
|
|
19432
|
-
}
|
|
19252
|
+
return mergeMeta && node.meta != null ? mergeMeta(node.meta, nextMeta) : nextMeta;
|
|
19433
19253
|
}
|
|
19434
19254
|
var parts = value.split(separator);
|
|
19435
19255
|
var currentNode = tree;
|
|
@@ -19957,13 +19777,9 @@ function invertMaybeBoolean(x) {
|
|
|
19957
19777
|
var rFn = function rFn(array) {
|
|
19958
19778
|
return Boolean(array.reduce(reduceFn));
|
|
19959
19779
|
};
|
|
19960
|
-
|
|
19961
|
-
return
|
|
19962
|
-
|
|
19963
|
-
};
|
|
19964
|
-
} else {
|
|
19965
|
-
return rFn;
|
|
19966
|
-
}
|
|
19780
|
+
return emptyArrayValue != null ? function(array) {
|
|
19781
|
+
return array.length ? rFn(array) : emptyArrayValue;
|
|
19782
|
+
} : rFn;
|
|
19967
19783
|
}
|
|
19968
19784
|
/**
|
|
19969
19785
|
* Creates a new BooleanFactory that generates random boolean values based on chance.
|