@rzl-zone/utils-js 3.5.2 → 3.5.4
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-CDCERIZ2.js → chunk-2RZGZEE2.js} +3 -3
- 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-2WA36TC5.cjs → chunk-ME7Q2M5I.cjs} +22 -22
- 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-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-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 +11 -11
- package/dist/tailwind/index.d.ts +1 -1
- package/dist/tailwind/index.js +4 -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 +50 -1
|
@@ -2,40 +2,40 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.5.
|
|
5
|
+
* Version: 3.5.4.
|
|
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 chunkTFDXRT6D_cjs = require('./chunk-TFDXRT6D.cjs');
|
|
13
|
+
var chunkAKKM6MOX_cjs = require('./chunk-AKKM6MOX.cjs');
|
|
14
|
+
var chunkNREACG6M_cjs = require('./chunk-NREACG6M.cjs');
|
|
15
|
+
var chunkK63WO3XA_cjs = require('./chunk-K63WO3XA.cjs');
|
|
16
|
+
var chunk7QQV66RX_cjs = require('./chunk-7QQV66RX.cjs');
|
|
17
|
+
var chunkATLFMKAF_cjs = require('./chunk-ATLFMKAF.cjs');
|
|
18
|
+
var chunk7WBMA2VE_cjs = require('./chunk-7WBMA2VE.cjs');
|
|
19
|
+
var chunkYC7AK3KX_cjs = require('./chunk-YC7AK3KX.cjs');
|
|
20
20
|
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
21
|
-
var
|
|
21
|
+
var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
|
|
22
22
|
|
|
23
23
|
function toNumberArrayUnRecursive(array, options = {}) {
|
|
24
|
-
|
|
24
|
+
chunkF3WBQKRI_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 = chunkF3WBQKRI_cjs.hasOwnProp(options, "removeInvalidValueNumber") ? options.removeInvalidValueNumber : true;
|
|
28
|
+
chunkF3WBQKRI_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 (chunkF3WBQKRI_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]) : chunkF3WBQKRI_cjs.isNull(x) ? null : void 0;
|
|
37
37
|
});
|
|
38
|
-
return riv ?
|
|
38
|
+
return riv ? chunkAKKM6MOX_cjs.filterNilArray(result) : result;
|
|
39
39
|
}
|
|
40
40
|
return void 0;
|
|
41
41
|
}
|
|
@@ -43,53 +43,53 @@ 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: \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
47
47
|
forceToString
|
|
48
|
-
)}\`, with value: \`${
|
|
48
|
+
)}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(forceToString)}\`.`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
if (
|
|
51
|
+
if (chunkF3WBQKRI_cjs.isNaN(value)) {
|
|
52
52
|
return forceToString === "primitives" || forceToString === "all" ? "NaN" : NaN;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
54
|
+
if (chunkF3WBQKRI_cjs.isString(value) || chunkF3WBQKRI_cjs.isNumber(value)) {
|
|
55
55
|
return forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
56
56
|
}
|
|
57
|
-
if (
|
|
57
|
+
if (chunkF3WBQKRI_cjs.isBoolean(value) || chunkUDA26MCU_cjs.isBigInt(value) || chunkF3WBQKRI_cjs.isNil(value)) {
|
|
58
58
|
return forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
59
59
|
}
|
|
60
|
-
if (
|
|
60
|
+
if (chunkF3WBQKRI_cjs.isNumberObject(value) || chunkF3WBQKRI_cjs.isBooleanObject(value) || chunkF3WBQKRI_cjs.isStringObject(value)) {
|
|
61
61
|
return forceToString === "all" ? value.valueOf().toString() : value;
|
|
62
62
|
}
|
|
63
|
-
if (
|
|
63
|
+
if (chunkF3WBQKRI_cjs.isSymbol(value)) {
|
|
64
64
|
return forceToString === "all" ? value.toString() : value;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
66
|
+
if (chunkF3WBQKRI_cjs.isFunction(value)) {
|
|
67
67
|
return forceToString === "all" ? value.toString() : value;
|
|
68
68
|
}
|
|
69
|
-
if (
|
|
69
|
+
if (chunkF3WBQKRI_cjs.isArray(value)) {
|
|
70
70
|
return value.map((v) => toStringDeepForce(v, forceToString));
|
|
71
71
|
}
|
|
72
|
-
if (
|
|
73
|
-
if (
|
|
72
|
+
if (chunkF3WBQKRI_cjs.isObjectOrArray(value)) {
|
|
73
|
+
if (chunkYC7AK3KX_cjs.isDate(value)) {
|
|
74
74
|
return forceToString === "all" ? value.toISOString() : value;
|
|
75
75
|
}
|
|
76
|
-
if (
|
|
76
|
+
if (chunk7QQV66RX_cjs.isRegExp(value)) {
|
|
77
77
|
return forceToString === "all" ? value.toString() : value;
|
|
78
78
|
}
|
|
79
|
-
if (
|
|
79
|
+
if (chunkF3WBQKRI_cjs.isError(value) || value instanceof Promise) {
|
|
80
80
|
return forceToString === "all" ? value.toString() : value;
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
82
|
+
if (chunkF3WBQKRI_cjs.isSet(value)) {
|
|
83
83
|
return forceToString === "all" ? [...value].map((v) => toStringDeepForce(v, forceToString)) : value;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
85
|
+
if (chunkYC7AK3KX_cjs.isMap(value)) {
|
|
86
86
|
return forceToString === "all" ? [...value.entries()].map(([k, v]) => [
|
|
87
87
|
toStringDeepForce(k, forceToString),
|
|
88
88
|
toStringDeepForce(v, forceToString)
|
|
89
89
|
]) : value;
|
|
90
90
|
}
|
|
91
91
|
const result = {};
|
|
92
|
-
if (
|
|
92
|
+
if (chunkF3WBQKRI_cjs.isObject(value)) {
|
|
93
93
|
for (const key of Object.keys(value)) {
|
|
94
94
|
result[key] = toStringDeepForce(value[key], forceToString);
|
|
95
95
|
}
|
|
@@ -100,29 +100,29 @@ function toStringDeepForce(value, forceToString) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
var dedupeArray = (inputArray, options = {}) => {
|
|
103
|
-
|
|
103
|
+
chunk7WBMA2VE_cjs.assertIsArray(inputArray, {
|
|
104
104
|
message: ({ currentType, validType }) => `First parameter (\`inputArray\`) must be of type \`${validType}\` (array literal or instance), but received: \`${currentType}\`.`
|
|
105
105
|
});
|
|
106
|
-
|
|
106
|
+
chunkF3WBQKRI_cjs.assertIsPlainObject(options, {
|
|
107
107
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
108
108
|
});
|
|
109
|
-
const flatten =
|
|
110
|
-
const forceToString =
|
|
109
|
+
const flatten = chunkF3WBQKRI_cjs.hasOwnProp(options, "flatten") ? options.flatten : false;
|
|
110
|
+
const forceToString = chunkF3WBQKRI_cjs.hasOwnProp(options, "forceToString") ? options.forceToString : false;
|
|
111
111
|
if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
|
|
112
112
|
throw new TypeError(
|
|
113
|
-
`Parameter \`forceToString\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${
|
|
113
|
+
`Parameter \`forceToString\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
114
114
|
forceToString
|
|
115
|
-
)}\`, with value: \`${
|
|
115
|
+
)}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(forceToString)}\`.`
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
chunkF3WBQKRI_cjs.assertIsBoolean(flatten, {
|
|
119
119
|
message: ({ currentType, validType }) => `Parameter \`flatten\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
120
120
|
});
|
|
121
121
|
const process = (arr) => {
|
|
122
122
|
const seen = [];
|
|
123
123
|
return arr.reduce((acc, item) => {
|
|
124
|
-
const value =
|
|
125
|
-
if (!seen.some((s) =>
|
|
124
|
+
const value = chunkF3WBQKRI_cjs.isArray(item) ? process(item) : toStringDeepForce(item, forceToString);
|
|
125
|
+
if (!seen.some((s) => chunk7QQV66RX_cjs.isEqual(s, value))) {
|
|
126
126
|
seen.push(value);
|
|
127
127
|
acc.push(value);
|
|
128
128
|
}
|
|
@@ -130,13 +130,13 @@ var dedupeArray = (inputArray, options = {}) => {
|
|
|
130
130
|
}, []);
|
|
131
131
|
};
|
|
132
132
|
const deepFlatten = (value) => {
|
|
133
|
-
if (
|
|
133
|
+
if (chunkF3WBQKRI_cjs.isArray(value)) {
|
|
134
134
|
return value.flatMap(deepFlatten);
|
|
135
135
|
}
|
|
136
|
-
if (
|
|
136
|
+
if (chunkF3WBQKRI_cjs.isSet(value)) {
|
|
137
137
|
return [...value].flatMap(deepFlatten);
|
|
138
138
|
}
|
|
139
|
-
if (
|
|
139
|
+
if (chunkYC7AK3KX_cjs.isMap(value)) {
|
|
140
140
|
return [...value.values()].flatMap(deepFlatten);
|
|
141
141
|
}
|
|
142
142
|
return [value];
|
|
@@ -145,40 +145,40 @@ var dedupeArray = (inputArray, options = {}) => {
|
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
var toBooleanContent = (value) => {
|
|
148
|
-
if (
|
|
149
|
-
if (
|
|
150
|
-
if (
|
|
151
|
-
if (
|
|
152
|
-
if (
|
|
148
|
+
if (chunkF3WBQKRI_cjs.isNil(value)) return false;
|
|
149
|
+
if (chunkF3WBQKRI_cjs.isString(value)) return chunkF3WBQKRI_cjs.isNonEmptyString(value);
|
|
150
|
+
if (chunkF3WBQKRI_cjs.isBoolean(value)) return value;
|
|
151
|
+
if (chunkF3WBQKRI_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
152
|
+
if (chunkF3WBQKRI_cjs.isArray(value) || chunkF3WBQKRI_cjs.isObject(value)) return chunkTFDXRT6D_cjs.isNonEmptyValue(value);
|
|
153
153
|
return Boolean(value);
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
var toBooleanContentDeep = (value) => {
|
|
157
|
-
if (
|
|
158
|
-
if (
|
|
159
|
-
if (
|
|
160
|
-
if (
|
|
161
|
-
if (
|
|
162
|
-
if (
|
|
157
|
+
if (chunkF3WBQKRI_cjs.isNil(value)) return false;
|
|
158
|
+
if (chunkF3WBQKRI_cjs.isString(value)) return chunkF3WBQKRI_cjs.isNonEmptyString(value);
|
|
159
|
+
if (chunkF3WBQKRI_cjs.isBoolean(value)) return value;
|
|
160
|
+
if (chunkF3WBQKRI_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
161
|
+
if (chunkF3WBQKRI_cjs.isArray(value)) return value.some(toBooleanContentDeep);
|
|
162
|
+
if (chunkF3WBQKRI_cjs.isObject(value)) return Object.values(value).some(toBooleanContentDeep);
|
|
163
163
|
return false;
|
|
164
164
|
};
|
|
165
165
|
|
|
166
166
|
var toBooleanExplicit = (value, options = {}) => {
|
|
167
|
-
if (
|
|
168
|
-
if (!
|
|
169
|
-
const ci =
|
|
170
|
-
const ts =
|
|
171
|
-
const incInd =
|
|
172
|
-
if (!
|
|
167
|
+
if (chunkF3WBQKRI_cjs.isNil(value)) return false;
|
|
168
|
+
if (!chunkF3WBQKRI_cjs.isPlainObject(options)) options = {};
|
|
169
|
+
const ci = chunkF3WBQKRI_cjs.hasOwnProp(options, "caseInsensitive") ? options.caseInsensitive : false;
|
|
170
|
+
const ts = chunkF3WBQKRI_cjs.hasOwnProp(options, "trimString") ? options.trimString : true;
|
|
171
|
+
const incInd = chunkF3WBQKRI_cjs.hasOwnProp(options, "includeIndeterminate") ? options.includeIndeterminate : false;
|
|
172
|
+
if (!chunkF3WBQKRI_cjs.isBoolean(ci) || !chunkF3WBQKRI_cjs.isBoolean(ts) || !chunkF3WBQKRI_cjs.isBoolean(incInd)) {
|
|
173
173
|
throw new TypeError(
|
|
174
|
-
`Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${
|
|
174
|
+
`Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
175
175
|
ci
|
|
176
|
-
)}\`, 'trimString': \`${
|
|
176
|
+
)}\`, 'trimString': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
177
177
|
ts
|
|
178
|
-
)}\`, 'includeIndeterminate': \`${
|
|
178
|
+
)}\`, 'includeIndeterminate': \`${chunkF3WBQKRI_cjs.getPreciseType(incInd)}\`].`
|
|
179
179
|
);
|
|
180
180
|
}
|
|
181
|
-
if (
|
|
181
|
+
if (chunkF3WBQKRI_cjs.isString(value)) {
|
|
182
182
|
let normalized = value;
|
|
183
183
|
if (ts) normalized = normalized.trim();
|
|
184
184
|
if (ci) normalized = normalized.toLowerCase();
|
|
@@ -186,17 +186,17 @@ var toBooleanExplicit = (value, options = {}) => {
|
|
|
186
186
|
if (incInd) validTrueStrings.push("indeterminate");
|
|
187
187
|
return validTrueStrings.includes(normalized);
|
|
188
188
|
}
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
189
|
+
if (chunkF3WBQKRI_cjs.isNumber(value)) return value === 1;
|
|
190
|
+
if (chunkF3WBQKRI_cjs.isBoolean(value)) return value;
|
|
191
191
|
return false;
|
|
192
192
|
};
|
|
193
193
|
|
|
194
194
|
var toBooleanLoose = (value) => {
|
|
195
|
-
if (
|
|
196
|
-
if (
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
if (
|
|
195
|
+
if (chunkF3WBQKRI_cjs.isNil(value)) return false;
|
|
196
|
+
if (chunkF3WBQKRI_cjs.isString(value)) return !chunkNREACG6M_cjs.isEmptyString(value);
|
|
197
|
+
if (chunkF3WBQKRI_cjs.isBoolean(value)) return value;
|
|
198
|
+
if (chunkF3WBQKRI_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
|
|
199
|
+
if (chunkF3WBQKRI_cjs.isArray(value)) return value.length > 0;
|
|
200
200
|
return Boolean(value);
|
|
201
201
|
};
|
|
202
202
|
|
|
@@ -210,14 +210,14 @@ var convertType = (value) => {
|
|
|
210
210
|
yes: true,
|
|
211
211
|
no: false
|
|
212
212
|
};
|
|
213
|
-
if (
|
|
213
|
+
if (chunkF3WBQKRI_cjs.isString(value)) {
|
|
214
214
|
const normalized = value.trim().toLowerCase();
|
|
215
215
|
if (Object.prototype.hasOwnProperty.call(predefinedValues, normalized)) {
|
|
216
216
|
return predefinedValues[normalized];
|
|
217
217
|
}
|
|
218
218
|
const numericString = normalized.replace(/,/g, "");
|
|
219
219
|
const numberString = Number(numericString);
|
|
220
|
-
if (!
|
|
220
|
+
if (!chunkF3WBQKRI_cjs.isNaN(numberString) && chunkF3WBQKRI_cjs.isNonEmptyString(numericString)) {
|
|
221
221
|
return numberString;
|
|
222
222
|
}
|
|
223
223
|
return value.trim();
|
|
@@ -227,7 +227,7 @@ var convertType = (value) => {
|
|
|
227
227
|
|
|
228
228
|
var deepCloneSafe = (obj) => {
|
|
229
229
|
try {
|
|
230
|
-
if (
|
|
230
|
+
if (chunkF3WBQKRI_cjs.isFunction(structuredClone)) {
|
|
231
231
|
return structuredClone(obj);
|
|
232
232
|
}
|
|
233
233
|
} catch {
|
|
@@ -236,54 +236,54 @@ var deepCloneSafe = (obj) => {
|
|
|
236
236
|
};
|
|
237
237
|
|
|
238
238
|
var deleteNestedKey = (obj, path) => {
|
|
239
|
-
if (!
|
|
239
|
+
if (!chunkF3WBQKRI_cjs.isObjectOrArray(obj)) return obj;
|
|
240
240
|
const [currentKey, ...rest] = path;
|
|
241
|
-
if (
|
|
241
|
+
if (chunkF3WBQKRI_cjs.isArray(obj)) {
|
|
242
242
|
for (const item of obj) {
|
|
243
|
-
if (
|
|
243
|
+
if (chunkF3WBQKRI_cjs.isObjectOrArray(item)) deleteNestedKey(item, path);
|
|
244
244
|
}
|
|
245
|
-
} else if (
|
|
246
|
-
if (
|
|
247
|
-
} else if (
|
|
245
|
+
} else if (chunkATLFMKAF_cjs.isEmptyArray(rest)) {
|
|
246
|
+
if (chunkF3WBQKRI_cjs.isPlainObject(obj)) delete obj[currentKey];
|
|
247
|
+
} else if (chunkF3WBQKRI_cjs.isPlainObject(obj) && chunkF3WBQKRI_cjs.isObjectOrArray(obj[currentKey])) {
|
|
248
248
|
deleteNestedKey(obj[currentKey], rest);
|
|
249
249
|
}
|
|
250
250
|
return obj;
|
|
251
251
|
};
|
|
252
252
|
|
|
253
253
|
var deleteExactPathOnce = (obj, path) => {
|
|
254
|
-
if (!
|
|
254
|
+
if (!chunkF3WBQKRI_cjs.isPlainObject(obj)) return obj;
|
|
255
255
|
const [currentKey, ...rest] = path;
|
|
256
256
|
if (rest.length === 0) {
|
|
257
|
-
if (
|
|
258
|
-
} else if (
|
|
257
|
+
if (chunkF3WBQKRI_cjs.isPlainObject(obj)) delete obj[currentKey];
|
|
258
|
+
} else if (chunkF3WBQKRI_cjs.isPlainObject(obj[currentKey])) {
|
|
259
259
|
deleteExactPathOnce(obj[currentKey], rest);
|
|
260
260
|
}
|
|
261
261
|
return obj;
|
|
262
262
|
};
|
|
263
263
|
|
|
264
264
|
function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
265
|
-
if (
|
|
265
|
+
if (chunkATLFMKAF_cjs.isEmptyObject(object, { checkSymbols: true }))
|
|
266
266
|
return {};
|
|
267
|
-
|
|
268
|
-
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: \`${
|
|
267
|
+
chunk7WBMA2VE_cjs.assertIsArray(keysToDelete, {
|
|
268
|
+
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: \`${chunkYC7AK3KX_cjs.safeStableStringify(
|
|
269
269
|
keysToDelete
|
|
270
270
|
)}\`.`
|
|
271
271
|
});
|
|
272
|
-
if (!keysToDelete.every((k) =>
|
|
272
|
+
if (!keysToDelete.every((k) => chunkF3WBQKRI_cjs.isPlainObject(k) && "key" in k)) {
|
|
273
273
|
throw new TypeError(
|
|
274
|
-
`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${
|
|
274
|
+
`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${chunkYC7AK3KX_cjs.safeStableStringify(
|
|
275
275
|
keysToDelete
|
|
276
276
|
)}\`.`
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
279
|
let result = deepClone ? deepCloneSafe(object) : object;
|
|
280
280
|
for (const { key, deep } of keysToDelete) {
|
|
281
|
-
|
|
281
|
+
chunkK63WO3XA_cjs.assertIsString(key, {
|
|
282
282
|
message: ({ currentType, validType }) => `Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
283
283
|
});
|
|
284
|
-
if (!
|
|
284
|
+
if (!chunkF3WBQKRI_cjs.isUndefined(deep) && !chunkF3WBQKRI_cjs.isBoolean(deep)) {
|
|
285
285
|
throw new TypeError(
|
|
286
|
-
`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${
|
|
286
|
+
`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
287
287
|
deep
|
|
288
288
|
)}\`.`
|
|
289
289
|
);
|
|
@@ -295,48 +295,48 @@ function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
function toNumberDeep(input, options = {}) {
|
|
298
|
-
|
|
298
|
+
chunkF3WBQKRI_cjs.assertIsPlainObject(options, {
|
|
299
299
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
300
300
|
});
|
|
301
|
-
const removeEmptyObjects =
|
|
302
|
-
const removeEmptyArrays =
|
|
301
|
+
const removeEmptyObjects = chunkF3WBQKRI_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
302
|
+
const removeEmptyArrays = chunkF3WBQKRI_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
303
303
|
function _internal(input2, options2) {
|
|
304
|
-
if (
|
|
304
|
+
if (chunkF3WBQKRI_cjs.isNil(input2) || chunk7QQV66RX_cjs.isRegExp(input2)) return void 0;
|
|
305
305
|
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
306
|
-
if (!
|
|
306
|
+
if (!chunkF3WBQKRI_cjs.isBoolean(removeEmptyObjects2) || !chunkF3WBQKRI_cjs.isBoolean(removeEmptyArrays2)) {
|
|
307
307
|
throw new TypeError(
|
|
308
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${
|
|
308
|
+
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
309
309
|
removeEmptyObjects2
|
|
310
|
-
)}\`, 'removeEmptyArrays': \`${
|
|
310
|
+
)}\`, 'removeEmptyArrays': \`${chunkF3WBQKRI_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
311
311
|
);
|
|
312
312
|
}
|
|
313
|
-
if (
|
|
313
|
+
if (chunkF3WBQKRI_cjs.isNumber(input2) || chunkF3WBQKRI_cjs.isBoolean(input2) || chunkF3WBQKRI_cjs.isNonEmptyString(input2)) {
|
|
314
314
|
const num = Number(input2);
|
|
315
|
-
return
|
|
315
|
+
return chunkF3WBQKRI_cjs.isInfinityNumber(num) || chunkF3WBQKRI_cjs.isNaN(num) ? void 0 : num;
|
|
316
316
|
}
|
|
317
|
-
if (
|
|
317
|
+
if (chunkF3WBQKRI_cjs.isNumberObject(input2) || chunkF3WBQKRI_cjs.isStringObject(input2) || chunkF3WBQKRI_cjs.isBooleanObject(input2)) {
|
|
318
318
|
const valOf = Number(input2.valueOf());
|
|
319
|
-
return
|
|
319
|
+
return chunkF3WBQKRI_cjs.isInfinityNumber(valOf) || chunkF3WBQKRI_cjs.isNaN(valOf) ? void 0 : valOf;
|
|
320
320
|
}
|
|
321
|
-
if (
|
|
321
|
+
if (chunkYC7AK3KX_cjs.isDate(input2, { skipInvalidDate: true })) {
|
|
322
322
|
try {
|
|
323
|
-
return !
|
|
323
|
+
return !chunkF3WBQKRI_cjs.isNaN(input2.getTime()) ? input2.getTime() : 0;
|
|
324
324
|
} catch {
|
|
325
325
|
return 0;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
if (
|
|
328
|
+
if (chunkF3WBQKRI_cjs.isBuffer(input2)) {
|
|
329
329
|
const arr = Array.from(input2).map(
|
|
330
330
|
(n) => _internal(n, {
|
|
331
331
|
removeEmptyObjects: removeEmptyObjects2,
|
|
332
332
|
removeEmptyArrays: removeEmptyArrays2,
|
|
333
333
|
isRoot: false
|
|
334
334
|
})
|
|
335
|
-
).filter((item) => !
|
|
336
|
-
if (removeEmptyArrays2 &&
|
|
335
|
+
).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
336
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(arr)) return void 0;
|
|
337
337
|
return arr;
|
|
338
338
|
}
|
|
339
|
-
if (
|
|
339
|
+
if (chunkTFDXRT6D_cjs.isTypedArray(input2)) {
|
|
340
340
|
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
341
341
|
const newArray = Array.from(input2).map(
|
|
342
342
|
(item) => _internal(item, {
|
|
@@ -344,8 +344,8 @@ function toNumberDeep(input, options = {}) {
|
|
|
344
344
|
removeEmptyArrays: removeEmptyArrays2,
|
|
345
345
|
isRoot: false
|
|
346
346
|
})
|
|
347
|
-
).filter((item) => !
|
|
348
|
-
if (removeEmptyArrays2 &&
|
|
347
|
+
).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
348
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
349
349
|
return newArray;
|
|
350
350
|
} else {
|
|
351
351
|
const newArray = Array.from(input2).map(
|
|
@@ -354,23 +354,23 @@ function toNumberDeep(input, options = {}) {
|
|
|
354
354
|
removeEmptyArrays: removeEmptyArrays2,
|
|
355
355
|
isRoot: false
|
|
356
356
|
})
|
|
357
|
-
).filter((item) => !
|
|
358
|
-
if (removeEmptyArrays2 &&
|
|
357
|
+
).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
358
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
359
359
|
return newArray;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
if (
|
|
362
|
+
if (chunkF3WBQKRI_cjs.isSet(input2)) {
|
|
363
363
|
const newArray = Array.from(input2).map(
|
|
364
364
|
(item) => _internal(item, {
|
|
365
365
|
removeEmptyObjects: removeEmptyObjects2,
|
|
366
366
|
removeEmptyArrays: removeEmptyArrays2,
|
|
367
367
|
isRoot: false
|
|
368
368
|
})
|
|
369
|
-
).filter((item) => !
|
|
370
|
-
if (removeEmptyArrays2 &&
|
|
369
|
+
).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
370
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
371
371
|
return newArray;
|
|
372
372
|
}
|
|
373
|
-
if (
|
|
373
|
+
if (chunkYC7AK3KX_cjs.isMap(input2)) {
|
|
374
374
|
let newArray = Array.from(input2.entries()).map(([k, v]) => {
|
|
375
375
|
const key = _internal(k, {
|
|
376
376
|
removeEmptyObjects: removeEmptyObjects2,
|
|
@@ -382,26 +382,26 @@ function toNumberDeep(input, options = {}) {
|
|
|
382
382
|
removeEmptyArrays: removeEmptyArrays2,
|
|
383
383
|
isRoot: false
|
|
384
384
|
});
|
|
385
|
-
return !
|
|
386
|
-
}).filter((item) => !
|
|
385
|
+
return !chunkF3WBQKRI_cjs.isUndefined(key) && !chunkF3WBQKRI_cjs.isUndefined(value) ? [key, value] : void 0;
|
|
386
|
+
}).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
387
387
|
if (removeEmptyArrays2) {
|
|
388
|
-
newArray = newArray.filter((v) => !
|
|
388
|
+
newArray = newArray.filter((v) => !chunkATLFMKAF_cjs.isEmptyArray(v));
|
|
389
389
|
}
|
|
390
|
-
if (removeEmptyArrays2 &&
|
|
390
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
391
391
|
return newArray;
|
|
392
392
|
}
|
|
393
|
-
if (
|
|
393
|
+
if (chunkF3WBQKRI_cjs.isArray(input2)) {
|
|
394
394
|
const newArray = input2.map(
|
|
395
395
|
(item) => _internal(item, {
|
|
396
396
|
removeEmptyObjects: removeEmptyObjects2,
|
|
397
397
|
removeEmptyArrays: removeEmptyArrays2,
|
|
398
398
|
isRoot: false
|
|
399
399
|
})
|
|
400
|
-
).filter((item) => !
|
|
401
|
-
if (removeEmptyArrays2 &&
|
|
400
|
+
).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
401
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
402
402
|
return newArray;
|
|
403
403
|
}
|
|
404
|
-
if (
|
|
404
|
+
if (chunkF3WBQKRI_cjs.isObject(input2)) {
|
|
405
405
|
const newObject = {};
|
|
406
406
|
for (const [key, value] of Object.entries(input2)) {
|
|
407
407
|
const convertedValue = _internal(value, {
|
|
@@ -409,11 +409,11 @@ function toNumberDeep(input, options = {}) {
|
|
|
409
409
|
removeEmptyArrays: removeEmptyArrays2,
|
|
410
410
|
isRoot: false
|
|
411
411
|
});
|
|
412
|
-
if (!
|
|
412
|
+
if (!chunkF3WBQKRI_cjs.isUndefined(convertedValue)) {
|
|
413
413
|
newObject[key] = convertedValue;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
if (removeEmptyObjects2 &&
|
|
416
|
+
if (removeEmptyObjects2 && chunkATLFMKAF_cjs.isEmptyObject(newObject)) {
|
|
417
417
|
return isRoot ? {} : void 0;
|
|
418
418
|
}
|
|
419
419
|
return newObject;
|
|
@@ -428,40 +428,40 @@ function toNumberDeep(input, options = {}) {
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
function toStringDeep(input, options = {}) {
|
|
431
|
-
|
|
431
|
+
chunkF3WBQKRI_cjs.assertIsPlainObject(options, {
|
|
432
432
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
433
433
|
});
|
|
434
|
-
const removeEmptyObjects =
|
|
435
|
-
const removeEmptyArrays =
|
|
434
|
+
const removeEmptyObjects = chunkF3WBQKRI_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
435
|
+
const removeEmptyArrays = chunkF3WBQKRI_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
436
436
|
function _internal(input2, options2) {
|
|
437
|
-
if (
|
|
437
|
+
if (chunkF3WBQKRI_cjs.isNil(input2) || chunkF3WBQKRI_cjs.isInfinityNumber(input2)) return void 0;
|
|
438
438
|
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
439
|
-
if (!
|
|
439
|
+
if (!chunkF3WBQKRI_cjs.isBoolean(removeEmptyObjects2) || !chunkF3WBQKRI_cjs.isBoolean(removeEmptyArrays2)) {
|
|
440
440
|
throw new TypeError(
|
|
441
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${
|
|
441
|
+
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkF3WBQKRI_cjs.getPreciseType(
|
|
442
442
|
removeEmptyObjects2
|
|
443
|
-
)}\`, 'removeEmptyArrays': \`${
|
|
443
|
+
)}\`, 'removeEmptyArrays': \`${chunkF3WBQKRI_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
|
-
if (
|
|
447
|
-
if (
|
|
446
|
+
if (chunkF3WBQKRI_cjs.isNumber(input2) || chunkF3WBQKRI_cjs.isString(input2) || chunkF3WBQKRI_cjs.isBoolean(input2)) return String(input2);
|
|
447
|
+
if (chunkF3WBQKRI_cjs.isNumberObject(input2)) {
|
|
448
448
|
const valOf = input2.valueOf();
|
|
449
|
-
return
|
|
449
|
+
return chunkF3WBQKRI_cjs.isInfinityNumber(valOf) || chunkF3WBQKRI_cjs.isNaN(valOf) ? void 0 : valOf.toString();
|
|
450
450
|
}
|
|
451
|
-
if (
|
|
452
|
-
if (
|
|
453
|
-
if (
|
|
451
|
+
if (chunkF3WBQKRI_cjs.isStringObject(input2)) return input2.valueOf();
|
|
452
|
+
if (chunkF3WBQKRI_cjs.isBooleanObject(input2)) return input2.valueOf().toString();
|
|
453
|
+
if (chunkYC7AK3KX_cjs.isDate(input2, { skipInvalidDate: true })) {
|
|
454
454
|
try {
|
|
455
455
|
return input2.toISOString();
|
|
456
456
|
} catch {
|
|
457
457
|
return input2.toString();
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
if (
|
|
461
|
-
if (
|
|
462
|
-
return Array.from(input2).map((v) => String(v)).filter((v) => !
|
|
460
|
+
if (chunk7QQV66RX_cjs.isRegExp(input2)) return input2.toString();
|
|
461
|
+
if (chunkF3WBQKRI_cjs.isBuffer(input2)) {
|
|
462
|
+
return Array.from(input2).map((v) => String(v)).filter((v) => !chunkF3WBQKRI_cjs.isUndefined(v));
|
|
463
463
|
}
|
|
464
|
-
if (
|
|
464
|
+
if (chunkTFDXRT6D_cjs.isTypedArray(input2)) {
|
|
465
465
|
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
466
466
|
const newArray = Array.from(input2).map(
|
|
467
467
|
(item) => _internal(item, {
|
|
@@ -469,8 +469,8 @@ function toStringDeep(input, options = {}) {
|
|
|
469
469
|
removeEmptyArrays: removeEmptyArrays2,
|
|
470
470
|
isRoot: false
|
|
471
471
|
})
|
|
472
|
-
).map((v) => String(v)).filter((item) => !
|
|
473
|
-
if (removeEmptyArrays2 &&
|
|
472
|
+
).map((v) => String(v)).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
473
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
474
474
|
return newArray;
|
|
475
475
|
} else {
|
|
476
476
|
const newArray = Array.from(input2).map(
|
|
@@ -479,41 +479,41 @@ 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) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
483
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
484
484
|
return newArray;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
if (
|
|
487
|
+
if (chunkF3WBQKRI_cjs.isSet(input2)) {
|
|
488
488
|
const arr = Array.from(input2).map(
|
|
489
489
|
(v) => _internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
490
|
-
).filter((v) => !
|
|
491
|
-
if (removeEmptyArrays2 &&
|
|
490
|
+
).filter((v) => !chunkF3WBQKRI_cjs.isUndefined(v));
|
|
491
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(arr)) return void 0;
|
|
492
492
|
return arr;
|
|
493
493
|
}
|
|
494
|
-
if (
|
|
494
|
+
if (chunkYC7AK3KX_cjs.isMap(input2)) {
|
|
495
495
|
const arr = Array.from(input2.entries()).map(([k, v]) => [
|
|
496
496
|
_internal(k, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false }),
|
|
497
497
|
_internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
498
|
-
]).filter(([k, v]) => !
|
|
499
|
-
if (removeEmptyArrays2 &&
|
|
498
|
+
]).filter(([k, v]) => !chunkF3WBQKRI_cjs.isUndefined(k) && !chunkF3WBQKRI_cjs.isUndefined(v));
|
|
499
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(arr)) return void 0;
|
|
500
500
|
return arr;
|
|
501
501
|
}
|
|
502
|
-
if (
|
|
502
|
+
if (chunkF3WBQKRI_cjs.isArray(input2)) {
|
|
503
503
|
let newArray = input2.map(
|
|
504
504
|
(item) => _internal(item, {
|
|
505
505
|
removeEmptyObjects: removeEmptyObjects2,
|
|
506
506
|
removeEmptyArrays: removeEmptyArrays2,
|
|
507
507
|
isRoot: false
|
|
508
508
|
})
|
|
509
|
-
).filter((item) => !
|
|
509
|
+
).filter((item) => !chunkF3WBQKRI_cjs.isUndefined(item));
|
|
510
510
|
if (removeEmptyArrays2) {
|
|
511
|
-
newArray = newArray.filter((v) => !(
|
|
511
|
+
newArray = newArray.filter((v) => !(chunkF3WBQKRI_cjs.isArray(v) && v.length === 0));
|
|
512
512
|
}
|
|
513
|
-
if (removeEmptyArrays2 &&
|
|
513
|
+
if (removeEmptyArrays2 && chunkATLFMKAF_cjs.isEmptyArray(newArray)) return void 0;
|
|
514
514
|
return newArray;
|
|
515
515
|
}
|
|
516
|
-
if (
|
|
516
|
+
if (chunkF3WBQKRI_cjs.isObject(input2)) {
|
|
517
517
|
const newObject = {};
|
|
518
518
|
for (const [key, value] of Object.entries(input2)) {
|
|
519
519
|
const convertedValue = _internal(value, {
|
|
@@ -521,9 +521,9 @@ function toStringDeep(input, options = {}) {
|
|
|
521
521
|
removeEmptyArrays: removeEmptyArrays2,
|
|
522
522
|
isRoot: false
|
|
523
523
|
});
|
|
524
|
-
if (!
|
|
524
|
+
if (!chunkF3WBQKRI_cjs.isUndefined(convertedValue)) {
|
|
525
525
|
newObject[key] = convertedValue;
|
|
526
|
-
} else if (
|
|
526
|
+
} else if (chunkF3WBQKRI_cjs.isArray(value) && !removeEmptyArrays2) {
|
|
527
527
|
newObject[key] = [];
|
|
528
528
|
}
|
|
529
529
|
}
|