@rzl-zone/utils-js 3.10.0 → 3.11.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/README.md +36 -18
- package/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +487 -215
- package/dist/assertions/index.js +5 -5
- package/dist/{chunk-SN5HAK3Y.js → chunk-22V4WP3H.js} +4 -4
- package/dist/{chunk-EJV5AF4L.js → chunk-2XSZ2ANI.js} +2 -2
- package/dist/{chunk-OSSFLQDD.js → chunk-3T6VSWYX.js} +2 -2
- package/dist/{chunk-3LE6NX57.js → chunk-5WIEDF2J.js} +4 -4
- package/dist/{chunk-WLEZ2KSG.cjs → chunk-6EDFZJZ5.cjs} +126 -126
- package/dist/{chunk-GHU356XQ.js → chunk-6LXWT2I5.js} +3 -3
- package/dist/{chunk-GKDSBOYE.js → chunk-6YGBRENU.js} +3 -3
- package/dist/{chunk-NAOVH4OH.cjs → chunk-7FGNVDEV.cjs} +7 -7
- package/dist/{chunk-X6ULJZ3X.js → chunk-AXDYWO67.js} +2 -2
- package/dist/{chunk-UV5BKAYW.cjs → chunk-B6PMNZ4M.cjs} +7 -7
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/{chunk-YHFRCVTN.js → chunk-BLF7SD66.js} +3 -3
- package/dist/{chunk-QZI5PVCI.cjs → chunk-BMZZXZJ2.cjs} +4 -4
- package/dist/{chunk-DXPM4NOU.js → chunk-BOYP3ARU.js} +4 -4
- package/dist/{chunk-UXT4XSUK.js → chunk-BPYW5YL7.js} +2 -2
- package/dist/{chunk-QGTFQ7RO.cjs → chunk-C2PV3VWC.cjs} +6 -6
- package/dist/{chunk-MZ3T6L7Z.js → chunk-CCJ2MSN7.js} +2 -2
- package/dist/{chunk-H44QVAZL.cjs → chunk-DAPAK2W3.cjs} +31 -31
- package/dist/{chunk-OYFUBKEG.cjs → chunk-DLS3G6WQ.cjs} +4 -4
- package/dist/{chunk-MS2KSKD7.js → chunk-DNMCR5JH.js} +9 -9
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/{chunk-IX6PF5ZP.cjs → chunk-EBYFYZW4.cjs} +4 -4
- package/dist/{chunk-5Y6JL47L.js → chunk-ENMRZ4BE.js} +3 -3
- package/dist/{chunk-7EIFPHV3.js → chunk-FJ4BQFVO.js} +8 -8
- package/dist/{chunk-TJ5OY6MC.cjs → chunk-GIKL4PUF.cjs} +10 -10
- package/dist/{chunk-M5QB2GM5.js → chunk-GOFINGT6.js} +2 -2
- package/dist/{chunk-J6VLFVIL.js → chunk-GXKQ3LHF.js} +3 -3
- package/dist/{chunk-5KDVIEVO.js → chunk-HNBRGN4R.js} +2 -2
- package/dist/{chunk-OCTHWEZK.cjs → chunk-HYN6FC5A.cjs} +34 -34
- package/dist/{chunk-MBFVTGYS.js → chunk-IZGVBYFN.js} +4 -4
- package/dist/{chunk-QXTJVDWE.js → chunk-JIE447J5.js} +3 -3
- package/dist/{chunk-UFYMRRJH.cjs → chunk-JXEIJM5M.cjs} +61 -61
- package/dist/{chunk-WB3FT62A.js → chunk-K47GZDBH.js} +3 -3
- package/dist/{chunk-KUVRZ2JW.cjs → chunk-K5536YHG.cjs} +50 -50
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-NJ24M6ZH.cjs → chunk-KXJ7X325.cjs} +37 -37
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-SRWL4YCP.js → chunk-LJHPTLWB.js} +7 -7
- package/dist/{chunk-6AMDHVS2.cjs → chunk-M7ELWZXM.cjs} +9 -9
- package/dist/chunk-MSUW5VHZ.js +1590 -0
- package/dist/{chunk-2XGQQZ6A.cjs → chunk-MUHRPRR7.cjs} +3 -3
- package/dist/{chunk-XYWC4EQ3.cjs → chunk-MV3TSQSH.cjs} +71 -71
- package/dist/{chunk-VCYXNIZ2.cjs → chunk-NLZLXWAU.cjs} +9 -9
- package/dist/{chunk-76ATVDCR.cjs → chunk-NVRZPF5M.cjs} +3 -3
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/{chunk-62FS7WMB.cjs → chunk-PGNL7JXO.cjs} +31 -31
- package/dist/{chunk-JI57K7D4.cjs → chunk-Q4GEQS7X.cjs} +161 -161
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/{chunk-ZTHJQJ5F.cjs → chunk-QYI2VJLS.cjs} +9 -9
- package/dist/{chunk-C7GC2PFX.js → chunk-RBWZII5I.js} +3 -3
- package/dist/{chunk-MMRHKYT6.cjs → chunk-RMP7VMPB.cjs} +12 -12
- package/dist/{chunk-TXOVQZPU.js → chunk-RZOGBYIS.js} +2 -2
- package/dist/{chunk-ALRISPTL.cjs → chunk-SU3UELUB.cjs} +3 -3
- package/dist/chunk-SYHPSOUU.cjs +1626 -0
- package/dist/{chunk-R2DR7SPJ.js → chunk-SZUNAEMR.js} +6 -6
- package/dist/{chunk-YVRUY4EW.cjs → chunk-TER22LO4.cjs} +8 -8
- package/dist/{chunk-WRGN6UBK.js → chunk-TJHGRQ4P.js} +2 -2
- package/dist/{chunk-I33PB44Q.cjs → chunk-U23I7JPB.cjs} +15 -15
- package/dist/{chunk-VBSLIIDB.js → chunk-U7HHN47R.js} +10 -10
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/{chunk-44X74C26.js → chunk-UIAWUZ4H.js} +4 -4
- package/dist/{chunk-5O66AUEC.js → chunk-ULQPCIA2.js} +2 -2
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/{chunk-6WVOUVWD.js → chunk-WETQI6HM.js} +9 -9
- package/dist/{chunk-FWWPEL7J.cjs → chunk-WLOQQFDS.cjs} +3 -3
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/{chunk-WKM6UVMG.cjs → chunk-WXFTVXBF.cjs} +4 -4
- package/dist/{chunk-YQHJB7KR.cjs → chunk-XPVTIGU2.cjs} +26 -26
- package/dist/{chunk-PWKOFPAH.cjs → chunk-XX6RUGTM.cjs} +3 -3
- package/dist/chunk-YWHHVDT4.js +1 -1
- package/dist/{chunk-7NXFGJJE.cjs → chunk-ZPDMWDGZ.cjs} +14 -14
- package/dist/{chunk-JYOCB6OV.js → chunk-ZVWZEGQP.js} +2 -2
- package/dist/conversions/index.cjs +34 -34
- package/dist/conversions/index.d.ts +489 -333
- package/dist/conversions/index.js +15 -15
- package/dist/events/index.cjs +8 -8
- package/dist/events/index.d.ts +35 -29
- package/dist/events/index.js +4 -4
- package/dist/formatters/index.cjs +19 -19
- package/dist/formatters/index.d.ts +917 -873
- package/dist/formatters/index.js +9 -9
- package/dist/generators/index.cjs +9 -9
- package/dist/generators/index.d.ts +104 -86
- package/dist/generators/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/isPlainObject-0p3VveWr.d.ts +534 -0
- package/dist/next/index.cjs +37 -37
- package/dist/next/index.d.ts +36 -21
- package/dist/next/index.js +9 -9
- package/dist/next/server/index.cjs +4 -4
- package/dist/next/server/index.d.ts +6 -3
- package/dist/next/server/index.js +2 -2
- package/dist/operations/index.cjs +11 -11
- package/dist/operations/index.d.ts +14 -5
- package/dist/operations/index.js +8 -8
- package/dist/parsers/index.cjs +6 -6
- package/dist/parsers/index.d.ts +68 -65
- package/dist/parsers/index.js +5 -5
- package/dist/predicates/index.cjs +77 -77
- package/dist/predicates/index.d.ts +442 -258
- package/dist/predicates/index.js +14 -14
- package/dist/promises/index.cjs +6 -6
- package/dist/promises/index.d.ts +28 -16
- package/dist/promises/index.js +4 -4
- package/dist/rzl-utils.global.js +2 -2
- package/dist/strings/index.cjs +23 -23
- package/dist/strings/index.d.ts +82 -54
- package/dist/strings/index.js +7 -7
- package/dist/tailwind/index.cjs +13 -13
- package/dist/tailwind/index.d.ts +186 -169
- package/dist/tailwind/index.js +5 -5
- package/dist/urls/index.cjs +23 -23
- package/dist/urls/index.d.ts +252 -229
- package/dist/urls/index.js +16 -16
- package/package.json +2 -2
- package/dist/chunk-7C7TQC5J.cjs +0 -620
- package/dist/chunk-J4TT33ZX.js +0 -584
- package/dist/isPlainObject-BTPjv6zB.d.ts +0 -178
|
@@ -2,40 +2,40 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.11.0.
|
|
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
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
12
|
+
var chunkSU3UELUB_cjs = require('./chunk-SU3UELUB.cjs');
|
|
13
|
+
var chunkU23I7JPB_cjs = require('./chunk-U23I7JPB.cjs');
|
|
14
|
+
var chunkWLOQQFDS_cjs = require('./chunk-WLOQQFDS.cjs');
|
|
15
|
+
var chunkWXFTVXBF_cjs = require('./chunk-WXFTVXBF.cjs');
|
|
16
|
+
var chunkGIKL4PUF_cjs = require('./chunk-GIKL4PUF.cjs');
|
|
17
|
+
var chunk7FGNVDEV_cjs = require('./chunk-7FGNVDEV.cjs');
|
|
18
|
+
var chunkDLS3G6WQ_cjs = require('./chunk-DLS3G6WQ.cjs');
|
|
19
|
+
var chunkDAPAK2W3_cjs = require('./chunk-DAPAK2W3.cjs');
|
|
20
20
|
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
21
|
-
var
|
|
21
|
+
var chunkSYHPSOUU_cjs = require('./chunk-SYHPSOUU.cjs');
|
|
22
22
|
|
|
23
23
|
function toNumberArrayUnRecursive(array, options = {}) {
|
|
24
|
-
|
|
24
|
+
chunkSYHPSOUU_cjs.assertIsPlainObject(options, {
|
|
25
25
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
26
26
|
});
|
|
27
|
-
const riv =
|
|
28
|
-
|
|
27
|
+
const riv = chunkSYHPSOUU_cjs.hasOwnProp(options, "removeInvalidValueNumber") ? options.removeInvalidValueNumber : true;
|
|
28
|
+
chunkSYHPSOUU_cjs.assertIsBoolean(riv, {
|
|
29
29
|
message: ({ currentType, validType }) => `Parameter \`removeInvalidValueNumber\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
30
30
|
});
|
|
31
|
-
if (
|
|
31
|
+
if (chunkSYHPSOUU_cjs.isArray(array)) {
|
|
32
32
|
const result = Array.from(array, (x) => {
|
|
33
33
|
if (chunkUDA26MCU_cjs.isBigInt(x)) return Number(x);
|
|
34
34
|
const str = String(x).trim();
|
|
35
35
|
const match = str.match(/-?\d+(\.\d+)?/);
|
|
36
|
-
return match ? Number(match[0]) :
|
|
36
|
+
return match ? Number(match[0]) : chunkSYHPSOUU_cjs.isNull(x) ? null : void 0;
|
|
37
37
|
});
|
|
38
|
-
return riv ?
|
|
38
|
+
return riv ? chunkU23I7JPB_cjs.filterNilArray(result) : result;
|
|
39
39
|
}
|
|
40
40
|
return void 0;
|
|
41
41
|
}
|
|
@@ -43,55 +43,55 @@ function toNumberArrayUnRecursive(array, options = {}) {
|
|
|
43
43
|
function toStringDeepForce(value, forceToString) {
|
|
44
44
|
if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
|
|
45
45
|
throw new TypeError(
|
|
46
|
-
`Second parameter \`forceToString\` must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${
|
|
46
|
+
`Second parameter \`forceToString\` must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${chunkSYHPSOUU_cjs.getPreciseType(
|
|
47
47
|
forceToString
|
|
48
|
-
)}\`, with value: \`${
|
|
48
|
+
)}\`, with value: \`${chunkDAPAK2W3_cjs.safeStableStringify(forceToString, {
|
|
49
49
|
keepUndefined: true
|
|
50
50
|
})}\`.`
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
if (
|
|
53
|
+
if (chunkSYHPSOUU_cjs.isNaN(value)) {
|
|
54
54
|
return forceToString === "primitives" || forceToString === "all" ? "NaN" : NaN;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (chunkSYHPSOUU_cjs.isString(value) || chunkSYHPSOUU_cjs.isNumber(value)) {
|
|
57
57
|
return forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
58
58
|
}
|
|
59
|
-
if (
|
|
59
|
+
if (chunkSYHPSOUU_cjs.isBoolean(value) || chunkUDA26MCU_cjs.isBigInt(value) || chunkSYHPSOUU_cjs.isNil(value)) {
|
|
60
60
|
return forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
62
|
+
if (chunkSYHPSOUU_cjs.isNumberObject(value) || chunkSYHPSOUU_cjs.isBooleanObject(value) || chunkSYHPSOUU_cjs.isStringObject(value)) {
|
|
63
63
|
return forceToString === "all" ? value.valueOf().toString() : value;
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
65
|
+
if (chunkSYHPSOUU_cjs.isSymbol(value)) {
|
|
66
66
|
return forceToString === "all" ? value.toString() : value;
|
|
67
67
|
}
|
|
68
|
-
if (
|
|
68
|
+
if (chunkSYHPSOUU_cjs.isFunction(value)) {
|
|
69
69
|
return forceToString === "all" ? value.toString() : value;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
71
|
+
if (chunkSYHPSOUU_cjs.isArray(value)) {
|
|
72
72
|
return value.map((v) => toStringDeepForce(v, forceToString));
|
|
73
73
|
}
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
74
|
+
if (chunkSYHPSOUU_cjs.isObjectOrArray(value)) {
|
|
75
|
+
if (chunkDAPAK2W3_cjs.isDate(value)) {
|
|
76
76
|
return forceToString === "all" ? value.toISOString() : value;
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
78
|
+
if (chunkGIKL4PUF_cjs.isRegExp(value)) {
|
|
79
79
|
return forceToString === "all" ? value.toString() : value;
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
81
|
+
if (chunkSYHPSOUU_cjs.isError(value) || value instanceof Promise) {
|
|
82
82
|
return forceToString === "all" ? value.toString() : value;
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
84
|
+
if (chunkSYHPSOUU_cjs.isSet(value)) {
|
|
85
85
|
return forceToString === "all" ? [...value].map((v) => toStringDeepForce(v, forceToString)) : value;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
87
|
+
if (chunkDAPAK2W3_cjs.isMap(value)) {
|
|
88
88
|
return forceToString === "all" ? [...value.entries()].map(([k, v]) => [
|
|
89
89
|
toStringDeepForce(k, forceToString),
|
|
90
90
|
toStringDeepForce(v, forceToString)
|
|
91
91
|
]) : value;
|
|
92
92
|
}
|
|
93
93
|
const result = {};
|
|
94
|
-
if (
|
|
94
|
+
if (chunkSYHPSOUU_cjs.isObject(value)) {
|
|
95
95
|
for (const key of Object.keys(value)) {
|
|
96
96
|
result[key] = toStringDeepForce(value[key], forceToString);
|
|
97
97
|
}
|
|
@@ -102,31 +102,31 @@ function toStringDeepForce(value, forceToString) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
var dedupeArray = (inputArray, options = {}) => {
|
|
105
|
-
|
|
105
|
+
chunkDLS3G6WQ_cjs.assertIsArray(inputArray, {
|
|
106
106
|
message: ({ currentType, validType }) => `First parameter (\`inputArray\`) must be of type \`${validType}\` (array literal or instance), but received: \`${currentType}\`.`
|
|
107
107
|
});
|
|
108
|
-
|
|
108
|
+
chunkSYHPSOUU_cjs.assertIsPlainObject(options, {
|
|
109
109
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
110
110
|
});
|
|
111
|
-
const flatten =
|
|
112
|
-
const forceToString =
|
|
111
|
+
const flatten = chunkSYHPSOUU_cjs.hasOwnProp(options, "flatten") ? options.flatten : false;
|
|
112
|
+
const forceToString = chunkSYHPSOUU_cjs.hasOwnProp(options, "forceToString") ? options.forceToString : false;
|
|
113
113
|
if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
|
|
114
114
|
throw new TypeError(
|
|
115
|
-
`Parameter \`forceToString\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${
|
|
115
|
+
`Parameter \`forceToString\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${chunkSYHPSOUU_cjs.getPreciseType(
|
|
116
116
|
forceToString
|
|
117
|
-
)}\`, with value: \`${
|
|
117
|
+
)}\`, with value: \`${chunkDAPAK2W3_cjs.safeStableStringify(forceToString, {
|
|
118
118
|
keepUndefined: true
|
|
119
119
|
})}\`.`
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
chunkSYHPSOUU_cjs.assertIsBoolean(flatten, {
|
|
123
123
|
message: ({ currentType, validType }) => `Parameter \`flatten\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
124
124
|
});
|
|
125
125
|
const process = (arr) => {
|
|
126
126
|
const seen = [];
|
|
127
127
|
return arr.reduce((acc, item) => {
|
|
128
|
-
const value =
|
|
129
|
-
if (!seen.some((s) =>
|
|
128
|
+
const value = chunkSYHPSOUU_cjs.isArray(item) ? process(item) : toStringDeepForce(item, forceToString);
|
|
129
|
+
if (!seen.some((s) => chunkGIKL4PUF_cjs.isEqual(s, value))) {
|
|
130
130
|
seen.push(value);
|
|
131
131
|
acc.push(value);
|
|
132
132
|
}
|
|
@@ -134,13 +134,13 @@ var dedupeArray = (inputArray, options = {}) => {
|
|
|
134
134
|
}, []);
|
|
135
135
|
};
|
|
136
136
|
const deepFlatten = (value) => {
|
|
137
|
-
if (
|
|
137
|
+
if (chunkSYHPSOUU_cjs.isArray(value)) {
|
|
138
138
|
return value.flatMap(deepFlatten);
|
|
139
139
|
}
|
|
140
|
-
if (
|
|
140
|
+
if (chunkSYHPSOUU_cjs.isSet(value)) {
|
|
141
141
|
return [...value].flatMap(deepFlatten);
|
|
142
142
|
}
|
|
143
|
-
if (
|
|
143
|
+
if (chunkDAPAK2W3_cjs.isMap(value)) {
|
|
144
144
|
return [...value.values()].flatMap(deepFlatten);
|
|
145
145
|
}
|
|
146
146
|
return [value];
|
|
@@ -149,40 +149,40 @@ var dedupeArray = (inputArray, options = {}) => {
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
var toBooleanContent = (value) => {
|
|
152
|
-
if (
|
|
153
|
-
if (
|
|
154
|
-
if (
|
|
155
|
-
if (
|
|
156
|
-
if (
|
|
152
|
+
if (chunkSYHPSOUU_cjs.isNil(value)) return false;
|
|
153
|
+
if (chunkSYHPSOUU_cjs.isString(value)) return chunkSYHPSOUU_cjs.isNonEmptyString(value);
|
|
154
|
+
if (chunkSYHPSOUU_cjs.isBoolean(value)) return value;
|
|
155
|
+
if (chunkSYHPSOUU_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
156
|
+
if (chunkSYHPSOUU_cjs.isArray(value) || chunkSYHPSOUU_cjs.isObject(value)) return chunkSU3UELUB_cjs.isNonEmptyValue(value);
|
|
157
157
|
return Boolean(value);
|
|
158
158
|
};
|
|
159
159
|
|
|
160
160
|
var toBooleanContentDeep = (value) => {
|
|
161
|
-
if (
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
if (
|
|
165
|
-
if (
|
|
166
|
-
if (
|
|
161
|
+
if (chunkSYHPSOUU_cjs.isNil(value)) return false;
|
|
162
|
+
if (chunkSYHPSOUU_cjs.isString(value)) return chunkSYHPSOUU_cjs.isNonEmptyString(value);
|
|
163
|
+
if (chunkSYHPSOUU_cjs.isBoolean(value)) return value;
|
|
164
|
+
if (chunkSYHPSOUU_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
165
|
+
if (chunkSYHPSOUU_cjs.isArray(value)) return value.some(toBooleanContentDeep);
|
|
166
|
+
if (chunkSYHPSOUU_cjs.isObject(value)) return Object.values(value).some(toBooleanContentDeep);
|
|
167
167
|
return false;
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
var toBooleanExplicit = (value, options = {}) => {
|
|
171
|
-
if (
|
|
172
|
-
if (!
|
|
173
|
-
const ci =
|
|
174
|
-
const ts =
|
|
175
|
-
const incInd =
|
|
176
|
-
if (!
|
|
171
|
+
if (chunkSYHPSOUU_cjs.isNil(value)) return false;
|
|
172
|
+
if (!chunkSYHPSOUU_cjs.isPlainObject(options)) options = {};
|
|
173
|
+
const ci = chunkSYHPSOUU_cjs.hasOwnProp(options, "caseInsensitive") ? options.caseInsensitive : false;
|
|
174
|
+
const ts = chunkSYHPSOUU_cjs.hasOwnProp(options, "trimString") ? options.trimString : true;
|
|
175
|
+
const incInd = chunkSYHPSOUU_cjs.hasOwnProp(options, "includeIndeterminate") ? options.includeIndeterminate : false;
|
|
176
|
+
if (!chunkSYHPSOUU_cjs.isBoolean(ci) || !chunkSYHPSOUU_cjs.isBoolean(ts) || !chunkSYHPSOUU_cjs.isBoolean(incInd)) {
|
|
177
177
|
throw new TypeError(
|
|
178
|
-
`Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${
|
|
178
|
+
`Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${chunkSYHPSOUU_cjs.getPreciseType(
|
|
179
179
|
ci
|
|
180
|
-
)}\`, 'trimString': \`${
|
|
180
|
+
)}\`, 'trimString': \`${chunkSYHPSOUU_cjs.getPreciseType(
|
|
181
181
|
ts
|
|
182
|
-
)}\`, 'includeIndeterminate': \`${
|
|
182
|
+
)}\`, 'includeIndeterminate': \`${chunkSYHPSOUU_cjs.getPreciseType(incInd)}\`].`
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
185
|
+
if (chunkSYHPSOUU_cjs.isString(value)) {
|
|
186
186
|
let normalized = value;
|
|
187
187
|
if (ts) normalized = normalized.trim();
|
|
188
188
|
if (ci) normalized = normalized.toLowerCase();
|
|
@@ -190,17 +190,17 @@ var toBooleanExplicit = (value, options = {}) => {
|
|
|
190
190
|
if (incInd) validTrueStrings.push("indeterminate");
|
|
191
191
|
return validTrueStrings.includes(normalized);
|
|
192
192
|
}
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
193
|
+
if (chunkSYHPSOUU_cjs.isNumber(value)) return value === 1;
|
|
194
|
+
if (chunkSYHPSOUU_cjs.isBoolean(value)) return value;
|
|
195
195
|
return false;
|
|
196
196
|
};
|
|
197
197
|
|
|
198
198
|
var toBooleanLoose = (value) => {
|
|
199
|
-
if (
|
|
200
|
-
if (
|
|
201
|
-
if (
|
|
202
|
-
if (
|
|
203
|
-
if (
|
|
199
|
+
if (chunkSYHPSOUU_cjs.isNil(value)) return false;
|
|
200
|
+
if (chunkSYHPSOUU_cjs.isString(value)) return !chunkWLOQQFDS_cjs.isEmptyString(value);
|
|
201
|
+
if (chunkSYHPSOUU_cjs.isBoolean(value)) return value;
|
|
202
|
+
if (chunkSYHPSOUU_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
203
|
+
if (chunkSYHPSOUU_cjs.isArray(value)) return value.length > 0;
|
|
204
204
|
return Boolean(value);
|
|
205
205
|
};
|
|
206
206
|
|
|
@@ -214,14 +214,14 @@ var convertType = (value) => {
|
|
|
214
214
|
yes: true,
|
|
215
215
|
no: false
|
|
216
216
|
};
|
|
217
|
-
if (
|
|
217
|
+
if (chunkSYHPSOUU_cjs.isString(value)) {
|
|
218
218
|
const normalized = value.trim().toLowerCase();
|
|
219
219
|
if (Object.prototype.hasOwnProperty.call(predefinedValues, normalized)) {
|
|
220
220
|
return predefinedValues[normalized];
|
|
221
221
|
}
|
|
222
222
|
const numericString = normalized.replace(/,/g, "");
|
|
223
223
|
const numberString = Number(numericString);
|
|
224
|
-
if (!
|
|
224
|
+
if (!chunkSYHPSOUU_cjs.isNaN(numberString) && chunkSYHPSOUU_cjs.isNonEmptyString(numericString)) {
|
|
225
225
|
return numberString;
|
|
226
226
|
}
|
|
227
227
|
return value.trim();
|
|
@@ -231,7 +231,7 @@ var convertType = (value) => {
|
|
|
231
231
|
|
|
232
232
|
var deepCloneSafe = (obj) => {
|
|
233
233
|
try {
|
|
234
|
-
if (
|
|
234
|
+
if (chunkSYHPSOUU_cjs.isFunction(structuredClone)) {
|
|
235
235
|
return structuredClone(obj);
|
|
236
236
|
}
|
|
237
237
|
} catch {
|
|
@@ -240,45 +240,45 @@ var deepCloneSafe = (obj) => {
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
var deleteNestedKey = (obj, path) => {
|
|
243
|
-
if (!
|
|
243
|
+
if (!chunkSYHPSOUU_cjs.isObjectOrArray(obj)) return obj;
|
|
244
244
|
const [currentKey, ...rest] = path;
|
|
245
|
-
if (
|
|
245
|
+
if (chunkSYHPSOUU_cjs.isArray(obj)) {
|
|
246
246
|
for (const item of obj) {
|
|
247
|
-
if (
|
|
247
|
+
if (chunkSYHPSOUU_cjs.isObjectOrArray(item)) deleteNestedKey(item, path);
|
|
248
248
|
}
|
|
249
|
-
} else if (
|
|
250
|
-
if (
|
|
251
|
-
} else if (
|
|
249
|
+
} else if (chunk7FGNVDEV_cjs.isEmptyArray(rest)) {
|
|
250
|
+
if (chunkSYHPSOUU_cjs.isPlainObject(obj)) delete obj[currentKey];
|
|
251
|
+
} else if (chunkSYHPSOUU_cjs.isPlainObject(obj) && chunkSYHPSOUU_cjs.isObjectOrArray(obj[currentKey])) {
|
|
252
252
|
deleteNestedKey(obj[currentKey], rest);
|
|
253
253
|
}
|
|
254
254
|
return obj;
|
|
255
255
|
};
|
|
256
256
|
|
|
257
257
|
var deleteExactPathOnce = (obj, path) => {
|
|
258
|
-
if (!
|
|
258
|
+
if (!chunkSYHPSOUU_cjs.isPlainObject(obj)) return obj;
|
|
259
259
|
const [currentKey, ...rest] = path;
|
|
260
260
|
if (rest.length === 0) {
|
|
261
|
-
if (
|
|
262
|
-
} else if (
|
|
261
|
+
if (chunkSYHPSOUU_cjs.isPlainObject(obj)) delete obj[currentKey];
|
|
262
|
+
} else if (chunkSYHPSOUU_cjs.isPlainObject(obj[currentKey])) {
|
|
263
263
|
deleteExactPathOnce(obj[currentKey], rest);
|
|
264
264
|
}
|
|
265
265
|
return obj;
|
|
266
266
|
};
|
|
267
267
|
|
|
268
268
|
function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
269
|
-
if (
|
|
269
|
+
if (chunk7FGNVDEV_cjs.isEmptyObject(object, { checkSymbols: true }))
|
|
270
270
|
return {};
|
|
271
|
-
|
|
272
|
-
message: ({ currentType, validType }) => `Second parameter (\`keysToDelete\`) must be of type \`${validType}\` with value of { key: string, deep?: boolean } plain-object, but received: \`${currentType}\`, with value: \`${
|
|
271
|
+
chunkDLS3G6WQ_cjs.assertIsArray(keysToDelete, {
|
|
272
|
+
message: ({ currentType, validType }) => `Second parameter (\`keysToDelete\`) must be of type \`${validType}\` with value of { key: string, deep?: boolean } plain-object, but received: \`${currentType}\`, with value: \`${chunkDAPAK2W3_cjs.safeStableStringify(
|
|
273
273
|
keysToDelete,
|
|
274
274
|
{
|
|
275
275
|
keepUndefined: true
|
|
276
276
|
}
|
|
277
277
|
)}\`.`
|
|
278
278
|
});
|
|
279
|
-
if (!keysToDelete.every((k) =>
|
|
279
|
+
if (!keysToDelete.every((k) => chunkSYHPSOUU_cjs.isPlainObject(k) && "key" in k)) {
|
|
280
280
|
throw new TypeError(
|
|
281
|
-
`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${
|
|
281
|
+
`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${chunkDAPAK2W3_cjs.safeStableStringify(
|
|
282
282
|
keysToDelete,
|
|
283
283
|
{
|
|
284
284
|
keepUndefined: true
|
|
@@ -288,12 +288,12 @@ function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
|
288
288
|
}
|
|
289
289
|
let result = deepClone ? deepCloneSafe(object) : object;
|
|
290
290
|
for (const { key, deep } of keysToDelete) {
|
|
291
|
-
|
|
291
|
+
chunkWXFTVXBF_cjs.assertIsString(key, {
|
|
292
292
|
message: ({ currentType, validType }) => `Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
293
293
|
});
|
|
294
|
-
if (!
|
|
294
|
+
if (!chunkSYHPSOUU_cjs.isUndefined(deep) && !chunkSYHPSOUU_cjs.isBoolean(deep)) {
|
|
295
295
|
throw new TypeError(
|
|
296
|
-
`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${
|
|
296
|
+
`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${chunkSYHPSOUU_cjs.getPreciseType(
|
|
297
297
|
deep
|
|
298
298
|
)}\`.`
|
|
299
299
|
);
|
|
@@ -305,48 +305,48 @@ function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
function toNumberDeep(input, options = {}) {
|
|
308
|
-
|
|
308
|
+
chunkSYHPSOUU_cjs.assertIsPlainObject(options, {
|
|
309
309
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
310
310
|
});
|
|
311
|
-
const removeEmptyObjects =
|
|
312
|
-
const removeEmptyArrays =
|
|
311
|
+
const removeEmptyObjects = chunkSYHPSOUU_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
312
|
+
const removeEmptyArrays = chunkSYHPSOUU_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
313
313
|
function _internal(input2, options2) {
|
|
314
|
-
if (
|
|
314
|
+
if (chunkSYHPSOUU_cjs.isNil(input2) || chunkGIKL4PUF_cjs.isRegExp(input2)) return void 0;
|
|
315
315
|
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
316
|
-
if (!
|
|
316
|
+
if (!chunkSYHPSOUU_cjs.isBoolean(removeEmptyObjects2) || !chunkSYHPSOUU_cjs.isBoolean(removeEmptyArrays2)) {
|
|
317
317
|
throw new TypeError(
|
|
318
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${
|
|
318
|
+
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkSYHPSOUU_cjs.getPreciseType(
|
|
319
319
|
removeEmptyObjects2
|
|
320
|
-
)}\`, 'removeEmptyArrays': \`${
|
|
320
|
+
)}\`, 'removeEmptyArrays': \`${chunkSYHPSOUU_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
321
321
|
);
|
|
322
322
|
}
|
|
323
|
-
if (
|
|
323
|
+
if (chunkSYHPSOUU_cjs.isNumber(input2) || chunkSYHPSOUU_cjs.isBoolean(input2) || chunkSYHPSOUU_cjs.isNonEmptyString(input2)) {
|
|
324
324
|
const num = Number(input2);
|
|
325
|
-
return
|
|
325
|
+
return chunkSYHPSOUU_cjs.isInfinityNumber(num) || chunkSYHPSOUU_cjs.isNaN(num) ? void 0 : num;
|
|
326
326
|
}
|
|
327
|
-
if (
|
|
327
|
+
if (chunkSYHPSOUU_cjs.isNumberObject(input2) || chunkSYHPSOUU_cjs.isStringObject(input2) || chunkSYHPSOUU_cjs.isBooleanObject(input2)) {
|
|
328
328
|
const valOf = Number(input2.valueOf());
|
|
329
|
-
return
|
|
329
|
+
return chunkSYHPSOUU_cjs.isInfinityNumber(valOf) || chunkSYHPSOUU_cjs.isNaN(valOf) ? void 0 : valOf;
|
|
330
330
|
}
|
|
331
|
-
if (
|
|
331
|
+
if (chunkDAPAK2W3_cjs.isDate(input2, { skipInvalidDate: true })) {
|
|
332
332
|
try {
|
|
333
|
-
return !
|
|
333
|
+
return !chunkSYHPSOUU_cjs.isNaN(input2.getTime()) ? input2.getTime() : 0;
|
|
334
334
|
} catch {
|
|
335
335
|
return 0;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
if (
|
|
338
|
+
if (chunkSYHPSOUU_cjs.isBuffer(input2)) {
|
|
339
339
|
const arr = Array.from(input2).map(
|
|
340
340
|
(n) => _internal(n, {
|
|
341
341
|
removeEmptyObjects: removeEmptyObjects2,
|
|
342
342
|
removeEmptyArrays: removeEmptyArrays2,
|
|
343
343
|
isRoot: false
|
|
344
344
|
})
|
|
345
|
-
).filter((item) => !
|
|
346
|
-
if (removeEmptyArrays2 &&
|
|
345
|
+
).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
346
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(arr)) return void 0;
|
|
347
347
|
return arr;
|
|
348
348
|
}
|
|
349
|
-
if (
|
|
349
|
+
if (chunkSU3UELUB_cjs.isTypedArray(input2)) {
|
|
350
350
|
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
351
351
|
const newArray = Array.from(input2).map(
|
|
352
352
|
(item) => _internal(item, {
|
|
@@ -354,8 +354,8 @@ function toNumberDeep(input, options = {}) {
|
|
|
354
354
|
removeEmptyArrays: removeEmptyArrays2,
|
|
355
355
|
isRoot: false
|
|
356
356
|
})
|
|
357
|
-
).filter((item) => !
|
|
358
|
-
if (removeEmptyArrays2 &&
|
|
357
|
+
).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
358
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
359
359
|
return newArray;
|
|
360
360
|
} else {
|
|
361
361
|
const newArray = Array.from(input2).map(
|
|
@@ -364,23 +364,23 @@ function toNumberDeep(input, options = {}) {
|
|
|
364
364
|
removeEmptyArrays: removeEmptyArrays2,
|
|
365
365
|
isRoot: false
|
|
366
366
|
})
|
|
367
|
-
).filter((item) => !
|
|
368
|
-
if (removeEmptyArrays2 &&
|
|
367
|
+
).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
368
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
369
369
|
return newArray;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
if (
|
|
372
|
+
if (chunkSYHPSOUU_cjs.isSet(input2)) {
|
|
373
373
|
const newArray = Array.from(input2).map(
|
|
374
374
|
(item) => _internal(item, {
|
|
375
375
|
removeEmptyObjects: removeEmptyObjects2,
|
|
376
376
|
removeEmptyArrays: removeEmptyArrays2,
|
|
377
377
|
isRoot: false
|
|
378
378
|
})
|
|
379
|
-
).filter((item) => !
|
|
380
|
-
if (removeEmptyArrays2 &&
|
|
379
|
+
).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
380
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
381
381
|
return newArray;
|
|
382
382
|
}
|
|
383
|
-
if (
|
|
383
|
+
if (chunkDAPAK2W3_cjs.isMap(input2)) {
|
|
384
384
|
let newArray = Array.from(input2.entries()).map(([k, v]) => {
|
|
385
385
|
const key = _internal(k, {
|
|
386
386
|
removeEmptyObjects: removeEmptyObjects2,
|
|
@@ -392,26 +392,26 @@ function toNumberDeep(input, options = {}) {
|
|
|
392
392
|
removeEmptyArrays: removeEmptyArrays2,
|
|
393
393
|
isRoot: false
|
|
394
394
|
});
|
|
395
|
-
return !
|
|
396
|
-
}).filter((item) => !
|
|
395
|
+
return !chunkSYHPSOUU_cjs.isUndefined(key) && !chunkSYHPSOUU_cjs.isUndefined(value) ? [key, value] : void 0;
|
|
396
|
+
}).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
397
397
|
if (removeEmptyArrays2) {
|
|
398
|
-
newArray = newArray.filter((v) => !
|
|
398
|
+
newArray = newArray.filter((v) => !chunk7FGNVDEV_cjs.isEmptyArray(v));
|
|
399
399
|
}
|
|
400
|
-
if (removeEmptyArrays2 &&
|
|
400
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
401
401
|
return newArray;
|
|
402
402
|
}
|
|
403
|
-
if (
|
|
403
|
+
if (chunkSYHPSOUU_cjs.isArray(input2)) {
|
|
404
404
|
const newArray = input2.map(
|
|
405
405
|
(item) => _internal(item, {
|
|
406
406
|
removeEmptyObjects: removeEmptyObjects2,
|
|
407
407
|
removeEmptyArrays: removeEmptyArrays2,
|
|
408
408
|
isRoot: false
|
|
409
409
|
})
|
|
410
|
-
).filter((item) => !
|
|
411
|
-
if (removeEmptyArrays2 &&
|
|
410
|
+
).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
411
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
412
412
|
return newArray;
|
|
413
413
|
}
|
|
414
|
-
if (
|
|
414
|
+
if (chunkSYHPSOUU_cjs.isObject(input2)) {
|
|
415
415
|
const newObject = {};
|
|
416
416
|
for (const [key, value] of Object.entries(input2)) {
|
|
417
417
|
const convertedValue = _internal(value, {
|
|
@@ -419,11 +419,11 @@ function toNumberDeep(input, options = {}) {
|
|
|
419
419
|
removeEmptyArrays: removeEmptyArrays2,
|
|
420
420
|
isRoot: false
|
|
421
421
|
});
|
|
422
|
-
if (!
|
|
422
|
+
if (!chunkSYHPSOUU_cjs.isUndefined(convertedValue)) {
|
|
423
423
|
newObject[key] = convertedValue;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
if (removeEmptyObjects2 &&
|
|
426
|
+
if (removeEmptyObjects2 && chunk7FGNVDEV_cjs.isEmptyObject(newObject)) {
|
|
427
427
|
return isRoot ? {} : void 0;
|
|
428
428
|
}
|
|
429
429
|
return newObject;
|
|
@@ -438,40 +438,40 @@ function toNumberDeep(input, options = {}) {
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
function toStringDeep(input, options = {}) {
|
|
441
|
-
|
|
441
|
+
chunkSYHPSOUU_cjs.assertIsPlainObject(options, {
|
|
442
442
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
443
443
|
});
|
|
444
|
-
const removeEmptyObjects =
|
|
445
|
-
const removeEmptyArrays =
|
|
444
|
+
const removeEmptyObjects = chunkSYHPSOUU_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
445
|
+
const removeEmptyArrays = chunkSYHPSOUU_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
446
446
|
function _internal(input2, options2) {
|
|
447
|
-
if (
|
|
447
|
+
if (chunkSYHPSOUU_cjs.isNil(input2) || chunkSYHPSOUU_cjs.isInfinityNumber(input2)) return void 0;
|
|
448
448
|
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
449
|
-
if (!
|
|
449
|
+
if (!chunkSYHPSOUU_cjs.isBoolean(removeEmptyObjects2) || !chunkSYHPSOUU_cjs.isBoolean(removeEmptyArrays2)) {
|
|
450
450
|
throw new TypeError(
|
|
451
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${
|
|
451
|
+
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkSYHPSOUU_cjs.getPreciseType(
|
|
452
452
|
removeEmptyObjects2
|
|
453
|
-
)}\`, 'removeEmptyArrays': \`${
|
|
453
|
+
)}\`, 'removeEmptyArrays': \`${chunkSYHPSOUU_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
454
454
|
);
|
|
455
455
|
}
|
|
456
|
-
if (
|
|
457
|
-
if (
|
|
456
|
+
if (chunkSYHPSOUU_cjs.isNumber(input2) || chunkSYHPSOUU_cjs.isString(input2) || chunkSYHPSOUU_cjs.isBoolean(input2)) return String(input2);
|
|
457
|
+
if (chunkSYHPSOUU_cjs.isNumberObject(input2)) {
|
|
458
458
|
const valOf = input2.valueOf();
|
|
459
|
-
return
|
|
459
|
+
return chunkSYHPSOUU_cjs.isInfinityNumber(valOf) || chunkSYHPSOUU_cjs.isNaN(valOf) ? void 0 : valOf.toString();
|
|
460
460
|
}
|
|
461
|
-
if (
|
|
462
|
-
if (
|
|
463
|
-
if (
|
|
461
|
+
if (chunkSYHPSOUU_cjs.isStringObject(input2)) return input2.valueOf();
|
|
462
|
+
if (chunkSYHPSOUU_cjs.isBooleanObject(input2)) return input2.valueOf().toString();
|
|
463
|
+
if (chunkDAPAK2W3_cjs.isDate(input2, { skipInvalidDate: true })) {
|
|
464
464
|
try {
|
|
465
465
|
return input2.toISOString();
|
|
466
466
|
} catch {
|
|
467
467
|
return input2.toString();
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
if (
|
|
471
|
-
if (
|
|
472
|
-
return Array.from(input2).map((v) => String(v)).filter((v) => !
|
|
470
|
+
if (chunkGIKL4PUF_cjs.isRegExp(input2)) return input2.toString();
|
|
471
|
+
if (chunkSYHPSOUU_cjs.isBuffer(input2)) {
|
|
472
|
+
return Array.from(input2).map((v) => String(v)).filter((v) => !chunkSYHPSOUU_cjs.isUndefined(v));
|
|
473
473
|
}
|
|
474
|
-
if (
|
|
474
|
+
if (chunkSU3UELUB_cjs.isTypedArray(input2)) {
|
|
475
475
|
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
476
476
|
const newArray = Array.from(input2).map(
|
|
477
477
|
(item) => _internal(item, {
|
|
@@ -479,8 +479,8 @@ function toStringDeep(input, options = {}) {
|
|
|
479
479
|
removeEmptyArrays: removeEmptyArrays2,
|
|
480
480
|
isRoot: false
|
|
481
481
|
})
|
|
482
|
-
).map((v) => String(v)).filter((item) => !
|
|
483
|
-
if (removeEmptyArrays2 &&
|
|
482
|
+
).map((v) => String(v)).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
483
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
484
484
|
return newArray;
|
|
485
485
|
} else {
|
|
486
486
|
const newArray = Array.from(input2).map(
|
|
@@ -489,41 +489,41 @@ function toStringDeep(input, options = {}) {
|
|
|
489
489
|
removeEmptyArrays: removeEmptyArrays2,
|
|
490
490
|
isRoot: false
|
|
491
491
|
})
|
|
492
|
-
).map((v) => String(v)).filter((item) => !
|
|
493
|
-
if (removeEmptyArrays2 &&
|
|
492
|
+
).map((v) => String(v)).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
493
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
494
494
|
return newArray;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
if (
|
|
497
|
+
if (chunkSYHPSOUU_cjs.isSet(input2)) {
|
|
498
498
|
const arr = Array.from(input2).map(
|
|
499
499
|
(v) => _internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
500
|
-
).filter((v) => !
|
|
501
|
-
if (removeEmptyArrays2 &&
|
|
500
|
+
).filter((v) => !chunkSYHPSOUU_cjs.isUndefined(v));
|
|
501
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(arr)) return void 0;
|
|
502
502
|
return arr;
|
|
503
503
|
}
|
|
504
|
-
if (
|
|
504
|
+
if (chunkDAPAK2W3_cjs.isMap(input2)) {
|
|
505
505
|
const arr = Array.from(input2.entries()).map(([k, v]) => [
|
|
506
506
|
_internal(k, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false }),
|
|
507
507
|
_internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
508
|
-
]).filter(([k, v]) => !
|
|
509
|
-
if (removeEmptyArrays2 &&
|
|
508
|
+
]).filter(([k, v]) => !chunkSYHPSOUU_cjs.isUndefined(k) && !chunkSYHPSOUU_cjs.isUndefined(v));
|
|
509
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(arr)) return void 0;
|
|
510
510
|
return arr;
|
|
511
511
|
}
|
|
512
|
-
if (
|
|
512
|
+
if (chunkSYHPSOUU_cjs.isArray(input2)) {
|
|
513
513
|
let newArray = input2.map(
|
|
514
514
|
(item) => _internal(item, {
|
|
515
515
|
removeEmptyObjects: removeEmptyObjects2,
|
|
516
516
|
removeEmptyArrays: removeEmptyArrays2,
|
|
517
517
|
isRoot: false
|
|
518
518
|
})
|
|
519
|
-
).filter((item) => !
|
|
519
|
+
).filter((item) => !chunkSYHPSOUU_cjs.isUndefined(item));
|
|
520
520
|
if (removeEmptyArrays2) {
|
|
521
|
-
newArray = newArray.filter((v) => !(
|
|
521
|
+
newArray = newArray.filter((v) => !(chunkSYHPSOUU_cjs.isArray(v) && v.length === 0));
|
|
522
522
|
}
|
|
523
|
-
if (removeEmptyArrays2 &&
|
|
523
|
+
if (removeEmptyArrays2 && chunk7FGNVDEV_cjs.isEmptyArray(newArray)) return void 0;
|
|
524
524
|
return newArray;
|
|
525
525
|
}
|
|
526
|
-
if (
|
|
526
|
+
if (chunkSYHPSOUU_cjs.isObject(input2)) {
|
|
527
527
|
const newObject = {};
|
|
528
528
|
for (const [key, value] of Object.entries(input2)) {
|
|
529
529
|
const convertedValue = _internal(value, {
|
|
@@ -531,9 +531,9 @@ function toStringDeep(input, options = {}) {
|
|
|
531
531
|
removeEmptyArrays: removeEmptyArrays2,
|
|
532
532
|
isRoot: false
|
|
533
533
|
});
|
|
534
|
-
if (!
|
|
534
|
+
if (!chunkSYHPSOUU_cjs.isUndefined(convertedValue)) {
|
|
535
535
|
newObject[key] = convertedValue;
|
|
536
|
-
} else if (
|
|
536
|
+
} else if (chunkSYHPSOUU_cjs.isArray(value) && !removeEmptyArrays2) {
|
|
537
537
|
newObject[key] = [];
|
|
538
538
|
}
|
|
539
539
|
}
|