@dereekb/util 13.10.0 → 13.10.1
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 +4 -2
- package/fetch/index.esm.js +4 -2
- package/fetch/package.json +3 -3
- package/index.cjs.js +191 -60
- package/index.esm.js +189 -60
- package/package.json +5 -5
- package/src/lib/function/function.d.ts +1 -1
- package/src/lib/object/object.filter.pojo.d.ts +10 -0
- package/src/lib/string/mimetype.d.ts +1 -1
- package/src/lib/string/url.d.ts +3 -1
- package/test/index.cjs.js +1 -0
- package/test/index.esm.js +1 -0
- package/test/package.json +3 -3
package/fetch/index.cjs.js
CHANGED
|
@@ -332,6 +332,7 @@ function _define_property$3(obj, key, value) {
|
|
|
332
332
|
return obj;
|
|
333
333
|
}
|
|
334
334
|
function _instanceof$1(left, right) {
|
|
335
|
+
"@swc/helpers - instanceof";
|
|
335
336
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
336
337
|
return !!right[Symbol.hasInstance](left);
|
|
337
338
|
} else {
|
|
@@ -2285,7 +2286,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2285
2286
|
*/ function makeUrlSearchParamsString(input, options) {
|
|
2286
2287
|
var params = makeUrlSearchParams(input, options);
|
|
2287
2288
|
var str = params.toString();
|
|
2288
|
-
return (options === null || options === void 0 ? void 0 : options.useUrlSearchSpaceHandling) ? str.
|
|
2289
|
+
return (options === null || options === void 0 ? void 0 : options.useUrlSearchSpaceHandling) ? str.replaceAll('+', '%20') : str;
|
|
2289
2290
|
}
|
|
2290
2291
|
/**
|
|
2291
2292
|
* Updates or adds query parameters on an existing URL string.
|
|
@@ -2347,7 +2348,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2347
2348
|
}
|
|
2348
2349
|
var queryString = existingParams.toString();
|
|
2349
2350
|
if (options === null || options === void 0 ? void 0 : options.useUrlSearchSpaceHandling) {
|
|
2350
|
-
queryString = queryString.
|
|
2351
|
+
queryString = queryString.replaceAll('+', '%20');
|
|
2351
2352
|
}
|
|
2352
2353
|
return queryString ? "".concat(basePath, "?").concat(queryString) : basePath;
|
|
2353
2354
|
}
|
|
@@ -2379,6 +2380,7 @@ function _array_with_holes(arr) {
|
|
|
2379
2380
|
if (Array.isArray(arr)) return arr;
|
|
2380
2381
|
}
|
|
2381
2382
|
function _instanceof(left, right) {
|
|
2383
|
+
"@swc/helpers - instanceof";
|
|
2382
2384
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
2383
2385
|
return !!right[Symbol.hasInstance](left);
|
|
2384
2386
|
} else {
|
package/fetch/index.esm.js
CHANGED
|
@@ -330,6 +330,7 @@ function _define_property$3(obj, key, value) {
|
|
|
330
330
|
return obj;
|
|
331
331
|
}
|
|
332
332
|
function _instanceof$1(left, right) {
|
|
333
|
+
"@swc/helpers - instanceof";
|
|
333
334
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
334
335
|
return !!right[Symbol.hasInstance](left);
|
|
335
336
|
} else {
|
|
@@ -2283,7 +2284,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2283
2284
|
*/ function makeUrlSearchParamsString(input, options) {
|
|
2284
2285
|
var params = makeUrlSearchParams(input, options);
|
|
2285
2286
|
var str = params.toString();
|
|
2286
|
-
return (options === null || options === void 0 ? void 0 : options.useUrlSearchSpaceHandling) ? str.
|
|
2287
|
+
return (options === null || options === void 0 ? void 0 : options.useUrlSearchSpaceHandling) ? str.replaceAll('+', '%20') : str;
|
|
2287
2288
|
}
|
|
2288
2289
|
/**
|
|
2289
2290
|
* Updates or adds query parameters on an existing URL string.
|
|
@@ -2345,7 +2346,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2345
2346
|
}
|
|
2346
2347
|
var queryString = existingParams.toString();
|
|
2347
2348
|
if (options === null || options === void 0 ? void 0 : options.useUrlSearchSpaceHandling) {
|
|
2348
|
-
queryString = queryString.
|
|
2349
|
+
queryString = queryString.replaceAll('+', '%20');
|
|
2349
2350
|
}
|
|
2350
2351
|
return queryString ? "".concat(basePath, "?").concat(queryString) : basePath;
|
|
2351
2352
|
}
|
|
@@ -2377,6 +2378,7 @@ function _array_with_holes(arr) {
|
|
|
2377
2378
|
if (Array.isArray(arr)) return arr;
|
|
2378
2379
|
}
|
|
2379
2380
|
function _instanceof(left, right) {
|
|
2381
|
+
"@swc/helpers - instanceof";
|
|
2380
2382
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
2381
2383
|
return !!right[Symbol.hasInstance](left);
|
|
2382
2384
|
} else {
|
package/fetch/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/fetch",
|
|
3
|
-
"version": "13.10.
|
|
3
|
+
"version": "13.10.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/util": "13.10.
|
|
6
|
-
"make-error": "^1.3.
|
|
5
|
+
"@dereekb/util": "13.10.1",
|
|
6
|
+
"make-error": "^1.3.6",
|
|
7
7
|
"fast-content-type-parse": "^3.0.0"
|
|
8
8
|
},
|
|
9
9
|
"exports": {
|
package/index.cjs.js
CHANGED
|
@@ -462,7 +462,7 @@ function _unsupported_iterable_to_array$A(o, minLen) {
|
|
|
462
462
|
* @param input - single value or array to retrieve from
|
|
463
463
|
* @returns the last element of the array, or the input value itself
|
|
464
464
|
*/ function lastValue(input) {
|
|
465
|
-
return Array.isArray(input) ? input
|
|
465
|
+
return Array.isArray(input) ? input.at(-1) : input;
|
|
466
466
|
}
|
|
467
467
|
/**
|
|
468
468
|
* Returns a tuple with the first and last value of the input.
|
|
@@ -497,9 +497,7 @@ function _unsupported_iterable_to_array$A(o, minLen) {
|
|
|
497
497
|
for(var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++){
|
|
498
498
|
arrays[_key] = arguments[_key];
|
|
499
499
|
}
|
|
500
|
-
return flattenArray(arrays.filter(
|
|
501
|
-
return Boolean(x);
|
|
502
|
-
}));
|
|
500
|
+
return flattenArray(arrays.filter(Boolean));
|
|
503
501
|
}
|
|
504
502
|
/**
|
|
505
503
|
* Flattens a two-dimensional array into a single-dimensional array. Any null/undefined entries in the outer dimension are filtered out.
|
|
@@ -507,9 +505,7 @@ function _unsupported_iterable_to_array$A(o, minLen) {
|
|
|
507
505
|
* @param array - two-dimensional array to flatten, may contain nullish entries
|
|
508
506
|
* @returns a single-dimensional array with all elements from the non-nullish inner arrays
|
|
509
507
|
*/ function flattenArray(array) {
|
|
510
|
-
var filteredValues = array.filter(
|
|
511
|
-
return Boolean(x);
|
|
512
|
-
});
|
|
508
|
+
var filteredValues = array.filter(Boolean);
|
|
513
509
|
return filteredValues.flat();
|
|
514
510
|
}
|
|
515
511
|
/**
|
|
@@ -1339,7 +1335,9 @@ function _unsupported_iterable_to_array$y(o, minLen) {
|
|
|
1339
1335
|
*/ function arrayDecisionFunction(decision, mode) {
|
|
1340
1336
|
var findFn = mode === 'all' ? invertBooleanReturnFunction(decision) : decision;
|
|
1341
1337
|
return invertBooleanReturnFunction(function(values) {
|
|
1342
|
-
return values.some(
|
|
1338
|
+
return values.some(function(v, i, arr) {
|
|
1339
|
+
return findFn(v, i, arr);
|
|
1340
|
+
});
|
|
1343
1341
|
}, mode === 'all');
|
|
1344
1342
|
}
|
|
1345
1343
|
/**
|
|
@@ -1583,7 +1581,9 @@ function _type_of$l(obj) {
|
|
|
1583
1581
|
return function(values) {
|
|
1584
1582
|
var result;
|
|
1585
1583
|
if (values != null) {
|
|
1586
|
-
result = values.filter(
|
|
1584
|
+
result = values.filter(function(v, i, arr) {
|
|
1585
|
+
return filterFn(v, i, arr);
|
|
1586
|
+
});
|
|
1587
1587
|
} else {
|
|
1588
1588
|
result = [];
|
|
1589
1589
|
}
|
|
@@ -2356,7 +2356,7 @@ function _unsupported_iterable_to_array$w(o, minLen) {
|
|
|
2356
2356
|
/**
|
|
2357
2357
|
* Utility for working with boolean string key arrays.
|
|
2358
2358
|
*/ var BooleanStringKeyArrayUtility = booleanKeyArrayUtility(function(x) {
|
|
2359
|
-
return x
|
|
2359
|
+
return x || undefined;
|
|
2360
2360
|
});
|
|
2361
2361
|
|
|
2362
2362
|
function _array_like_to_array$v(arr, len) {
|
|
@@ -3950,7 +3950,7 @@ function _type_of$h(obj) {
|
|
|
3950
3950
|
return fn;
|
|
3951
3951
|
}
|
|
3952
3952
|
|
|
3953
|
-
var DOLLAR_AMOUNT_STRING_REGEX = /^\$?(
|
|
3953
|
+
var DOLLAR_AMOUNT_STRING_REGEX = /^\$?(\d+)\.?(\d\d)$/;
|
|
3954
3954
|
/**
|
|
3955
3955
|
* Dollar amounts are to two decimal places.
|
|
3956
3956
|
*/ var DOLLAR_AMOUNT_PRECISION = 2;
|
|
@@ -4118,7 +4118,7 @@ var DOLLAR_AMOUNT_STRING_REGEX = /^\$?([0-9]+)\.?([0-9][0-9])$/;
|
|
|
4118
4118
|
* decodeRadix36Number('2s'); // 100
|
|
4119
4119
|
* ```
|
|
4120
4120
|
*/ function decodeRadix36Number(encoded) {
|
|
4121
|
-
return parseInt(encoded, 36);
|
|
4121
|
+
return Number.parseInt(encoded, 36);
|
|
4122
4122
|
}
|
|
4123
4123
|
/**
|
|
4124
4124
|
* Pattern that matches strings containing only hexadecimal characters (0-9, a-f, A-F).
|
|
@@ -4231,7 +4231,9 @@ var DOLLAR_AMOUNT_STRING_REGEX = /^\$?([0-9]+)\.?([0-9][0-9])$/;
|
|
|
4231
4231
|
}
|
|
4232
4232
|
function reduceNumbersFn(reduceFn, emptyArrayValue) {
|
|
4233
4233
|
var rFn = function rFn(array) {
|
|
4234
|
-
return array.reduce(
|
|
4234
|
+
return array.reduce(function(a, b) {
|
|
4235
|
+
return reduceFn(a, b);
|
|
4236
|
+
});
|
|
4235
4237
|
};
|
|
4236
4238
|
return function(array) {
|
|
4237
4239
|
return array.length ? rFn(array) : emptyArrayValue;
|
|
@@ -5093,7 +5095,9 @@ function findNext(array, find) {
|
|
|
5093
5095
|
var wrapAround = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, steps = arguments.length > 3 ? arguments[3] : void 0;
|
|
5094
5096
|
var result;
|
|
5095
5097
|
if (array) {
|
|
5096
|
-
var index = array.findIndex(
|
|
5098
|
+
var index = array.findIndex(function(v, i, arr) {
|
|
5099
|
+
return find(v, i, arr);
|
|
5100
|
+
});
|
|
5097
5101
|
var nextIndex = getArrayNextIndex(array, index, wrapAround, steps);
|
|
5098
5102
|
if (nextIndex != null) {
|
|
5099
5103
|
result = array[nextIndex];
|
|
@@ -5503,7 +5507,10 @@ function caseInsensitiveString(input) {
|
|
|
5503
5507
|
* @returns the prefixed string, or undefined if the input is null/undefined
|
|
5504
5508
|
*/ function addPlusPrefixToNumber(value) {
|
|
5505
5509
|
var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '+';
|
|
5506
|
-
|
|
5510
|
+
if (value == null) {
|
|
5511
|
+
return undefined;
|
|
5512
|
+
}
|
|
5513
|
+
return value > 0 ? "".concat(prefix).concat(value) : "".concat(value);
|
|
5507
5514
|
}
|
|
5508
5515
|
/**
|
|
5509
5516
|
* Capitalizes the first letter of the input string.
|
|
@@ -5589,7 +5596,7 @@ function caseInsensitiveString(input) {
|
|
|
5589
5596
|
* @param input - string to flatten
|
|
5590
5597
|
* @returns the string with collapsed whitespace
|
|
5591
5598
|
*/ function flattenWhitespace(input) {
|
|
5592
|
-
return input.
|
|
5599
|
+
return input.replaceAll(/[^\S\r\n]+/g, ' ').trim();
|
|
5593
5600
|
}
|
|
5594
5601
|
/**
|
|
5595
5602
|
* Reduces multiple consecutive newlines to a single newline and collapses multiple whitespace characters to a single space.
|
|
@@ -6004,7 +6011,7 @@ function _get_prototype_of$4(o) {
|
|
|
6004
6011
|
};
|
|
6005
6012
|
return _get_prototype_of$4(o);
|
|
6006
6013
|
}
|
|
6007
|
-
function _inherits$
|
|
6014
|
+
function _inherits$5(subClass, superClass) {
|
|
6008
6015
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
6009
6016
|
throw new TypeError("Super expression must either be null or a function");
|
|
6010
6017
|
}
|
|
@@ -6015,7 +6022,7 @@ function _inherits$4(subClass, superClass) {
|
|
|
6015
6022
|
configurable: true
|
|
6016
6023
|
}
|
|
6017
6024
|
});
|
|
6018
|
-
if (superClass) _set_prototype_of$
|
|
6025
|
+
if (superClass) _set_prototype_of$5(subClass, superClass);
|
|
6019
6026
|
}
|
|
6020
6027
|
function _possible_constructor_return$4(self, call) {
|
|
6021
6028
|
if (call && (_type_of$g(call) === "object" || typeof call === "function")) {
|
|
@@ -6023,12 +6030,12 @@ function _possible_constructor_return$4(self, call) {
|
|
|
6023
6030
|
}
|
|
6024
6031
|
return _assert_this_initialized$4(self);
|
|
6025
6032
|
}
|
|
6026
|
-
function _set_prototype_of$
|
|
6027
|
-
_set_prototype_of$
|
|
6033
|
+
function _set_prototype_of$5(o, p) {
|
|
6034
|
+
_set_prototype_of$5 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
6028
6035
|
o.__proto__ = p;
|
|
6029
6036
|
return o;
|
|
6030
6037
|
};
|
|
6031
|
-
return _set_prototype_of$
|
|
6038
|
+
return _set_prototype_of$5(o, p);
|
|
6032
6039
|
}
|
|
6033
6040
|
function _type_of$g(obj) {
|
|
6034
6041
|
"@swc/helpers - typeof";
|
|
@@ -6049,7 +6056,7 @@ function _is_native_reflect_construct$4() {
|
|
|
6049
6056
|
* Error thrown when an assertion fails.
|
|
6050
6057
|
* Extends BaseError and implements ReadableError interface.
|
|
6051
6058
|
*/ var AssertionError = /*#__PURE__*/ function(BaseError) {
|
|
6052
|
-
_inherits$
|
|
6059
|
+
_inherits$5(AssertionError, BaseError);
|
|
6053
6060
|
function AssertionError(error, message) {
|
|
6054
6061
|
_class_call_check$9(this, AssertionError);
|
|
6055
6062
|
var _this;
|
|
@@ -6438,7 +6445,9 @@ function _unsupported_iterable_to_array$r(o, minLen) {
|
|
|
6438
6445
|
*/ function forEachKeyValue(obj, param) {
|
|
6439
6446
|
var forEach = param.forEach, filter = param.filter;
|
|
6440
6447
|
var keyValues = filterKeyValueTuples(obj, filter);
|
|
6441
|
-
keyValues.forEach(
|
|
6448
|
+
keyValues.forEach(function(kv, i) {
|
|
6449
|
+
return forEach(kv, i);
|
|
6450
|
+
});
|
|
6442
6451
|
}
|
|
6443
6452
|
/**
|
|
6444
6453
|
* Extracts key/value tuples from an object, optionally filtering them.
|
|
@@ -6474,7 +6483,9 @@ function _unsupported_iterable_to_array$r(o, minLen) {
|
|
|
6474
6483
|
if (filter != null) {
|
|
6475
6484
|
var filterFn = filterKeyValueTupleFunction(filter);
|
|
6476
6485
|
result = function result(obj) {
|
|
6477
|
-
return allKeyValueTuples(obj).filter(
|
|
6486
|
+
return allKeyValueTuples(obj).filter(function(kv, i) {
|
|
6487
|
+
return filterFn(kv, i);
|
|
6488
|
+
});
|
|
6478
6489
|
};
|
|
6479
6490
|
} else {
|
|
6480
6491
|
result = allKeyValueTuples;
|
|
@@ -6762,6 +6773,27 @@ function _unsupported_iterable_to_array$q(o, minLen) {
|
|
|
6762
6773
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
6763
6774
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$q(o, minLen);
|
|
6764
6775
|
}
|
|
6776
|
+
/**
|
|
6777
|
+
*
|
|
6778
|
+
* @param input
|
|
6779
|
+
*/ function stripObjectFunction(filter) {
|
|
6780
|
+
var copy = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
6781
|
+
var filterFn = filterFromPOJOFunction({
|
|
6782
|
+
filter: filter,
|
|
6783
|
+
copy: copy
|
|
6784
|
+
});
|
|
6785
|
+
return function(input, copyOverride) {
|
|
6786
|
+
var result;
|
|
6787
|
+
if (input != null) {
|
|
6788
|
+
var filtered = filterFn(input, copyOverride);
|
|
6789
|
+
result = objectHasNoKeys(filtered) ? undefined : filtered;
|
|
6790
|
+
}
|
|
6791
|
+
return result;
|
|
6792
|
+
};
|
|
6793
|
+
}
|
|
6794
|
+
function stripObject(input, copy) {
|
|
6795
|
+
return stripObjectFunction(exports.KeyValueTypleValueFilter.UNDEFINED, copy)(input);
|
|
6796
|
+
}
|
|
6765
6797
|
// MARK: Object Merging/Overriding
|
|
6766
6798
|
/**
|
|
6767
6799
|
* Assigns all non-filtered values from one or more source objects into the target object.
|
|
@@ -7377,7 +7409,9 @@ function _unsupported_iterable_to_array$q(o, minLen) {
|
|
|
7377
7409
|
*/ function filterTuplesOnPOJOFunction(filterTupleOnObject) {
|
|
7378
7410
|
return function(input) {
|
|
7379
7411
|
var result = {};
|
|
7380
|
-
Object.entries(input).filter(
|
|
7412
|
+
Object.entries(input).filter(function(tuple, i, arr) {
|
|
7413
|
+
return filterTupleOnObject(tuple, i, arr);
|
|
7414
|
+
}).forEach(function(tuple) {
|
|
7381
7415
|
result[tuple[0]] = tuple[1];
|
|
7382
7416
|
});
|
|
7383
7417
|
return result;
|
|
@@ -7976,6 +8010,7 @@ function _array_without_holes$d(arr) {
|
|
|
7976
8010
|
if (Array.isArray(arr)) return _array_like_to_array$n(arr);
|
|
7977
8011
|
}
|
|
7978
8012
|
function _instanceof$3(left, right) {
|
|
8013
|
+
"@swc/helpers - instanceof";
|
|
7979
8014
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
7980
8015
|
return !!right[Symbol.hasInstance](left);
|
|
7981
8016
|
} else {
|
|
@@ -8374,7 +8409,7 @@ function _unsupported_iterable_to_array$n(o, minLen) {
|
|
|
8374
8409
|
* ```
|
|
8375
8410
|
*/ function tryConvertToE164PhoneNumber(input) {
|
|
8376
8411
|
var defaultCountryCode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '1';
|
|
8377
|
-
var stripped = input.
|
|
8412
|
+
var stripped = input.replaceAll(PHONE_NUMBER_FORMATTING_CHARACTERS_REGEX, '');
|
|
8378
8413
|
var result;
|
|
8379
8414
|
if (isE164PhoneNumber(stripped, false)) {
|
|
8380
8415
|
result = stripped;
|
|
@@ -8557,7 +8592,7 @@ var DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS = [
|
|
|
8557
8592
|
if (input.length === 0) {
|
|
8558
8593
|
type = 'invalid';
|
|
8559
8594
|
} else {
|
|
8560
|
-
var lastValue = input
|
|
8595
|
+
var lastValue = input.at(-1);
|
|
8561
8596
|
if (lastValue === SLASH_PATH_SEPARATOR) {
|
|
8562
8597
|
type = 'folder';
|
|
8563
8598
|
} else {
|
|
@@ -8623,9 +8658,7 @@ var DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS = [
|
|
|
8623
8658
|
* @param slashPath - The path to split.
|
|
8624
8659
|
* @returns Array of non-empty path segments.
|
|
8625
8660
|
*/ function slashPathParts(slashPath) {
|
|
8626
|
-
return slashPath.split(SLASH_PATH_SEPARATOR).filter(
|
|
8627
|
-
return Boolean(x);
|
|
8628
|
-
});
|
|
8661
|
+
return slashPath.split(SLASH_PATH_SEPARATOR).filter(Boolean);
|
|
8629
8662
|
}
|
|
8630
8663
|
/**
|
|
8631
8664
|
* Creates a function that enforces the specified start type on a slash path.
|
|
@@ -8741,7 +8774,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
|
|
|
8741
8774
|
* @param input - The slash path to fix.
|
|
8742
8775
|
* @returns The path with double slashes collapsed.
|
|
8743
8776
|
*/ function fixMultiSlashesInSlashPath(input) {
|
|
8744
|
-
return input.
|
|
8777
|
+
return input.replaceAll(ALL_DOUBLE_SLASHES_REGEX, SLASH_PATH_SEPARATOR);
|
|
8745
8778
|
}
|
|
8746
8779
|
/**
|
|
8747
8780
|
* Replaces consecutive double slashes with single slashes. Alias for {@link fixMultiSlashesInSlashPath}.
|
|
@@ -8749,7 +8782,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
|
|
|
8749
8782
|
* @param input - The slash path to fix.
|
|
8750
8783
|
* @returns The path with double slashes collapsed.
|
|
8751
8784
|
*/ function replaceMultipleFilePathsInSlashPath(input) {
|
|
8752
|
-
return input.
|
|
8785
|
+
return input.replaceAll(ALL_DOUBLE_SLASHES_REGEX, SLASH_PATH_SEPARATOR);
|
|
8753
8786
|
}
|
|
8754
8787
|
/**
|
|
8755
8788
|
* Removes all trailing slashes from a slash path.
|
|
@@ -8793,7 +8826,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
|
|
|
8793
8826
|
*/ function replaceInvalidFilePathTypeSeparatorsInSlashPathFunction() {
|
|
8794
8827
|
var replaceWith = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT;
|
|
8795
8828
|
return function(input) {
|
|
8796
|
-
var endsOnFileTypeSeparator = input
|
|
8829
|
+
var endsOnFileTypeSeparator = input.at(-1) === SLASH_PATH_FILE_TYPE_SEPARATOR;
|
|
8797
8830
|
var inputToEvaluate = endsOnFileTypeSeparator ? removeTrailingFileTypeSeparators(input) : input;
|
|
8798
8831
|
var _firstAndLastCharacterOccurrence = firstAndLastCharacterOccurrence(inputToEvaluate, SLASH_PATH_FILE_TYPE_SEPARATOR); _firstAndLastCharacterOccurrence.first; var last = _firstAndLastCharacterOccurrence.last, occurences = _firstAndLastCharacterOccurrence.occurences;
|
|
8799
8832
|
var fixedPath;
|
|
@@ -8816,7 +8849,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
|
|
|
8816
8849
|
default:
|
|
8817
8850
|
{
|
|
8818
8851
|
var _splitStringAtIndex = _sliced_to_array$e(splitStringAtIndex(inputToEvaluate, last, true), 2), head = _splitStringAtIndex[0], tail = _splitStringAtIndex[1];
|
|
8819
|
-
var headWithReplacedSeparators = head.
|
|
8852
|
+
var headWithReplacedSeparators = head.replaceAll(ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX, replaceWith);
|
|
8820
8853
|
fixedPath = headWithReplacedSeparators + tail;
|
|
8821
8854
|
break;
|
|
8822
8855
|
}
|
|
@@ -8948,7 +8981,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
|
|
|
8948
8981
|
if (pathStartsWithSlash) {
|
|
8949
8982
|
folderPath = SLASH_PATH_SEPARATOR + folderPath;
|
|
8950
8983
|
}
|
|
8951
|
-
fileFolder = folderPathParts
|
|
8984
|
+
fileFolder = folderPathParts.at(-1);
|
|
8952
8985
|
} else {
|
|
8953
8986
|
folderPath = path;
|
|
8954
8987
|
fileFolder = undefined;
|
|
@@ -9208,8 +9241,10 @@ function _unsupported_iterable_to_array$l(o, minLen) {
|
|
|
9208
9241
|
return input === 'http' || input === 'https';
|
|
9209
9242
|
}
|
|
9210
9243
|
/**
|
|
9211
|
-
* Simple website domain regex that looks for a period in the string between the domain and the tld
|
|
9212
|
-
|
|
9244
|
+
* Simple website domain regex that looks for a period in the string between the domain and the tld.
|
|
9245
|
+
*
|
|
9246
|
+
* Anchored character-class form prevents catastrophic backtracking on inputs without a period.
|
|
9247
|
+
*/ var HAS_WEBSITE_DOMAIN_NAME_REGEX = /^[^.]+\.[^.]/;
|
|
9213
9248
|
/**
|
|
9214
9249
|
* Returns true if the input probably contains a website domain (has at least one period separating parts).
|
|
9215
9250
|
*
|
|
@@ -9223,7 +9258,8 @@ function _unsupported_iterable_to_array$l(o, minLen) {
|
|
|
9223
9258
|
* @param input - The string to check for a domain.
|
|
9224
9259
|
* @returns Whether the input appears to contain a website domain.
|
|
9225
9260
|
*/ function hasWebsiteDomain(input) {
|
|
9226
|
-
|
|
9261
|
+
var dotIndex = input.indexOf('.');
|
|
9262
|
+
return dotIndex > 0 && dotIndex < input.length - 1;
|
|
9227
9263
|
}
|
|
9228
9264
|
/**
|
|
9229
9265
|
* This Regex is really only reliable for detecting that the TLD exists, but due to the nature of tld's
|
|
@@ -9615,7 +9651,7 @@ function _unsupported_iterable_to_array$l(o, minLen) {
|
|
|
9615
9651
|
* @returns The extracted domain
|
|
9616
9652
|
*/ function readEmailDomainFromUrlOrEmailAddress(urlLikeInput) {
|
|
9617
9653
|
var emailSplit = urlLikeInput.split('@');
|
|
9618
|
-
var url = emailSplit
|
|
9654
|
+
var url = emailSplit.at(-1);
|
|
9619
9655
|
var domain;
|
|
9620
9656
|
if (emailSplit.length > 1) {
|
|
9621
9657
|
domain = url;
|
|
@@ -9806,7 +9842,7 @@ function _get_prototype_of$3(o) {
|
|
|
9806
9842
|
};
|
|
9807
9843
|
return _get_prototype_of$3(o);
|
|
9808
9844
|
}
|
|
9809
|
-
function _inherits$
|
|
9845
|
+
function _inherits$4(subClass, superClass) {
|
|
9810
9846
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
9811
9847
|
throw new TypeError("Super expression must either be null or a function");
|
|
9812
9848
|
}
|
|
@@ -9817,7 +9853,7 @@ function _inherits$3(subClass, superClass) {
|
|
|
9817
9853
|
configurable: true
|
|
9818
9854
|
}
|
|
9819
9855
|
});
|
|
9820
|
-
if (superClass) _set_prototype_of$
|
|
9856
|
+
if (superClass) _set_prototype_of$4(subClass, superClass);
|
|
9821
9857
|
}
|
|
9822
9858
|
function _object_spread$b(target) {
|
|
9823
9859
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -9859,12 +9895,12 @@ function _possible_constructor_return$3(self, call) {
|
|
|
9859
9895
|
}
|
|
9860
9896
|
return _assert_this_initialized$3(self);
|
|
9861
9897
|
}
|
|
9862
|
-
function _set_prototype_of$
|
|
9863
|
-
_set_prototype_of$
|
|
9898
|
+
function _set_prototype_of$4(o, p) {
|
|
9899
|
+
_set_prototype_of$4 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9864
9900
|
o.__proto__ = p;
|
|
9865
9901
|
return o;
|
|
9866
9902
|
};
|
|
9867
|
-
return _set_prototype_of$
|
|
9903
|
+
return _set_prototype_of$4(o, p);
|
|
9868
9904
|
}
|
|
9869
9905
|
function _type_of$b(obj) {
|
|
9870
9906
|
"@swc/helpers - typeof";
|
|
@@ -9924,7 +9960,7 @@ function partialServerError(messageOrError) {
|
|
|
9924
9960
|
/**
|
|
9925
9961
|
* Server error response with a 401 Unauthorized status.
|
|
9926
9962
|
*/ var UnauthorizedServerErrorResponse = /*#__PURE__*/ function(ServerErrorResponse) {
|
|
9927
|
-
_inherits$
|
|
9963
|
+
_inherits$4(UnauthorizedServerErrorResponse, ServerErrorResponse);
|
|
9928
9964
|
function UnauthorizedServerErrorResponse(param) {
|
|
9929
9965
|
var code = param.code, data = param.data, message = param.message;
|
|
9930
9966
|
_class_call_check$7(this, UnauthorizedServerErrorResponse);
|
|
@@ -9955,6 +9991,7 @@ function _define_property$e(obj, key, value) {
|
|
|
9955
9991
|
return obj;
|
|
9956
9992
|
}
|
|
9957
9993
|
function _instanceof$2(left, right) {
|
|
9994
|
+
"@swc/helpers - instanceof";
|
|
9958
9995
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
9959
9996
|
return !!right[Symbol.hasInstance](left);
|
|
9960
9997
|
} else {
|
|
@@ -10161,12 +10198,6 @@ function _unsupported_iterable_to_array$j(o, minLen) {
|
|
|
10161
10198
|
};
|
|
10162
10199
|
}
|
|
10163
10200
|
|
|
10164
|
-
/**
|
|
10165
|
-
* Identity function that returns the input value unchanged.
|
|
10166
|
-
*
|
|
10167
|
-
* Alias of MAP_IDENTITY, so `isMapIdentityFunction()` will return true for this function.
|
|
10168
|
-
*/ var passThrough = MAP_IDENTITY;
|
|
10169
|
-
|
|
10170
10201
|
function _array_like_to_array$i(arr, len) {
|
|
10171
10202
|
if (len == null || len > arr.length) len = arr.length;
|
|
10172
10203
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -11082,10 +11113,7 @@ function _unsupported_iterable_to_array$g(o, minLen) {
|
|
|
11082
11113
|
var address;
|
|
11083
11114
|
var lineBreakLine = addLinebreaks ? '\n' : '';
|
|
11084
11115
|
var parts = [];
|
|
11085
|
-
parts.push(name);
|
|
11086
|
-
parts.push(phone);
|
|
11087
|
-
parts.push(line1);
|
|
11088
|
-
parts.push(line2);
|
|
11116
|
+
parts.push(name, phone, line1, line2);
|
|
11089
11117
|
if (city || state || zip) {
|
|
11090
11118
|
if (city && (state || zip)) {
|
|
11091
11119
|
parts.push("".concat(city, ", ").concat(state, " ").concat(zip));
|
|
@@ -11286,6 +11314,19 @@ function _define_property$c(obj, key, value) {
|
|
|
11286
11314
|
}
|
|
11287
11315
|
return obj;
|
|
11288
11316
|
}
|
|
11317
|
+
function _inherits$3(subClass, superClass) {
|
|
11318
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
11319
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
11320
|
+
}
|
|
11321
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
11322
|
+
constructor: {
|
|
11323
|
+
value: subClass,
|
|
11324
|
+
writable: true,
|
|
11325
|
+
configurable: true
|
|
11326
|
+
}
|
|
11327
|
+
});
|
|
11328
|
+
if (superClass) _set_prototype_of$3(subClass, superClass);
|
|
11329
|
+
}
|
|
11289
11330
|
function _iterable_to_array_limit$b(arr, i) {
|
|
11290
11331
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11291
11332
|
if (_i == null) return;
|
|
@@ -11347,6 +11388,13 @@ function _object_spread_props$4(target, source) {
|
|
|
11347
11388
|
}
|
|
11348
11389
|
return target;
|
|
11349
11390
|
}
|
|
11391
|
+
function _set_prototype_of$3(o, p) {
|
|
11392
|
+
_set_prototype_of$3 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
11393
|
+
o.__proto__ = p;
|
|
11394
|
+
return o;
|
|
11395
|
+
};
|
|
11396
|
+
return _set_prototype_of$3(o, p);
|
|
11397
|
+
}
|
|
11350
11398
|
function _sliced_to_array$b(arr, i) {
|
|
11351
11399
|
return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$b();
|
|
11352
11400
|
}
|
|
@@ -11362,6 +11410,80 @@ function _unsupported_iterable_to_array$f(o, minLen) {
|
|
|
11362
11410
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
11363
11411
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
|
|
11364
11412
|
}
|
|
11413
|
+
function _wrap_reg_exp(re, groups, source) {
|
|
11414
|
+
_wrap_reg_exp = function(re, groups, source) {
|
|
11415
|
+
return new WrappedRegExp(re, undefined, groups, source);
|
|
11416
|
+
};
|
|
11417
|
+
var _super = RegExp.prototype;
|
|
11418
|
+
var _groups = new WeakMap();
|
|
11419
|
+
var _sources = new WeakMap();
|
|
11420
|
+
var _native_source = Object.getOwnPropertyDescriptor(_super, "source").get;
|
|
11421
|
+
function WrappedRegExp(re, flags, groups, source) {
|
|
11422
|
+
var _re = new RegExp(re, flags);
|
|
11423
|
+
_groups.set(_re, groups || _groups.get(re));
|
|
11424
|
+
_sources.set(_re, source !== undefined ? source : _sources.get(re));
|
|
11425
|
+
return _set_prototype_of$3(_re, WrappedRegExp.prototype);
|
|
11426
|
+
}
|
|
11427
|
+
_inherits$3(WrappedRegExp, RegExp);
|
|
11428
|
+
Object.defineProperty(WrappedRegExp.prototype, "source", {
|
|
11429
|
+
configurable: true,
|
|
11430
|
+
get: function() {
|
|
11431
|
+
var source = _sources.get(this);
|
|
11432
|
+
if (source !== undefined) {
|
|
11433
|
+
try {
|
|
11434
|
+
new RegExp(source, this.flags);
|
|
11435
|
+
return source;
|
|
11436
|
+
} catch (_) {}
|
|
11437
|
+
}
|
|
11438
|
+
return _native_source.call(this);
|
|
11439
|
+
}
|
|
11440
|
+
});
|
|
11441
|
+
WrappedRegExp.prototype.exec = function(str) {
|
|
11442
|
+
var result = _super.exec.call(this, str);
|
|
11443
|
+
if (result) {
|
|
11444
|
+
result.groups = buildGroups(result, this);
|
|
11445
|
+
var indices = result.indices;
|
|
11446
|
+
if (indices) indices.groups = buildGroups(indices, this);
|
|
11447
|
+
}
|
|
11448
|
+
return result;
|
|
11449
|
+
};
|
|
11450
|
+
WrappedRegExp.prototype[Symbol.replace] = function(str, substitution) {
|
|
11451
|
+
if (typeof substitution === "string") {
|
|
11452
|
+
var groups = _groups.get(this);
|
|
11453
|
+
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function(_, name) {
|
|
11454
|
+
var group = groups ? groups[name] : undefined;
|
|
11455
|
+
if (group === undefined) return "";
|
|
11456
|
+
return "$" + (Array.isArray(group) ? group.join("$") : group);
|
|
11457
|
+
}));
|
|
11458
|
+
}
|
|
11459
|
+
if (typeof substitution === "function") {
|
|
11460
|
+
var _this = this;
|
|
11461
|
+
return _super[Symbol.replace].call(this, str, function() {
|
|
11462
|
+
var args = arguments;
|
|
11463
|
+
if (typeof args[args.length - 1] !== "object") {
|
|
11464
|
+
args = [].slice.call(args);
|
|
11465
|
+
args.push(buildGroups(args, _this));
|
|
11466
|
+
}
|
|
11467
|
+
return substitution.apply(this, args);
|
|
11468
|
+
});
|
|
11469
|
+
}
|
|
11470
|
+
return _super[Symbol.replace].call(this, str, substitution);
|
|
11471
|
+
};
|
|
11472
|
+
function buildGroups(result, re) {
|
|
11473
|
+
var g = _groups.get(re);
|
|
11474
|
+
return Object.keys(g).reduce(function(groups, name) {
|
|
11475
|
+
var i = g[name];
|
|
11476
|
+
if (typeof i === "number") groups[name] = result[i];
|
|
11477
|
+
else {
|
|
11478
|
+
var k = 0;
|
|
11479
|
+
while(result[i[k]] === undefined && k + 1 < i.length)k++;
|
|
11480
|
+
groups[name] = result[i[k]];
|
|
11481
|
+
}
|
|
11482
|
+
return groups;
|
|
11483
|
+
}, Object.create(null));
|
|
11484
|
+
}
|
|
11485
|
+
return _wrap_reg_exp.apply(this, arguments);
|
|
11486
|
+
}
|
|
11365
11487
|
/**
|
|
11366
11488
|
* Minimum valid latitude value (-90 degrees).
|
|
11367
11489
|
*/ var MIN_LATITUDE_VALUE = -90;
|
|
@@ -11605,7 +11727,10 @@ function latLngString(lat, lng) {
|
|
|
11605
11727
|
* https://stackoverflow.com/questions/3518504/regular-expression-for-matching-latitude-longitude-coordinates
|
|
11606
11728
|
*
|
|
11607
11729
|
* Has a max precision of 15 because Google Maps returns a 15 decimal places when copying a position.
|
|
11608
|
-
*/ var LAT_LNG_PATTERN =
|
|
11730
|
+
*/ var LAT_LNG_PATTERN = _wrap_reg_exp(/(^[-+]?(?:[1-8]?\d(?:\.\d{0,15})?|90(?:\.0{0,15})?))\s*,\s*([-+]?(?:180(?:\.0{0,15})?|(?:1[0-7]\d|[1-9]?\d)(?:\.\d{0,15})?))$/, {
|
|
11731
|
+
lat: 1,
|
|
11732
|
+
lng: 2
|
|
11733
|
+
}, "(?<lat>^[-+]?(?:[1-8]?\\d(?:\\.\\d{0,15})?|90(?:\\.0{0,15})?))\\s*,\\s*(?<lng>[-+]?(?:180(?:\\.0{0,15})?|(?:1[0-7]\\d|[1-9]?\\d)(?:\\.\\d{0,15})?))$");
|
|
11609
11734
|
/**
|
|
11610
11735
|
* Checks whether the input string matches the expected lat/lng pattern (e.g., `"30.5,-96.3"`).
|
|
11611
11736
|
*
|
|
@@ -12465,6 +12590,7 @@ function _array_with_holes$9(arr) {
|
|
|
12465
12590
|
if (Array.isArray(arr)) return arr;
|
|
12466
12591
|
}
|
|
12467
12592
|
function _instanceof$1(left, right) {
|
|
12593
|
+
"@swc/helpers - instanceof";
|
|
12468
12594
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
12469
12595
|
return !!right[Symbol.hasInstance](left);
|
|
12470
12596
|
} else {
|
|
@@ -12532,7 +12658,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
|
|
|
12532
12658
|
* Sat, 03 Feb 2001 04:05:06 GMT
|
|
12533
12659
|
* Tue, 14 Mar 2023 12:34:56 UTC
|
|
12534
12660
|
* Wed, 25 May 2024 20:45:07 EST
|
|
12535
|
-
*/ var UTC_DATE_STRING_REGEX = /^([a-zA-Z]{3},
|
|
12661
|
+
*/ var UTC_DATE_STRING_REGEX = /^([a-zA-Z]{3}, \d{2} [a-zA-Z]{3} \d{4} \d{2}:\d{2}:\d{2} [A-Z]{3})$/;
|
|
12536
12662
|
/**
|
|
12537
12663
|
* Determines if a string is a valid UTC date string.
|
|
12538
12664
|
*
|
|
@@ -16551,7 +16677,7 @@ function _is_native_reflect_construct$2() {
|
|
|
16551
16677
|
result = 0;
|
|
16552
16678
|
break;
|
|
16553
16679
|
case 'running':
|
|
16554
|
-
result = Math.max(0, currentDuration - (
|
|
16680
|
+
result = Math.max(0, currentDuration - (Date.now() - startedAt.getTime()));
|
|
16555
16681
|
break;
|
|
16556
16682
|
case 'paused':
|
|
16557
16683
|
result = null;
|
|
@@ -16859,6 +16985,7 @@ function _array_with_holes$6(arr) {
|
|
|
16859
16985
|
if (Array.isArray(arr)) return arr;
|
|
16860
16986
|
}
|
|
16861
16987
|
function _instanceof(left, right) {
|
|
16988
|
+
"@swc/helpers - instanceof";
|
|
16862
16989
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
16863
16990
|
return !!right[Symbol.hasInstance](left);
|
|
16864
16991
|
} else {
|
|
@@ -19938,7 +20065,9 @@ function invertMaybeBoolean(x) {
|
|
|
19938
20065
|
* ```
|
|
19939
20066
|
*/ function reduceBooleansFn(reduceFn, emptyArrayValue) {
|
|
19940
20067
|
var rFn = function rFn(array) {
|
|
19941
|
-
return Boolean(array.reduce(
|
|
20068
|
+
return Boolean(array.reduce(function(a, b) {
|
|
20069
|
+
return reduceFn(a, b);
|
|
20070
|
+
}));
|
|
19942
20071
|
};
|
|
19943
20072
|
return emptyArrayValue != null ? function(array) {
|
|
19944
20073
|
return array.length ? rFn(array) : emptyArrayValue;
|
|
@@ -21491,7 +21620,7 @@ exports.padStartFunction = padStartFunction;
|
|
|
21491
21620
|
exports.pairGroupValues = pairGroupValues;
|
|
21492
21621
|
exports.parseISO8601DayStringToUTCDate = parseISO8601DayStringToUTCDate;
|
|
21493
21622
|
exports.partialServerError = partialServerError;
|
|
21494
|
-
exports.passThrough =
|
|
21623
|
+
exports.passThrough = MAP_IDENTITY;
|
|
21495
21624
|
exports.percentNumberFromDecimal = percentNumberFromDecimal;
|
|
21496
21625
|
exports.percentNumberToDecimal = percentNumberToDecimal;
|
|
21497
21626
|
exports.performAsyncTask = performAsyncTask;
|
|
@@ -21681,6 +21810,8 @@ exports.stringToBoolean = stringToBoolean;
|
|
|
21681
21810
|
exports.stringToLowercaseFunction = stringToLowercaseFunction;
|
|
21682
21811
|
exports.stringToUppercaseFunction = stringToUppercaseFunction;
|
|
21683
21812
|
exports.stringTrimFunction = stringTrimFunction;
|
|
21813
|
+
exports.stripObject = stripObject;
|
|
21814
|
+
exports.stripObjectFunction = stripObjectFunction;
|
|
21684
21815
|
exports.sumOfIntegersBetween = sumOfIntegersBetween;
|
|
21685
21816
|
exports.swMostLatLngPoint = swMostLatLngPoint;
|
|
21686
21817
|
exports.symmetricDifferenceArray = symmetricDifferenceArray;
|