@rzl-zone/utils-js 3.11.1 → 3.12.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/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +5 -5
- package/dist/assertions/index.js +5 -5
- package/dist/{chunk-TER22LO4.cjs → chunk-2AFQ33D3.cjs} +8 -8
- package/dist/{chunk-SZUNAEMR.js → chunk-2CYDJVGM.js} +6 -6
- package/dist/{chunk-6EDFZJZ5.cjs → chunk-2MW4JDQ2.cjs} +126 -126
- package/dist/{chunk-M7ELWZXM.cjs → chunk-2VTDXC3N.cjs} +9 -9
- package/dist/{chunk-6YGBRENU.js → chunk-44XX2P34.js} +3 -3
- package/dist/{chunk-WLOQQFDS.cjs → chunk-4YLBKLGS.cjs} +3 -3
- package/dist/{chunk-Q4GEQS7X.cjs → chunk-566CXQW7.cjs} +163 -167
- package/dist/{chunk-MV3TSQSH.cjs → chunk-57EPKYID.cjs} +71 -71
- package/dist/{chunk-2XSZ2ANI.js → chunk-5MGEC3YG.js} +2 -2
- package/dist/{chunk-HYN6FC5A.cjs → chunk-6EF52423.cjs} +34 -34
- package/dist/{chunk-LJHPTLWB.js → chunk-6SCOKU3S.js} +7 -7
- package/dist/{chunk-AXDYWO67.js → chunk-6VUXD3CF.js} +2 -2
- package/dist/{chunk-C2PV3VWC.cjs → chunk-7B76BSNK.cjs} +6 -6
- package/dist/{chunk-ZPDMWDGZ.cjs → chunk-7Y6I2DSU.cjs} +14 -14
- package/dist/{chunk-KXJ7X325.cjs → chunk-A7S7E2EE.cjs} +37 -37
- package/dist/{chunk-BPYW5YL7.js → chunk-AJZ6PMMZ.js} +2 -2
- package/dist/{chunk-PGNL7JXO.cjs → chunk-AXGBL2IO.cjs} +40 -40
- package/dist/{chunk-NLZLXWAU.cjs → chunk-B4TC6FBV.cjs} +9 -9
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/{chunk-3T6VSWYX.js → chunk-BKIJBNIE.js} +2 -2
- package/dist/{chunk-RBWZII5I.js → chunk-BNIMTFK5.js} +3 -3
- package/dist/{chunk-5WIEDF2J.js → chunk-BXW7YXB7.js} +4 -4
- package/dist/{chunk-22V4WP3H.js → chunk-CFYZC4S6.js} +4 -4
- package/dist/{chunk-MSUW5VHZ.js → chunk-CSG4SCL3.js} +10 -13
- package/dist/{chunk-JIE447J5.js → chunk-CWQW7AKK.js} +3 -3
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/{chunk-U7HHN47R.js → chunk-EN7LVZBZ.js} +12 -16
- package/dist/{chunk-EBYFYZW4.cjs → chunk-EV4Y7HCY.cjs} +4 -4
- package/dist/{chunk-NVRZPF5M.cjs → chunk-F66VDYIZ.cjs} +3 -3
- package/dist/{chunk-BMZZXZJ2.cjs → chunk-FLJX37EL.cjs} +4 -4
- package/dist/{chunk-SYHPSOUU.cjs → chunk-GKC3UDMC.cjs} +10 -13
- package/dist/{chunk-GIKL4PUF.cjs → chunk-H65I3GRZ.cjs} +10 -10
- package/dist/{chunk-HNBRGN4R.js → chunk-HHYWB7VZ.js} +2 -2
- package/dist/{chunk-MUHRPRR7.cjs → chunk-HNGGISFL.cjs} +3 -3
- package/dist/{chunk-B6PMNZ4M.cjs → chunk-HNSQAVSZ.cjs} +6 -6
- package/dist/{chunk-RZOGBYIS.js → chunk-HSP6IWZK.js} +3 -7
- package/dist/{chunk-IZGVBYFN.js → chunk-IDZS7J6T.js} +13 -13
- package/dist/{chunk-ENMRZ4BE.js → chunk-JS6R55VL.js} +3 -3
- package/dist/{chunk-WETQI6HM.js → chunk-JZVT5FK7.js} +9 -9
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-TJHGRQ4P.js → chunk-KIDJCMNJ.js} +2 -2
- package/dist/{chunk-7FGNVDEV.cjs → chunk-KOLEURVT.cjs} +7 -7
- package/dist/{chunk-K5536YHG.cjs → chunk-L4V53MQK.cjs} +50 -50
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-CCJ2MSN7.js → chunk-NODTV4F3.js} +2 -2
- package/dist/{chunk-QYI2VJLS.cjs → chunk-NYK5K3V2.cjs} +9 -9
- package/dist/{chunk-XPVTIGU2.cjs → chunk-ODUO3RTL.cjs} +26 -26
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/{chunk-ZVWZEGQP.js → chunk-PFXCTE37.js} +2 -2
- package/dist/{chunk-FJ4BQFVO.js → chunk-PPST7QAQ.js} +8 -8
- package/dist/{chunk-RMP7VMPB.cjs → chunk-Q5IMYDFL.cjs} +12 -12
- package/dist/{chunk-UIAWUZ4H.js → chunk-QFFBIOJ4.js} +4 -4
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/{chunk-DLS3G6WQ.cjs → chunk-RRQHMOPE.cjs} +4 -8
- package/dist/{chunk-BLF7SD66.js → chunk-RU5OSRBU.js} +3 -3
- package/dist/{chunk-GOFINGT6.js → chunk-SDMPEJ4F.js} +2 -2
- package/dist/{chunk-K47GZDBH.js → chunk-SYNL5IKP.js} +3 -3
- package/dist/{chunk-ULQPCIA2.js → chunk-TCDOWZQE.js} +2 -2
- package/dist/{chunk-DAPAK2W3.cjs → chunk-TQPGXGKB.cjs} +31 -31
- package/dist/{chunk-DNMCR5JH.js → chunk-TULOI4GL.js} +9 -9
- package/dist/{chunk-SU3UELUB.cjs → chunk-UBHCP4N5.cjs} +3 -3
- package/dist/{chunk-U23I7JPB.cjs → chunk-UCHF3M34.cjs} +15 -15
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/{chunk-XX6RUGTM.cjs → chunk-V3C4FYZL.cjs} +3 -3
- package/dist/{chunk-6LXWT2I5.js → chunk-VAAHZFBF.js} +2 -2
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/{chunk-GXKQ3LHF.js → chunk-WYP76WXB.js} +3 -3
- package/dist/{chunk-JXEIJM5M.cjs → chunk-YDE4ZBB7.cjs} +61 -61
- package/dist/{chunk-WXFTVXBF.cjs → chunk-YKQEOO7C.cjs} +4 -4
- package/dist/{chunk-BOYP3ARU.js → chunk-YSZC56SZ.js} +4 -4
- package/dist/chunk-YWHHVDT4.js +1 -1
- 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 +9 -9
- package/dist/generators/index.d.ts +1 -1
- package/dist/generators/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/{isPlainObject-0p3VveWr.d.ts → isPlainObject-DTJVV2Kf.d.ts} +5 -3
- package/dist/next/index.cjs +41 -39
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +13 -11
- 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 +6 -6
- package/dist/parsers/index.d.ts +1 -1
- package/dist/parsers/index.js +5 -5
- package/dist/predicates/index.cjs +77 -77
- package/dist/predicates/index.d.ts +6 -6
- package/dist/predicates/index.js +14 -14
- 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 -2
- 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 +13 -13
- package/dist/tailwind/index.d.ts +1 -1
- package/dist/tailwind/index.js +5 -5
- package/dist/urls/index.cjs +23 -23
- package/dist/urls/index.d.ts +1 -1
- package/dist/urls/index.js +16 -16
- package/package.json +18 -18
|
@@ -2,40 +2,40 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.12.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 chunkUBHCP4N5_cjs = require('./chunk-UBHCP4N5.cjs');
|
|
13
|
+
var chunkUCHF3M34_cjs = require('./chunk-UCHF3M34.cjs');
|
|
14
|
+
var chunk4YLBKLGS_cjs = require('./chunk-4YLBKLGS.cjs');
|
|
15
|
+
var chunkYKQEOO7C_cjs = require('./chunk-YKQEOO7C.cjs');
|
|
16
|
+
var chunkH65I3GRZ_cjs = require('./chunk-H65I3GRZ.cjs');
|
|
17
|
+
var chunkKOLEURVT_cjs = require('./chunk-KOLEURVT.cjs');
|
|
18
|
+
var chunkRRQHMOPE_cjs = require('./chunk-RRQHMOPE.cjs');
|
|
19
|
+
var chunkTQPGXGKB_cjs = require('./chunk-TQPGXGKB.cjs');
|
|
20
20
|
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
21
|
-
var
|
|
21
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
22
22
|
|
|
23
23
|
function toNumberArrayUnRecursive(array, options = {}) {
|
|
24
|
-
|
|
24
|
+
chunkGKC3UDMC_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 = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeInvalidValueNumber") ? options.removeInvalidValueNumber : true;
|
|
28
|
+
chunkGKC3UDMC_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 (chunkGKC3UDMC_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]) : chunkGKC3UDMC_cjs.isNull(x) ? null : void 0;
|
|
37
37
|
});
|
|
38
|
-
return riv ?
|
|
38
|
+
return riv ? chunkUCHF3M34_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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
47
47
|
forceToString
|
|
48
|
-
)}\`, with value: \`${
|
|
48
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(forceToString, {
|
|
49
49
|
keepUndefined: true
|
|
50
50
|
})}\`.`
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
if (
|
|
53
|
+
if (chunkGKC3UDMC_cjs.isNaN(value)) {
|
|
54
54
|
return forceToString === "primitives" || forceToString === "all" ? "NaN" : NaN;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (chunkGKC3UDMC_cjs.isString(value) || chunkGKC3UDMC_cjs.isNumber(value)) {
|
|
57
57
|
return forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
58
58
|
}
|
|
59
|
-
if (
|
|
59
|
+
if (chunkGKC3UDMC_cjs.isBoolean(value) || chunkUDA26MCU_cjs.isBigInt(value) || chunkGKC3UDMC_cjs.isNil(value)) {
|
|
60
60
|
return forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
62
|
+
if (chunkGKC3UDMC_cjs.isNumberObject(value) || chunkGKC3UDMC_cjs.isBooleanObject(value) || chunkGKC3UDMC_cjs.isStringObject(value)) {
|
|
63
63
|
return forceToString === "all" ? value.valueOf().toString() : value;
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
65
|
+
if (chunkGKC3UDMC_cjs.isSymbol(value)) {
|
|
66
66
|
return forceToString === "all" ? value.toString() : value;
|
|
67
67
|
}
|
|
68
|
-
if (
|
|
68
|
+
if (chunkGKC3UDMC_cjs.isFunction(value)) {
|
|
69
69
|
return forceToString === "all" ? value.toString() : value;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
71
|
+
if (chunkGKC3UDMC_cjs.isArray(value)) {
|
|
72
72
|
return value.map((v) => toStringDeepForce(v, forceToString));
|
|
73
73
|
}
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
74
|
+
if (chunkGKC3UDMC_cjs.isObjectOrArray(value)) {
|
|
75
|
+
if (chunkTQPGXGKB_cjs.isDate(value)) {
|
|
76
76
|
return forceToString === "all" ? value.toISOString() : value;
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
78
|
+
if (chunkH65I3GRZ_cjs.isRegExp(value)) {
|
|
79
79
|
return forceToString === "all" ? value.toString() : value;
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
81
|
+
if (chunkGKC3UDMC_cjs.isError(value) || value instanceof Promise) {
|
|
82
82
|
return forceToString === "all" ? value.toString() : value;
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
84
|
+
if (chunkGKC3UDMC_cjs.isSet(value)) {
|
|
85
85
|
return forceToString === "all" ? [...value].map((v) => toStringDeepForce(v, forceToString)) : value;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
87
|
+
if (chunkTQPGXGKB_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 (chunkGKC3UDMC_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
|
+
chunkRRQHMOPE_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
|
+
chunkGKC3UDMC_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 = chunkGKC3UDMC_cjs.hasOwnProp(options, "flatten") ? options.flatten : false;
|
|
112
|
+
const forceToString = chunkGKC3UDMC_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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
116
116
|
forceToString
|
|
117
|
-
)}\`, with value: \`${
|
|
117
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(forceToString, {
|
|
118
118
|
keepUndefined: true
|
|
119
119
|
})}\`.`
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
chunkGKC3UDMC_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 = chunkGKC3UDMC_cjs.isArray(item) ? process(item) : toStringDeepForce(item, forceToString);
|
|
129
|
+
if (!seen.some((s) => chunkH65I3GRZ_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 (chunkGKC3UDMC_cjs.isArray(value)) {
|
|
138
138
|
return value.flatMap(deepFlatten);
|
|
139
139
|
}
|
|
140
|
-
if (
|
|
140
|
+
if (chunkGKC3UDMC_cjs.isSet(value)) {
|
|
141
141
|
return [...value].flatMap(deepFlatten);
|
|
142
142
|
}
|
|
143
|
-
if (
|
|
143
|
+
if (chunkTQPGXGKB_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 (chunkGKC3UDMC_cjs.isNil(value)) return false;
|
|
153
|
+
if (chunkGKC3UDMC_cjs.isString(value)) return chunkGKC3UDMC_cjs.isNonEmptyString(value);
|
|
154
|
+
if (chunkGKC3UDMC_cjs.isBoolean(value)) return value;
|
|
155
|
+
if (chunkGKC3UDMC_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
156
|
+
if (chunkGKC3UDMC_cjs.isArray(value) || chunkGKC3UDMC_cjs.isObject(value)) return chunkUBHCP4N5_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 (chunkGKC3UDMC_cjs.isNil(value)) return false;
|
|
162
|
+
if (chunkGKC3UDMC_cjs.isString(value)) return chunkGKC3UDMC_cjs.isNonEmptyString(value);
|
|
163
|
+
if (chunkGKC3UDMC_cjs.isBoolean(value)) return value;
|
|
164
|
+
if (chunkGKC3UDMC_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
165
|
+
if (chunkGKC3UDMC_cjs.isArray(value)) return value.some(toBooleanContentDeep);
|
|
166
|
+
if (chunkGKC3UDMC_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 (chunkGKC3UDMC_cjs.isNil(value)) return false;
|
|
172
|
+
if (!chunkGKC3UDMC_cjs.isPlainObject(options)) options = {};
|
|
173
|
+
const ci = chunkGKC3UDMC_cjs.hasOwnProp(options, "caseInsensitive") ? options.caseInsensitive : false;
|
|
174
|
+
const ts = chunkGKC3UDMC_cjs.hasOwnProp(options, "trimString") ? options.trimString : true;
|
|
175
|
+
const incInd = chunkGKC3UDMC_cjs.hasOwnProp(options, "includeIndeterminate") ? options.includeIndeterminate : false;
|
|
176
|
+
if (!chunkGKC3UDMC_cjs.isBoolean(ci) || !chunkGKC3UDMC_cjs.isBoolean(ts) || !chunkGKC3UDMC_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': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
179
179
|
ci
|
|
180
|
-
)}\`, 'trimString': \`${
|
|
180
|
+
)}\`, 'trimString': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
181
181
|
ts
|
|
182
|
-
)}\`, 'includeIndeterminate': \`${
|
|
182
|
+
)}\`, 'includeIndeterminate': \`${chunkGKC3UDMC_cjs.getPreciseType(incInd)}\`].`
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
185
|
+
if (chunkGKC3UDMC_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 (chunkGKC3UDMC_cjs.isNumber(value)) return value === 1;
|
|
194
|
+
if (chunkGKC3UDMC_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 (chunkGKC3UDMC_cjs.isNil(value)) return false;
|
|
200
|
+
if (chunkGKC3UDMC_cjs.isString(value)) return !chunk4YLBKLGS_cjs.isEmptyString(value);
|
|
201
|
+
if (chunkGKC3UDMC_cjs.isBoolean(value)) return value;
|
|
202
|
+
if (chunkGKC3UDMC_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
203
|
+
if (chunkGKC3UDMC_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 (chunkGKC3UDMC_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 (!chunkGKC3UDMC_cjs.isNaN(numberString) && chunkGKC3UDMC_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 (chunkGKC3UDMC_cjs.isFunction(structuredClone)) {
|
|
235
235
|
return structuredClone(obj);
|
|
236
236
|
}
|
|
237
237
|
} catch {
|
|
@@ -240,60 +240,56 @@ var deepCloneSafe = (obj) => {
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
var deleteNestedKey = (obj, path) => {
|
|
243
|
-
if (!
|
|
243
|
+
if (!chunkGKC3UDMC_cjs.isObjectOrArray(obj)) return obj;
|
|
244
244
|
const [currentKey, ...rest] = path;
|
|
245
|
-
if (
|
|
245
|
+
if (chunkGKC3UDMC_cjs.isArray(obj)) {
|
|
246
246
|
for (const item of obj) {
|
|
247
|
-
if (
|
|
247
|
+
if (chunkGKC3UDMC_cjs.isObjectOrArray(item)) deleteNestedKey(item, path);
|
|
248
248
|
}
|
|
249
|
-
} else if (
|
|
250
|
-
if (
|
|
251
|
-
} else if (
|
|
249
|
+
} else if (chunkKOLEURVT_cjs.isEmptyArray(rest)) {
|
|
250
|
+
if (chunkGKC3UDMC_cjs.isPlainObject(obj)) delete obj[currentKey];
|
|
251
|
+
} else if (chunkGKC3UDMC_cjs.isPlainObject(obj) && chunkGKC3UDMC_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 (!chunkGKC3UDMC_cjs.isPlainObject(obj)) return obj;
|
|
259
259
|
const [currentKey, ...rest] = path;
|
|
260
260
|
if (rest.length === 0) {
|
|
261
|
-
if (
|
|
262
|
-
} else if (
|
|
261
|
+
if (chunkGKC3UDMC_cjs.isPlainObject(obj)) delete obj[currentKey];
|
|
262
|
+
} else if (chunkGKC3UDMC_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 (chunkKOLEURVT_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
|
+
chunkRRQHMOPE_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: \`${chunkTQPGXGKB_cjs.safeStableStringify(
|
|
273
273
|
keysToDelete,
|
|
274
|
-
{
|
|
275
|
-
keepUndefined: true
|
|
276
|
-
}
|
|
274
|
+
{ keepUndefined: true }
|
|
277
275
|
)}\`.`
|
|
278
276
|
});
|
|
279
|
-
if (!keysToDelete.every((k) =>
|
|
277
|
+
if (!keysToDelete.every((k) => chunkGKC3UDMC_cjs.isPlainObject(k) && "key" in k)) {
|
|
280
278
|
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: \`${
|
|
279
|
+
`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${chunkTQPGXGKB_cjs.safeStableStringify(
|
|
282
280
|
keysToDelete,
|
|
283
|
-
{
|
|
284
|
-
keepUndefined: true
|
|
285
|
-
}
|
|
281
|
+
{ keepUndefined: true }
|
|
286
282
|
)}\`.`
|
|
287
283
|
);
|
|
288
284
|
}
|
|
289
285
|
let result = deepClone ? deepCloneSafe(object) : object;
|
|
290
286
|
for (const { key, deep } of keysToDelete) {
|
|
291
|
-
|
|
287
|
+
chunkYKQEOO7C_cjs.assertIsString(key, {
|
|
292
288
|
message: ({ currentType, validType }) => `Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
293
289
|
});
|
|
294
|
-
if (!
|
|
290
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(deep) && !chunkGKC3UDMC_cjs.isBoolean(deep)) {
|
|
295
291
|
throw new TypeError(
|
|
296
|
-
`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${
|
|
292
|
+
`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
297
293
|
deep
|
|
298
294
|
)}\`.`
|
|
299
295
|
);
|
|
@@ -305,48 +301,48 @@ function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
|
305
301
|
}
|
|
306
302
|
|
|
307
303
|
function toNumberDeep(input, options = {}) {
|
|
308
|
-
|
|
304
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
309
305
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
310
306
|
});
|
|
311
|
-
const removeEmptyObjects =
|
|
312
|
-
const removeEmptyArrays =
|
|
307
|
+
const removeEmptyObjects = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
308
|
+
const removeEmptyArrays = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
313
309
|
function _internal(input2, options2) {
|
|
314
|
-
if (
|
|
310
|
+
if (chunkGKC3UDMC_cjs.isNil(input2) || chunkH65I3GRZ_cjs.isRegExp(input2)) return void 0;
|
|
315
311
|
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
316
|
-
if (!
|
|
312
|
+
if (!chunkGKC3UDMC_cjs.isBoolean(removeEmptyObjects2) || !chunkGKC3UDMC_cjs.isBoolean(removeEmptyArrays2)) {
|
|
317
313
|
throw new TypeError(
|
|
318
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${
|
|
314
|
+
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
319
315
|
removeEmptyObjects2
|
|
320
|
-
)}\`, 'removeEmptyArrays': \`${
|
|
316
|
+
)}\`, 'removeEmptyArrays': \`${chunkGKC3UDMC_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
321
317
|
);
|
|
322
318
|
}
|
|
323
|
-
if (
|
|
319
|
+
if (chunkGKC3UDMC_cjs.isNumber(input2) || chunkGKC3UDMC_cjs.isBoolean(input2) || chunkGKC3UDMC_cjs.isNonEmptyString(input2)) {
|
|
324
320
|
const num = Number(input2);
|
|
325
|
-
return
|
|
321
|
+
return chunkGKC3UDMC_cjs.isInfinityNumber(num) || chunkGKC3UDMC_cjs.isNaN(num) ? void 0 : num;
|
|
326
322
|
}
|
|
327
|
-
if (
|
|
323
|
+
if (chunkGKC3UDMC_cjs.isNumberObject(input2) || chunkGKC3UDMC_cjs.isStringObject(input2) || chunkGKC3UDMC_cjs.isBooleanObject(input2)) {
|
|
328
324
|
const valOf = Number(input2.valueOf());
|
|
329
|
-
return
|
|
325
|
+
return chunkGKC3UDMC_cjs.isInfinityNumber(valOf) || chunkGKC3UDMC_cjs.isNaN(valOf) ? void 0 : valOf;
|
|
330
326
|
}
|
|
331
|
-
if (
|
|
327
|
+
if (chunkTQPGXGKB_cjs.isDate(input2, { skipInvalidDate: true })) {
|
|
332
328
|
try {
|
|
333
|
-
return !
|
|
329
|
+
return !chunkGKC3UDMC_cjs.isNaN(input2.getTime()) ? input2.getTime() : 0;
|
|
334
330
|
} catch {
|
|
335
331
|
return 0;
|
|
336
332
|
}
|
|
337
333
|
}
|
|
338
|
-
if (
|
|
334
|
+
if (chunkGKC3UDMC_cjs.isBuffer(input2)) {
|
|
339
335
|
const arr = Array.from(input2).map(
|
|
340
336
|
(n) => _internal(n, {
|
|
341
337
|
removeEmptyObjects: removeEmptyObjects2,
|
|
342
338
|
removeEmptyArrays: removeEmptyArrays2,
|
|
343
339
|
isRoot: false
|
|
344
340
|
})
|
|
345
|
-
).filter((item) => !
|
|
346
|
-
if (removeEmptyArrays2 &&
|
|
341
|
+
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
342
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(arr)) return void 0;
|
|
347
343
|
return arr;
|
|
348
344
|
}
|
|
349
|
-
if (
|
|
345
|
+
if (chunkUBHCP4N5_cjs.isTypedArray(input2)) {
|
|
350
346
|
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
351
347
|
const newArray = Array.from(input2).map(
|
|
352
348
|
(item) => _internal(item, {
|
|
@@ -354,8 +350,8 @@ function toNumberDeep(input, options = {}) {
|
|
|
354
350
|
removeEmptyArrays: removeEmptyArrays2,
|
|
355
351
|
isRoot: false
|
|
356
352
|
})
|
|
357
|
-
).filter((item) => !
|
|
358
|
-
if (removeEmptyArrays2 &&
|
|
353
|
+
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
354
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
359
355
|
return newArray;
|
|
360
356
|
} else {
|
|
361
357
|
const newArray = Array.from(input2).map(
|
|
@@ -364,23 +360,23 @@ function toNumberDeep(input, options = {}) {
|
|
|
364
360
|
removeEmptyArrays: removeEmptyArrays2,
|
|
365
361
|
isRoot: false
|
|
366
362
|
})
|
|
367
|
-
).filter((item) => !
|
|
368
|
-
if (removeEmptyArrays2 &&
|
|
363
|
+
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
364
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
369
365
|
return newArray;
|
|
370
366
|
}
|
|
371
367
|
}
|
|
372
|
-
if (
|
|
368
|
+
if (chunkGKC3UDMC_cjs.isSet(input2)) {
|
|
373
369
|
const newArray = Array.from(input2).map(
|
|
374
370
|
(item) => _internal(item, {
|
|
375
371
|
removeEmptyObjects: removeEmptyObjects2,
|
|
376
372
|
removeEmptyArrays: removeEmptyArrays2,
|
|
377
373
|
isRoot: false
|
|
378
374
|
})
|
|
379
|
-
).filter((item) => !
|
|
380
|
-
if (removeEmptyArrays2 &&
|
|
375
|
+
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
376
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
381
377
|
return newArray;
|
|
382
378
|
}
|
|
383
|
-
if (
|
|
379
|
+
if (chunkTQPGXGKB_cjs.isMap(input2)) {
|
|
384
380
|
let newArray = Array.from(input2.entries()).map(([k, v]) => {
|
|
385
381
|
const key = _internal(k, {
|
|
386
382
|
removeEmptyObjects: removeEmptyObjects2,
|
|
@@ -392,26 +388,26 @@ function toNumberDeep(input, options = {}) {
|
|
|
392
388
|
removeEmptyArrays: removeEmptyArrays2,
|
|
393
389
|
isRoot: false
|
|
394
390
|
});
|
|
395
|
-
return !
|
|
396
|
-
}).filter((item) => !
|
|
391
|
+
return !chunkGKC3UDMC_cjs.isUndefined(key) && !chunkGKC3UDMC_cjs.isUndefined(value) ? [key, value] : void 0;
|
|
392
|
+
}).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
397
393
|
if (removeEmptyArrays2) {
|
|
398
|
-
newArray = newArray.filter((v) => !
|
|
394
|
+
newArray = newArray.filter((v) => !chunkKOLEURVT_cjs.isEmptyArray(v));
|
|
399
395
|
}
|
|
400
|
-
if (removeEmptyArrays2 &&
|
|
396
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
401
397
|
return newArray;
|
|
402
398
|
}
|
|
403
|
-
if (
|
|
399
|
+
if (chunkGKC3UDMC_cjs.isArray(input2)) {
|
|
404
400
|
const newArray = input2.map(
|
|
405
401
|
(item) => _internal(item, {
|
|
406
402
|
removeEmptyObjects: removeEmptyObjects2,
|
|
407
403
|
removeEmptyArrays: removeEmptyArrays2,
|
|
408
404
|
isRoot: false
|
|
409
405
|
})
|
|
410
|
-
).filter((item) => !
|
|
411
|
-
if (removeEmptyArrays2 &&
|
|
406
|
+
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
407
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
412
408
|
return newArray;
|
|
413
409
|
}
|
|
414
|
-
if (
|
|
410
|
+
if (chunkGKC3UDMC_cjs.isObject(input2)) {
|
|
415
411
|
const newObject = {};
|
|
416
412
|
for (const [key, value] of Object.entries(input2)) {
|
|
417
413
|
const convertedValue = _internal(value, {
|
|
@@ -419,11 +415,11 @@ function toNumberDeep(input, options = {}) {
|
|
|
419
415
|
removeEmptyArrays: removeEmptyArrays2,
|
|
420
416
|
isRoot: false
|
|
421
417
|
});
|
|
422
|
-
if (!
|
|
418
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(convertedValue)) {
|
|
423
419
|
newObject[key] = convertedValue;
|
|
424
420
|
}
|
|
425
421
|
}
|
|
426
|
-
if (removeEmptyObjects2 &&
|
|
422
|
+
if (removeEmptyObjects2 && chunkKOLEURVT_cjs.isEmptyObject(newObject)) {
|
|
427
423
|
return isRoot ? {} : void 0;
|
|
428
424
|
}
|
|
429
425
|
return newObject;
|
|
@@ -438,40 +434,40 @@ function toNumberDeep(input, options = {}) {
|
|
|
438
434
|
}
|
|
439
435
|
|
|
440
436
|
function toStringDeep(input, options = {}) {
|
|
441
|
-
|
|
437
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
442
438
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
443
439
|
});
|
|
444
|
-
const removeEmptyObjects =
|
|
445
|
-
const removeEmptyArrays =
|
|
440
|
+
const removeEmptyObjects = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
441
|
+
const removeEmptyArrays = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
446
442
|
function _internal(input2, options2) {
|
|
447
|
-
if (
|
|
443
|
+
if (chunkGKC3UDMC_cjs.isNil(input2) || chunkGKC3UDMC_cjs.isInfinityNumber(input2)) return void 0;
|
|
448
444
|
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
449
|
-
if (!
|
|
445
|
+
if (!chunkGKC3UDMC_cjs.isBoolean(removeEmptyObjects2) || !chunkGKC3UDMC_cjs.isBoolean(removeEmptyArrays2)) {
|
|
450
446
|
throw new TypeError(
|
|
451
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${
|
|
447
|
+
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
452
448
|
removeEmptyObjects2
|
|
453
|
-
)}\`, 'removeEmptyArrays': \`${
|
|
449
|
+
)}\`, 'removeEmptyArrays': \`${chunkGKC3UDMC_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
454
450
|
);
|
|
455
451
|
}
|
|
456
|
-
if (
|
|
457
|
-
if (
|
|
452
|
+
if (chunkGKC3UDMC_cjs.isNumber(input2) || chunkGKC3UDMC_cjs.isString(input2) || chunkGKC3UDMC_cjs.isBoolean(input2)) return String(input2);
|
|
453
|
+
if (chunkGKC3UDMC_cjs.isNumberObject(input2)) {
|
|
458
454
|
const valOf = input2.valueOf();
|
|
459
|
-
return
|
|
455
|
+
return chunkGKC3UDMC_cjs.isInfinityNumber(valOf) || chunkGKC3UDMC_cjs.isNaN(valOf) ? void 0 : valOf.toString();
|
|
460
456
|
}
|
|
461
|
-
if (
|
|
462
|
-
if (
|
|
463
|
-
if (
|
|
457
|
+
if (chunkGKC3UDMC_cjs.isStringObject(input2)) return input2.valueOf();
|
|
458
|
+
if (chunkGKC3UDMC_cjs.isBooleanObject(input2)) return input2.valueOf().toString();
|
|
459
|
+
if (chunkTQPGXGKB_cjs.isDate(input2, { skipInvalidDate: true })) {
|
|
464
460
|
try {
|
|
465
461
|
return input2.toISOString();
|
|
466
462
|
} catch {
|
|
467
463
|
return input2.toString();
|
|
468
464
|
}
|
|
469
465
|
}
|
|
470
|
-
if (
|
|
471
|
-
if (
|
|
472
|
-
return Array.from(input2).map((v) => String(v)).filter((v) => !
|
|
466
|
+
if (chunkH65I3GRZ_cjs.isRegExp(input2)) return input2.toString();
|
|
467
|
+
if (chunkGKC3UDMC_cjs.isBuffer(input2)) {
|
|
468
|
+
return Array.from(input2).map((v) => String(v)).filter((v) => !chunkGKC3UDMC_cjs.isUndefined(v));
|
|
473
469
|
}
|
|
474
|
-
if (
|
|
470
|
+
if (chunkUBHCP4N5_cjs.isTypedArray(input2)) {
|
|
475
471
|
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
476
472
|
const newArray = Array.from(input2).map(
|
|
477
473
|
(item) => _internal(item, {
|
|
@@ -479,8 +475,8 @@ function toStringDeep(input, options = {}) {
|
|
|
479
475
|
removeEmptyArrays: removeEmptyArrays2,
|
|
480
476
|
isRoot: false
|
|
481
477
|
})
|
|
482
|
-
).map((v) => String(v)).filter((item) => !
|
|
483
|
-
if (removeEmptyArrays2 &&
|
|
478
|
+
).map((v) => String(v)).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
479
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
484
480
|
return newArray;
|
|
485
481
|
} else {
|
|
486
482
|
const newArray = Array.from(input2).map(
|
|
@@ -489,41 +485,41 @@ function toStringDeep(input, options = {}) {
|
|
|
489
485
|
removeEmptyArrays: removeEmptyArrays2,
|
|
490
486
|
isRoot: false
|
|
491
487
|
})
|
|
492
|
-
).map((v) => String(v)).filter((item) => !
|
|
493
|
-
if (removeEmptyArrays2 &&
|
|
488
|
+
).map((v) => String(v)).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
489
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
494
490
|
return newArray;
|
|
495
491
|
}
|
|
496
492
|
}
|
|
497
|
-
if (
|
|
493
|
+
if (chunkGKC3UDMC_cjs.isSet(input2)) {
|
|
498
494
|
const arr = Array.from(input2).map(
|
|
499
495
|
(v) => _internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
500
|
-
).filter((v) => !
|
|
501
|
-
if (removeEmptyArrays2 &&
|
|
496
|
+
).filter((v) => !chunkGKC3UDMC_cjs.isUndefined(v));
|
|
497
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(arr)) return void 0;
|
|
502
498
|
return arr;
|
|
503
499
|
}
|
|
504
|
-
if (
|
|
500
|
+
if (chunkTQPGXGKB_cjs.isMap(input2)) {
|
|
505
501
|
const arr = Array.from(input2.entries()).map(([k, v]) => [
|
|
506
502
|
_internal(k, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false }),
|
|
507
503
|
_internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
508
|
-
]).filter(([k, v]) => !
|
|
509
|
-
if (removeEmptyArrays2 &&
|
|
504
|
+
]).filter(([k, v]) => !chunkGKC3UDMC_cjs.isUndefined(k) && !chunkGKC3UDMC_cjs.isUndefined(v));
|
|
505
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(arr)) return void 0;
|
|
510
506
|
return arr;
|
|
511
507
|
}
|
|
512
|
-
if (
|
|
508
|
+
if (chunkGKC3UDMC_cjs.isArray(input2)) {
|
|
513
509
|
let newArray = input2.map(
|
|
514
510
|
(item) => _internal(item, {
|
|
515
511
|
removeEmptyObjects: removeEmptyObjects2,
|
|
516
512
|
removeEmptyArrays: removeEmptyArrays2,
|
|
517
513
|
isRoot: false
|
|
518
514
|
})
|
|
519
|
-
).filter((item) => !
|
|
515
|
+
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
520
516
|
if (removeEmptyArrays2) {
|
|
521
|
-
newArray = newArray.filter((v) => !(
|
|
517
|
+
newArray = newArray.filter((v) => !(chunkGKC3UDMC_cjs.isArray(v) && v.length === 0));
|
|
522
518
|
}
|
|
523
|
-
if (removeEmptyArrays2 &&
|
|
519
|
+
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
524
520
|
return newArray;
|
|
525
521
|
}
|
|
526
|
-
if (
|
|
522
|
+
if (chunkGKC3UDMC_cjs.isObject(input2)) {
|
|
527
523
|
const newObject = {};
|
|
528
524
|
for (const [key, value] of Object.entries(input2)) {
|
|
529
525
|
const convertedValue = _internal(value, {
|
|
@@ -531,9 +527,9 @@ function toStringDeep(input, options = {}) {
|
|
|
531
527
|
removeEmptyArrays: removeEmptyArrays2,
|
|
532
528
|
isRoot: false
|
|
533
529
|
});
|
|
534
|
-
if (!
|
|
530
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(convertedValue)) {
|
|
535
531
|
newObject[key] = convertedValue;
|
|
536
|
-
} else if (
|
|
532
|
+
} else if (chunkGKC3UDMC_cjs.isArray(value) && !removeEmptyArrays2) {
|
|
537
533
|
newObject[key] = [];
|
|
538
534
|
}
|
|
539
535
|
}
|