@rzl-zone/utils-js 3.5.3 → 3.5.5
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/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +1 -1
- package/dist/assertions/index.js +5 -5
- package/dist/{chunk-RZW35UN5.cjs → chunk-2CQI36UD.cjs} +6 -6
- package/dist/{chunk-PET42Z7W.js → chunk-2VO2CBTU.js} +2 -2
- package/dist/{chunk-CMW2TBOQ.js → chunk-3KTD3QDI.js} +2 -7
- package/dist/{chunk-XEDXFSGI.js → chunk-4ACKNPL5.js} +2 -2
- package/dist/{chunk-SIM77PU4.js → chunk-4ZOXSUXB.js} +3 -3
- package/dist/{chunk-IVL7CKVH.cjs → chunk-5NN4ZDE2.cjs} +6 -6
- package/dist/{chunk-FJZGG54N.cjs → chunk-66WLOZOD.cjs} +50 -50
- package/dist/{chunk-SBFNXGTJ.js → chunk-6DSPJA5U.js} +9 -9
- package/dist/{chunk-D3ENH7H6.cjs → chunk-6RFNZ2ZZ.cjs} +14 -14
- package/dist/{chunk-CKTLUNWX.js → chunk-6WMB5AJR.js} +2 -2
- package/dist/{chunk-JBQMXC5I.cjs → chunk-7QQV66RX.cjs} +10 -10
- package/dist/{chunk-6JFZL7YE.cjs → chunk-7WBMA2VE.cjs} +4 -4
- package/dist/{chunk-3IBQ5MOM.js → chunk-7ZNEUWYP.js} +2 -2
- package/dist/{chunk-JEQEF5WD.js → chunk-A3YI6Y2P.js} +3 -3
- package/dist/{chunk-DEZZUYE2.js → chunk-ABA2ZSBQ.js} +3 -3
- package/dist/{chunk-NRF6LWBC.cjs → chunk-AKKM6MOX.cjs} +15 -15
- package/dist/{chunk-ZETAZZLD.cjs → chunk-ATLFMKAF.cjs} +7 -7
- package/dist/{chunk-V45XJKHW.cjs → chunk-B4SDEBN7.cjs} +3 -3
- package/dist/{chunk-2IOOEY45.cjs → chunk-B6UIKBHR.cjs} +4 -4
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/{chunk-E74U6CYP.cjs → chunk-BYUT376O.cjs} +3 -3
- package/dist/{chunk-OYTYSY7G.js → chunk-D53CE4BT.js} +7 -7
- package/dist/{chunk-IRFL4MAX.js → chunk-DPLL67OT.js} +2 -2
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/{chunk-5KJFVIQT.cjs → chunk-EK7FSI7F.cjs} +3 -3
- package/dist/{chunk-PZQ6I4JJ.cjs → chunk-F3WBQKRI.cjs} +1 -8
- package/dist/{chunk-SBKGWRS5.js → chunk-FI76UZRF.js} +2 -2
- package/dist/{chunk-IZPBKKPO.js → chunk-GAJBF6DR.js} +2 -2
- package/dist/{chunk-DWF2R5GD.cjs → chunk-H5NWBTHW.cjs} +61 -61
- package/dist/{chunk-W2WNBUDE.js → chunk-JY4HLZ4W.js} +2 -2
- package/dist/{chunk-5757UBXJ.cjs → chunk-K3SONK25.cjs} +24 -24
- package/dist/{chunk-HYRQMTRH.cjs → chunk-K63WO3XA.cjs} +4 -4
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-RIPKY4RU.js → chunk-KPCDDYTZ.js} +2 -2
- package/dist/{chunk-F6IPNNSJ.cjs → chunk-KTQLDIIT.cjs} +161 -161
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-GGEADHZO.js → chunk-LBNOZIZ6.js} +5 -5
- package/dist/{chunk-3VA554KW.js → chunk-LEX4TQW2.js} +2 -2
- package/dist/{chunk-KVAL5PAG.cjs → chunk-LIU4S3JA.cjs} +4 -4
- package/dist/{chunk-E55EQK2U.cjs → chunk-NREACG6M.cjs} +3 -3
- package/dist/{chunk-T2T7K3KR.js → chunk-OFBFGFVH.js} +2 -2
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/{chunk-XABCB3Y7.cjs → chunk-OS5OT5JA.cjs} +126 -126
- package/dist/{chunk-GQR4R5WY.js → chunk-PZQC3FZY.js} +4 -4
- package/dist/{chunk-FWHNWL2P.cjs → chunk-QAPYHLHC.cjs} +3 -3
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/{chunk-YKPSRP5G.js → chunk-QUITZ3GP.js} +8 -8
- package/dist/{chunk-7ODAAXX5.cjs → chunk-RIEYB2AW.cjs} +71 -71
- package/dist/{chunk-LS6U7FAY.cjs → chunk-RMJC3B5P.cjs} +26 -26
- package/dist/{chunk-CDCERIZ2.js → chunk-RS5RBLPB.js} +31 -4
- package/dist/{chunk-JMJQCN74.js → chunk-SN6YRDLG.js} +9 -9
- package/dist/{chunk-NBZWMBO6.js → chunk-SZJ7OI4S.js} +3 -3
- package/dist/{chunk-FWCKOJZM.js → chunk-TDPYR5JY.js} +10 -10
- package/dist/{chunk-OI5XKNZO.js → chunk-TDYGYHSH.js} +4 -4
- package/dist/{chunk-CAH33WOQ.cjs → chunk-TFDXRT6D.cjs} +3 -3
- package/dist/{chunk-2WA36TC5.cjs → chunk-TPYENEQ4.cjs} +50 -23
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/{chunk-HQWOFR56.cjs → chunk-UKAUXY2U.cjs} +12 -12
- package/dist/{chunk-H66AC7GK.cjs → chunk-URDI3IMY.cjs} +19 -19
- package/dist/{chunk-6JFCSH7J.js → chunk-VCVND6CH.js} +2 -2
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/{chunk-QBKAEVYG.js → chunk-VNADVWSJ.js} +3 -3
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/{chunk-2CQX5CBG.js → chunk-XFTUHS4Y.js} +4 -4
- package/dist/{chunk-T7PU2V7X.cjs → chunk-YC7AK3KX.cjs} +31 -31
- package/dist/{chunk-EL6A35UR.cjs → chunk-YGB2BQPB.cjs} +8 -8
- package/dist/chunk-YWHHVDT4.js +1 -1
- package/dist/{chunk-5IGC6PBH.js → chunk-ZN53RM3R.js} +2 -2
- package/dist/conversions/index.cjs +34 -34
- package/dist/conversions/index.d.ts +1 -1
- package/dist/conversions/index.js +15 -15
- package/dist/events/index.cjs +8 -8
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +4 -4
- package/dist/formatters/index.cjs +19 -19
- package/dist/formatters/index.d.ts +1 -1
- package/dist/formatters/index.js +9 -9
- package/dist/generators/index.cjs +8 -8
- package/dist/generators/index.d.ts +1 -1
- package/dist/generators/index.js +4 -4
- package/dist/index.d.ts +1 -14
- package/dist/isPlainObject-FWmcJF6k.d.ts +1 -1
- package/dist/next/index.cjs +35 -35
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +7 -7
- package/dist/next/server/index.cjs +4 -4
- package/dist/next/server/index.d.ts +1 -1
- package/dist/next/server/index.js +2 -2
- package/dist/operations/index.cjs +11 -11
- package/dist/operations/index.d.ts +1 -1
- package/dist/operations/index.js +8 -8
- package/dist/parsers/index.cjs +4 -4
- package/dist/parsers/index.d.ts +1 -1
- package/dist/parsers/index.js +3 -3
- package/dist/predicates/index.cjs +74 -82
- package/dist/predicates/index.d.ts +2 -23
- package/dist/predicates/index.js +12 -12
- package/dist/promises/index.cjs +6 -6
- package/dist/promises/index.d.ts +1 -1
- package/dist/promises/index.js +4 -4
- package/dist/rzl-utils.global.js +2 -17
- package/dist/strings/index.cjs +23 -23
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +7 -7
- package/dist/tailwind/index.cjs +12 -11
- package/dist/tailwind/index.d.ts +6 -17
- package/dist/tailwind/index.js +5 -4
- package/dist/urls/index.cjs +19 -19
- package/dist/urls/index.d.ts +1 -1
- package/dist/urls/index.js +13 -13
- package/package.json +1 -1
|
@@ -2,40 +2,40 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
var chunk5NN4ZDE2_cjs = require('../chunk-5NN4ZDE2.cjs');
|
|
13
|
+
var chunkK63WO3XA_cjs = require('../chunk-K63WO3XA.cjs');
|
|
14
|
+
var chunk7WBMA2VE_cjs = require('../chunk-7WBMA2VE.cjs');
|
|
15
15
|
require('../chunk-UDA26MCU.cjs');
|
|
16
|
-
var
|
|
16
|
+
var chunkF3WBQKRI_cjs = require('../chunk-F3WBQKRI.cjs');
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "assertIsBigInt", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunk5NN4ZDE2_cjs.assertIsBigInt; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "assertIsNumber", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunk5NN4ZDE2_cjs.assertIsNumber; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "assertIsString", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkK63WO3XA_cjs.assertIsString; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "assertIsArray", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunk7WBMA2VE_cjs.assertIsArray; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "assertIsBoolean", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkF3WBQKRI_cjs.assertIsBoolean; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "assertIsPlainObject", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkF3WBQKRI_cjs.assertIsPlainObject; }
|
|
41
41
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
package/dist/assertions/index.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
export { assertIsBigInt, assertIsNumber } from '../chunk-
|
|
11
|
-
export { assertIsString } from '../chunk-
|
|
12
|
-
export { assertIsArray } from '../chunk-
|
|
10
|
+
export { assertIsBigInt, assertIsNumber } from '../chunk-LEX4TQW2.js';
|
|
11
|
+
export { assertIsString } from '../chunk-FI76UZRF.js';
|
|
12
|
+
export { assertIsArray } from '../chunk-6WMB5AJR.js';
|
|
13
13
|
import '../chunk-QNKGP5DY.js';
|
|
14
|
-
export { assertIsBoolean, assertIsPlainObject } from '../chunk-
|
|
14
|
+
export { assertIsBoolean, assertIsPlainObject } from '../chunk-3KTD3QDI.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkDVMHRLKP_cjs = require('./chunk-DVMHRLKP.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var chunkYC7AK3KX_cjs = require('./chunk-YC7AK3KX.cjs');
|
|
14
|
+
var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
|
|
15
15
|
|
|
16
16
|
var CustomPromise = class extends Promise {
|
|
17
17
|
_value;
|
|
@@ -74,12 +74,12 @@ var AbortError = class extends Error {
|
|
|
74
74
|
var delay = (milliSeconds = 1e3, signal) => {
|
|
75
75
|
if (!chunkDVMHRLKP_cjs.isInteger(milliSeconds) || milliSeconds <= 0) {
|
|
76
76
|
throw new TypeError(
|
|
77
|
-
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${
|
|
77
|
+
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
78
78
|
milliSeconds
|
|
79
|
-
)}\`, with value: \`${
|
|
79
|
+
)}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(milliSeconds)}\`.`
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
82
|
+
if (chunkF3WBQKRI_cjs.isNull(signal) || signal && !(signal instanceof AbortSignal)) {
|
|
83
83
|
throw new TypeError(
|
|
84
84
|
"Second parameter (`signal`) must be an `instance of AbortSignal` if provided."
|
|
85
85
|
);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
import { isBigInt } from './chunk-QNKGP5DY.js';
|
|
11
|
-
import { assertIsPlainObject, isPlainObject, isBoolean, isNaN, hasOwnProp, getPreciseType, isUndefined, isNumberObject, isInfinityNumber, isStringObject, isBooleanObject, isFunction, isSymbol, isObjectOrArray, isSet, isArray, isNull, isNumber, isObject } from './chunk-
|
|
11
|
+
import { assertIsPlainObject, isPlainObject, isBoolean, isNaN, hasOwnProp, getPreciseType, isUndefined, isNumberObject, isInfinityNumber, isStringObject, isBooleanObject, isFunction, isSymbol, isObjectOrArray, isSet, isArray, isNull, isNumber, isObject } from './chunk-3KTD3QDI.js';
|
|
12
12
|
|
|
13
13
|
function isMap(value) {
|
|
14
14
|
return Object.prototype.toString.call(value) === "[object Map]" || value instanceof Map;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -538,11 +538,6 @@ var getPreciseType = (value, options = { formatCase: "toLowerCase" }) => {
|
|
|
538
538
|
}
|
|
539
539
|
return converterHelper(tag, formatCase);
|
|
540
540
|
};
|
|
541
|
-
|
|
542
|
-
Object.values({
|
|
543
|
-
...FIXES_RAW,
|
|
544
|
-
plainobject: "Plain Object"
|
|
545
|
-
});
|
|
546
541
|
function resolveErrorMessageAssertions(params) {
|
|
547
542
|
const { requiredValidType, value, options } = params || {};
|
|
548
543
|
const { message, formatCase } = isPlainObject(options) ? options : {};
|
|
@@ -564,4 +559,4 @@ function assertIsPlainObject(value, options = {}) {
|
|
|
564
559
|
throw new TypeError(errorMessage);
|
|
565
560
|
}
|
|
566
561
|
|
|
567
|
-
export {
|
|
562
|
+
export { assertIsBoolean, assertIsPlainObject, getPreciseType, hasOwnProp, isArray, isBoolean, isBooleanObject, isBuffer, isError, isFunction, isInfinityNumber, isNaN, isNil, isNonEmptyArray, isNonEmptyString, isNull, isNumber, isNumberObject, isObject, isObjectOrArray, isPlainObject, isSet, isString, isStringObject, isSymbol, isUndefined, resolveErrorMessageAssertions, slugify, toCamelCase, toDotCase, toKebabCase, toLowerCase, toPascalCase, toPascalCaseSpace, toSnakeCase };
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { isNonEmptyString, isPlainObject } from './chunk-
|
|
10
|
+
import { isNonEmptyString, isPlainObject } from './chunk-3KTD3QDI.js';
|
|
11
11
|
|
|
12
12
|
var removeSpaces = (value, options = {
|
|
13
13
|
trimOnly: false
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
import { isServer } from './chunk-L5RDAVVH.js';
|
|
11
|
-
import { assertIsString } from './chunk-
|
|
12
|
-
import { isPlainObject, hasOwnProp, isNonEmptyString, isNumber } from './chunk-
|
|
11
|
+
import { assertIsString } from './chunk-FI76UZRF.js';
|
|
12
|
+
import { isPlainObject, hasOwnProp, isNonEmptyString, isNumber } from './chunk-3KTD3QDI.js';
|
|
13
13
|
|
|
14
14
|
var disableUserInteraction = (className = "on_processing") => {
|
|
15
15
|
if (isServer()) return;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
|
|
14
14
|
|
|
15
15
|
var assertIsBigInt = (value, options = {}) => {
|
|
16
16
|
if (chunkUDA26MCU_cjs.isBigInt(value)) return;
|
|
17
|
-
const errorMessage =
|
|
17
|
+
const errorMessage = chunkF3WBQKRI_cjs.resolveErrorMessageAssertions({
|
|
18
18
|
value,
|
|
19
19
|
options,
|
|
20
20
|
requiredValidType: "big int"
|
|
@@ -23,9 +23,9 @@ var assertIsBigInt = (value, options = {}) => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
var assertIsNumber = (value, options = {}) => {
|
|
26
|
-
const includeNaN =
|
|
27
|
-
if (
|
|
28
|
-
const errorMessage =
|
|
26
|
+
const includeNaN = chunkF3WBQKRI_cjs.hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0;
|
|
27
|
+
if (chunkF3WBQKRI_cjs.isNumber(value, { includeNaN })) return;
|
|
28
|
+
const errorMessage = chunkF3WBQKRI_cjs.resolveErrorMessageAssertions({
|
|
29
29
|
value,
|
|
30
30
|
options,
|
|
31
31
|
requiredValidType: "number"
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var chunkATLFMKAF_cjs = require('./chunk-ATLFMKAF.cjs');
|
|
13
13
|
var chunkBAV5T2E3_cjs = require('./chunk-BAV5T2E3.cjs');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunkYC7AK3KX_cjs = require('./chunk-YC7AK3KX.cjs');
|
|
15
|
+
var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
|
|
16
16
|
|
|
17
17
|
var parseCustomDate = (dateString, format) => {
|
|
18
|
-
if (!
|
|
18
|
+
if (!chunkF3WBQKRI_cjs.isNonEmptyString(dateString) || !chunkF3WBQKRI_cjs.isNonEmptyString(format)) {
|
|
19
19
|
throw new TypeError(
|
|
20
|
-
`Parameter \`dateString\` and \`format\` must be of type \`string\` and not empty-string, but received: "['dateString': \`${
|
|
20
|
+
`Parameter \`dateString\` and \`format\` must be of type \`string\` and not empty-string, but received: "['dateString': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
21
21
|
dateString
|
|
22
|
-
)}\` - (current value: \`${
|
|
22
|
+
)}\` - (current value: \`${chunkYC7AK3KX_cjs.safeStableStringify(
|
|
23
23
|
dateString
|
|
24
|
-
)}\`), 'format': \`${
|
|
24
|
+
)}\`), 'format': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
25
25
|
format
|
|
26
|
-
)}\` - (current value: \`${
|
|
26
|
+
)}\` - (current value: \`${chunkYC7AK3KX_cjs.safeStableStringify(format)}\`)]".`
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
const dateParts = dateString.split(/[-/]/).map(Number);
|
|
@@ -45,45 +45,45 @@ var parseCustomDate = (dateString, format) => {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
var validateJsonParsingOptions = (optionsValue = {}) => {
|
|
48
|
-
|
|
48
|
+
chunkF3WBQKRI_cjs.assertIsPlainObject(optionsValue, {
|
|
49
49
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
50
50
|
});
|
|
51
|
-
const convertBooleans =
|
|
52
|
-
const convertDates =
|
|
53
|
-
const convertNumbers =
|
|
54
|
-
const loggingOnFail =
|
|
55
|
-
const removeEmptyArrays =
|
|
56
|
-
const removeEmptyObjects =
|
|
57
|
-
const removeNulls =
|
|
58
|
-
const removeUndefined =
|
|
59
|
-
const strictMode =
|
|
60
|
-
const checkSymbols =
|
|
61
|
-
const convertNaN =
|
|
62
|
-
const customDateFormats =
|
|
63
|
-
const onError =
|
|
64
|
-
if (!(
|
|
51
|
+
const convertBooleans = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "convertBooleans") ? optionsValue.convertBooleans : false;
|
|
52
|
+
const convertDates = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "convertDates") ? optionsValue.convertDates : false;
|
|
53
|
+
const convertNumbers = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "convertNumbers") ? optionsValue.convertNumbers : false;
|
|
54
|
+
const loggingOnFail = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "loggingOnFail") ? optionsValue.loggingOnFail : false;
|
|
55
|
+
const removeEmptyArrays = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "removeEmptyArrays") ? optionsValue.removeEmptyArrays : false;
|
|
56
|
+
const removeEmptyObjects = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "removeEmptyObjects") ? optionsValue.removeEmptyObjects : false;
|
|
57
|
+
const removeNulls = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "removeNulls") ? optionsValue.removeNulls : false;
|
|
58
|
+
const removeUndefined = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "removeUndefined") ? optionsValue.removeUndefined : false;
|
|
59
|
+
const strictMode = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "strictMode") ? optionsValue.strictMode : false;
|
|
60
|
+
const checkSymbols = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "checkSymbols") ? optionsValue.checkSymbols : false;
|
|
61
|
+
const convertNaN = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "convertNaN") ? optionsValue.convertNaN : false;
|
|
62
|
+
const customDateFormats = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "customDateFormats") ? optionsValue.customDateFormats : [];
|
|
63
|
+
const onError = chunkF3WBQKRI_cjs.hasOwnProp(optionsValue, "onError") ? optionsValue.onError : chunkBAV5T2E3_cjs.noop;
|
|
64
|
+
if (!(chunkF3WBQKRI_cjs.isBoolean(convertBooleans) && chunkF3WBQKRI_cjs.isBoolean(convertDates) && chunkF3WBQKRI_cjs.isBoolean(convertNumbers) && chunkF3WBQKRI_cjs.isBoolean(convertNaN) && chunkF3WBQKRI_cjs.isBoolean(checkSymbols) && chunkF3WBQKRI_cjs.isBoolean(loggingOnFail) && chunkF3WBQKRI_cjs.isBoolean(removeEmptyArrays) && chunkF3WBQKRI_cjs.isBoolean(removeEmptyObjects) && chunkF3WBQKRI_cjs.isBoolean(removeNulls) && chunkF3WBQKRI_cjs.isBoolean(removeUndefined) && chunkF3WBQKRI_cjs.isBoolean(strictMode) && chunkF3WBQKRI_cjs.isArray(customDateFormats) && chunkF3WBQKRI_cjs.isFunction(onError))) {
|
|
65
65
|
throw new TypeError(
|
|
66
|
-
`Invalid \`options\` parameter (second argument): \`convertBooleans\`, \`convertDates\`, \`convertNumbers\`, \`loggingOnFail\`, \`removeEmptyArrays\`, \`removeEmptyObjects\`, \`removeNulls\`, \`removeUndefined\`, \`strictMode\` expected to be a \`boolean\` type, \`customDateFormats\` expected to be a \`array\` type and \`onError\` expected to be a \`void function\` type. But received: ['convertBooleans': \`${
|
|
66
|
+
`Invalid \`options\` parameter (second argument): \`convertBooleans\`, \`convertDates\`, \`convertNumbers\`, \`loggingOnFail\`, \`removeEmptyArrays\`, \`removeEmptyObjects\`, \`removeNulls\`, \`removeUndefined\`, \`strictMode\` expected to be a \`boolean\` type, \`customDateFormats\` expected to be a \`array\` type and \`onError\` expected to be a \`void function\` type. But received: ['convertBooleans': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
67
67
|
convertBooleans
|
|
68
|
-
)}\`, 'convertDates': \`${
|
|
68
|
+
)}\`, 'convertDates': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
69
69
|
convertDates
|
|
70
|
-
)}\`, 'convertNumbers': \`${
|
|
70
|
+
)}\`, 'convertNumbers': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
71
71
|
convertNumbers
|
|
72
|
-
)}\`, 'loggingOnFail': \`${
|
|
72
|
+
)}\`, 'loggingOnFail': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
73
73
|
loggingOnFail
|
|
74
|
-
)}\`, 'removeEmptyArrays': \`${
|
|
74
|
+
)}\`, 'removeEmptyArrays': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
75
75
|
removeEmptyArrays
|
|
76
|
-
)}\`, 'removeEmptyObjects': \`${
|
|
76
|
+
)}\`, 'removeEmptyObjects': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
77
77
|
removeEmptyObjects
|
|
78
|
-
)}\`, 'removeNulls': \`${
|
|
78
|
+
)}\`, 'removeNulls': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
79
79
|
removeNulls
|
|
80
|
-
)}\`, 'removeUndefined': \`${
|
|
80
|
+
)}\`, 'removeUndefined': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
81
81
|
removeUndefined
|
|
82
|
-
)}\`, 'strictMode': \`${
|
|
82
|
+
)}\`, 'strictMode': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
83
83
|
strictMode
|
|
84
|
-
)}\`, 'customDateFormats': \`${
|
|
84
|
+
)}\`, 'customDateFormats': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
85
85
|
customDateFormats
|
|
86
|
-
)}\`, 'onError': \`${
|
|
86
|
+
)}\`, 'onError': \`${chunkF3WBQKRI_cjs.getPreciseType(onError)}\`].`
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
return {
|
|
@@ -105,9 +105,9 @@ var validateJsonParsingOptions = (optionsValue = {}) => {
|
|
|
105
105
|
|
|
106
106
|
var cleanParsedData = (data, options = {}) => {
|
|
107
107
|
const validOptions = validateJsonParsingOptions(options);
|
|
108
|
-
if (
|
|
109
|
-
if (
|
|
110
|
-
if (
|
|
108
|
+
if (chunkF3WBQKRI_cjs.isNull(data)) return validOptions.removeNulls ? void 0 : null;
|
|
109
|
+
if (chunkF3WBQKRI_cjs.isUndefined(data)) return validOptions.removeUndefined ? void 0 : void 0;
|
|
110
|
+
if (chunkF3WBQKRI_cjs.isString(data)) {
|
|
111
111
|
const trimmed = data.trim();
|
|
112
112
|
if (validOptions.convertNaN && trimmed === "NaN") return NaN;
|
|
113
113
|
if (validOptions.convertNumbers && !isNaN(Number(trimmed))) {
|
|
@@ -130,27 +130,27 @@ var cleanParsedData = (data, options = {}) => {
|
|
|
130
130
|
}
|
|
131
131
|
return validOptions.strictMode ? void 0 : trimmed;
|
|
132
132
|
}
|
|
133
|
-
if (
|
|
134
|
-
const cleanedArray = data.map((item) => cleanParsedData(item, validOptions)).filter((item) => !
|
|
135
|
-
return validOptions.removeEmptyArrays &&
|
|
133
|
+
if (chunkF3WBQKRI_cjs.isArray(data)) {
|
|
134
|
+
const cleanedArray = data.map((item) => cleanParsedData(item, validOptions)).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
135
|
+
return validOptions.removeEmptyArrays && chunkATLFMKAF_cjs.isEmptyArray(cleanedArray) ? void 0 : cleanedArray;
|
|
136
136
|
}
|
|
137
|
-
if (
|
|
137
|
+
if (chunkF3WBQKRI_cjs.isObject(data)) {
|
|
138
138
|
const cleanedObject = {};
|
|
139
139
|
for (const key in data) {
|
|
140
140
|
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
141
141
|
const cleanedValue = cleanParsedData(data[key], validOptions);
|
|
142
|
-
if (!
|
|
142
|
+
if (!chunkF3WBQKRI_cjs.isUndefined(cleanedValue)) {
|
|
143
143
|
cleanedObject[key] = cleanedValue;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
return validOptions.removeEmptyObjects &&
|
|
147
|
+
return validOptions.removeEmptyObjects && chunkATLFMKAF_cjs.isEmptyObject(cleanedObject, { checkSymbols: validOptions.checkSymbols }) ? void 0 : cleanedObject;
|
|
148
148
|
}
|
|
149
149
|
return validOptions.strictMode ? void 0 : data;
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
var extractDigits = (value) => {
|
|
153
|
-
if (!
|
|
153
|
+
if (!chunkF3WBQKRI_cjs.isString(value) && !chunkF3WBQKRI_cjs.isNumber(value)) return 0;
|
|
154
154
|
const cleaned = String(value).trim().replace(/[^0-9]/g, "");
|
|
155
155
|
return Number(cleaned) || 0;
|
|
156
156
|
};
|
|
@@ -226,15 +226,15 @@ function fixSingleQuotesEscapeBackslash(input) {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
function safeJsonParse(value, options = {}) {
|
|
229
|
-
if (
|
|
229
|
+
if (chunkF3WBQKRI_cjs.isNull(value)) return null;
|
|
230
230
|
const validOptions = validateJsonParsingOptions(options);
|
|
231
|
-
if (validOptions.convertNaN && (
|
|
231
|
+
if (validOptions.convertNaN && (chunkF3WBQKRI_cjs.isNaN(value) || chunkF3WBQKRI_cjs.isNonEmptyString(value) && value === "NaN")) {
|
|
232
232
|
return NaN;
|
|
233
233
|
}
|
|
234
|
-
if (validOptions.convertNumbers && !
|
|
234
|
+
if (validOptions.convertNumbers && !chunkF3WBQKRI_cjs.isNaN(Number(value)) && chunkF3WBQKRI_cjs.isNumber(extractDigits(value))) {
|
|
235
235
|
return Number(value);
|
|
236
236
|
}
|
|
237
|
-
if (!
|
|
237
|
+
if (!chunkF3WBQKRI_cjs.isString(value)) return void 0;
|
|
238
238
|
try {
|
|
239
239
|
let normalized = fixSingleQuotesEscapeBackslash(value);
|
|
240
240
|
if (validOptions.removeUndefined) {
|
|
@@ -255,7 +255,7 @@ function safeJsonParse(value, options = {}) {
|
|
|
255
255
|
console.error("Failed to parsing at `safeJsonParse`:", error);
|
|
256
256
|
}
|
|
257
257
|
validOptions.onError(
|
|
258
|
-
|
|
258
|
+
chunkF3WBQKRI_cjs.isError(error) ? new Error(error.message.replace(/^JSON\.parse:/, "Failed to parsing")) : new Error(String(error))
|
|
259
259
|
);
|
|
260
260
|
return void 0;
|
|
261
261
|
}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
import { isURL } from './chunk-ONZFBJVW.js';
|
|
11
|
-
import { normalizeString } from './chunk-
|
|
12
|
-
import { toStringArrayUnRecursive } from './chunk-
|
|
13
|
-
import { isEmptyValue } from './chunk-
|
|
11
|
+
import { normalizeString } from './chunk-GAJBF6DR.js';
|
|
12
|
+
import { toStringArrayUnRecursive } from './chunk-TDYGYHSH.js';
|
|
13
|
+
import { isEmptyValue } from './chunk-PZQC3FZY.js';
|
|
14
14
|
import { isInteger } from './chunk-WVSPXFTY.js';
|
|
15
|
-
import { normalizePathname } from './chunk-
|
|
16
|
-
import { isEmptyString } from './chunk-
|
|
17
|
-
import { assertIsArray } from './chunk-
|
|
18
|
-
import { safeStableStringify } from './chunk-
|
|
19
|
-
import { isString, getPreciseType, isUndefined, isNonEmptyString, isFunction, isNumber, isError, isArray, isNil, isNull, isPlainObject, isBoolean, isNonEmptyArray } from './chunk-
|
|
15
|
+
import { normalizePathname } from './chunk-LBNOZIZ6.js';
|
|
16
|
+
import { isEmptyString } from './chunk-JY4HLZ4W.js';
|
|
17
|
+
import { assertIsArray } from './chunk-6WMB5AJR.js';
|
|
18
|
+
import { safeStableStringify } from './chunk-2VO2CBTU.js';
|
|
19
|
+
import { isString, getPreciseType, isUndefined, isNonEmptyString, isFunction, isNumber, isError, isArray, isNil, isNull, isPlainObject, isBoolean, isNonEmptyArray } from './chunk-3KTD3QDI.js';
|
|
20
20
|
|
|
21
21
|
var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
22
22
|
if (isString(baseUrl)) {
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var chunkNREACG6M_cjs = require('./chunk-NREACG6M.cjs');
|
|
13
|
+
var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
|
|
14
14
|
|
|
15
15
|
var capitalizeFirst = (string, options = {
|
|
16
16
|
lowerCaseNextRest: true,
|
|
17
17
|
trim: false
|
|
18
18
|
}) => {
|
|
19
|
-
if (!
|
|
20
|
-
if (!
|
|
19
|
+
if (!chunkF3WBQKRI_cjs.isNonEmptyString(string)) return "";
|
|
20
|
+
if (!chunkF3WBQKRI_cjs.isPlainObject(options)) {
|
|
21
21
|
options = {};
|
|
22
22
|
}
|
|
23
23
|
const lowerCaseNextRest = options.lowerCaseNextRest !== false;
|
|
@@ -30,9 +30,9 @@ var capitalizeWords = (value, options = {
|
|
|
30
30
|
collapseSpaces: false,
|
|
31
31
|
trim: false
|
|
32
32
|
}) => {
|
|
33
|
-
if (!
|
|
33
|
+
if (!chunkF3WBQKRI_cjs.isNonEmptyString(value)) return "";
|
|
34
34
|
let result = value;
|
|
35
|
-
if (!
|
|
35
|
+
if (!chunkF3WBQKRI_cjs.isPlainObject(options)) {
|
|
36
36
|
options = {};
|
|
37
37
|
}
|
|
38
38
|
const collapseSpaces = options.collapseSpaces === true;
|
|
@@ -50,10 +50,10 @@ var capitalizeWords = (value, options = {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
function stripHtmlTags(input) {
|
|
53
|
-
if (!
|
|
53
|
+
if (!chunkF3WBQKRI_cjs.isString(input)) {
|
|
54
54
|
return void 0;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (chunkNREACG6M_cjs.isEmptyString(input)) {
|
|
57
57
|
return "";
|
|
58
58
|
}
|
|
59
59
|
const stripped = input.replace(/<\/?[a-zA-Z][^<>]*\/?>/g, " ").trim();
|
|
@@ -62,7 +62,7 @@ function stripHtmlTags(input) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
var getInitialsName = (name) => {
|
|
65
|
-
if (!
|
|
65
|
+
if (!chunkF3WBQKRI_cjs.isNonEmptyString(name)) return "";
|
|
66
66
|
name = name.replace(/\s+/g, " ").trim();
|
|
67
67
|
const nameParts = name.split(" ");
|
|
68
68
|
if (nameParts.length > 1) {
|
|
@@ -75,13 +75,13 @@ var getInitialsName = (name) => {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
var replaceAt = (index, originalString, replaceTo) => {
|
|
78
|
-
if (!
|
|
78
|
+
if (!chunkF3WBQKRI_cjs.isNumber(index) || !chunkF3WBQKRI_cjs.isString(replaceTo) || !chunkF3WBQKRI_cjs.isString(originalString)) {
|
|
79
79
|
throw new TypeError(
|
|
80
|
-
`First parameter (\`index\`) must be of type \`number\`, second parameter (\`originalString\`) and third parameter (\`replaceTo\`) must be of type \`string\`, but received: "['index': \`${
|
|
80
|
+
`First parameter (\`index\`) must be of type \`number\`, second parameter (\`originalString\`) and third parameter (\`replaceTo\`) must be of type \`string\`, but received: "['index': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
81
81
|
index
|
|
82
|
-
)}\`, 'originalString': \`${
|
|
82
|
+
)}\`, 'originalString': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
83
83
|
originalString
|
|
84
|
-
)}\`, 'replaceTo': \`${
|
|
84
|
+
)}\`, 'replaceTo': \`${chunkF3WBQKRI_cjs.getPreciseType(replaceTo)}\`]".`
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
if (index < 0 || index >= originalString.length) {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { isArray, resolveErrorMessageAssertions } from './chunk-
|
|
10
|
+
import { isArray, resolveErrorMessageAssertions } from './chunk-3KTD3QDI.js';
|
|
11
11
|
|
|
12
12
|
function assertIsArray(value, options) {
|
|
13
13
|
if (isArray(value)) return;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.5.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var chunkYC7AK3KX_cjs = require('./chunk-YC7AK3KX.cjs');
|
|
13
|
+
var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
|
|
14
14
|
|
|
15
15
|
var isRegExp = (value) => {
|
|
16
16
|
return value instanceof RegExp;
|
|
@@ -23,7 +23,7 @@ function isArrayBuffer(value) {
|
|
|
23
23
|
function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new WeakMap()) {
|
|
24
24
|
if (value === other) return true;
|
|
25
25
|
if (value !== value && other !== other) return true;
|
|
26
|
-
if (!
|
|
26
|
+
if (!chunkF3WBQKRI_cjs.isObjectOrArray(value) || !chunkF3WBQKRI_cjs.isObjectOrArray(other)) {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
if (seen.get(value) === other) return true;
|
|
@@ -31,14 +31,14 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
31
31
|
const callCustomizer = (v, o, key, valObj, othObj) => {
|
|
32
32
|
if (customizer) {
|
|
33
33
|
const result = customizer(v, o, key, valObj, othObj, seen);
|
|
34
|
-
if (!
|
|
34
|
+
if (!chunkF3WBQKRI_cjs.isUndefined(result)) return result;
|
|
35
35
|
}
|
|
36
36
|
return baseDeepEqual(v, o, customizer, seen);
|
|
37
37
|
};
|
|
38
|
-
if (
|
|
38
|
+
if (chunkYC7AK3KX_cjs.isDate(value) && chunkYC7AK3KX_cjs.isDate(other)) return value.getTime() === other.getTime();
|
|
39
39
|
if (isRegExp(value) && isRegExp(other))
|
|
40
40
|
return value.source === other.source && value.flags === other.flags;
|
|
41
|
-
if (
|
|
41
|
+
if (chunkF3WBQKRI_cjs.isError(value) && chunkF3WBQKRI_cjs.isError(other))
|
|
42
42
|
return value.name === other.name && value.message === other.message;
|
|
43
43
|
if (ArrayBuffer.isView(value) && ArrayBuffer.isView(other)) {
|
|
44
44
|
const v = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
|
|
@@ -53,7 +53,7 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
53
53
|
for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
|
|
54
54
|
return true;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (chunkYC7AK3KX_cjs.isMap(value) && chunkYC7AK3KX_cjs.isMap(other)) {
|
|
57
57
|
if (value.size !== other.size) return false;
|
|
58
58
|
for (const [k, v] of value) {
|
|
59
59
|
if (!other.has(k)) return false;
|
|
@@ -61,7 +61,7 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
61
61
|
}
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
|
-
if (
|
|
64
|
+
if (chunkF3WBQKRI_cjs.isSet(value) && chunkF3WBQKRI_cjs.isSet(other)) {
|
|
65
65
|
if (value.size !== other.size) return false;
|
|
66
66
|
for (const v of value) {
|
|
67
67
|
let matched = false;
|
|
@@ -75,7 +75,7 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
75
75
|
}
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
78
|
+
if (chunkF3WBQKRI_cjs.isArray(value) && chunkF3WBQKRI_cjs.isArray(other)) {
|
|
79
79
|
if (value.length !== other.length) return false;
|
|
80
80
|
for (let i = 0; i < value.length; i++) {
|
|
81
81
|
if (!callCustomizer(value[i], other[i], i, value, other)) return false;
|