@rzl-zone/utils-js 3.12.0 → 3.12.1-beta.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/{LICENSE.md → LICENSE} +3 -3
- package/README.md +62 -89
- package/dist/.references/index.d.cts +25 -0
- package/dist/.references/index.d.ts +25 -0
- package/dist/assertIsArray-BChqwPiP.cjs +26 -0
- package/dist/assertIsArray-BChqwPiP.cjs.map +1 -0
- package/dist/assertIsArray-BfAbIUfa.js +20 -0
- package/dist/assertIsArray-BfAbIUfa.js.map +1 -0
- package/dist/assertIsBoolean-BlBct0Fc.js +1073 -0
- package/dist/assertIsBoolean-BlBct0Fc.js.map +1 -0
- package/dist/assertIsBoolean-DozdtbNi.cjs +1283 -0
- package/dist/assertIsBoolean-DozdtbNi.cjs.map +1 -0
- package/dist/assertIsString-Bvk7bUL7.cjs +26 -0
- package/dist/assertIsString-Bvk7bUL7.cjs.map +1 -0
- package/dist/assertIsString-DqV9NwbI.js +20 -0
- package/dist/assertIsString-DqV9NwbI.js.map +1 -0
- package/dist/assertions/index.cjs +37 -40
- package/dist/assertions/index.cjs.map +1 -0
- package/dist/assertions/index.d.cts +12 -0
- package/dist/assertions/index.d.ts +10 -824
- package/dist/assertions/index.js +30 -13
- package/dist/assertions/index.js.map +1 -0
- package/dist/conversions/index.cjs +34 -103
- package/dist/conversions/index.d.cts +12 -0
- package/dist/conversions/index.d.ts +10 -1791
- package/dist/conversions/index.js +14 -24
- package/dist/conversions-CBs8-REq.cjs +448 -0
- package/dist/conversions-CBs8-REq.cjs.map +1 -0
- package/dist/conversions-EMJa3g-D.js +382 -0
- package/dist/conversions-EMJa3g-D.js.map +1 -0
- package/dist/events/index.cjs +55 -31
- package/dist/events/index.cjs.map +1 -0
- package/dist/events/index.d.cts +174 -0
- package/dist/events/index.d.ts +31 -35
- package/dist/events/index.js +50 -12
- package/dist/events/index.js.map +1 -0
- package/dist/formatEnvPort-DpIXzPAZ.js +159 -0
- package/dist/formatEnvPort-DpIXzPAZ.js.map +1 -0
- package/dist/formatEnvPort-hHNvOim-.cjs +171 -0
- package/dist/formatEnvPort-hHNvOim-.cjs.map +1 -0
- package/dist/formatters/index.cjs +21 -61
- package/dist/formatters/index.d.cts +12 -0
- package/dist/formatters/index.d.ts +10 -2152
- package/dist/formatters/index.js +10 -18
- package/dist/formatters-QcZO_Cpx.js +367 -0
- package/dist/formatters-QcZO_Cpx.js.map +1 -0
- package/dist/formatters-lAYgA11L.cjs +427 -0
- package/dist/formatters-lAYgA11L.cjs.map +1 -0
- package/dist/generators/index.cjs +161 -41
- package/dist/generators/index.cjs.map +1 -0
- package/dist/generators/index.d.cts +12 -0
- package/dist/generators/index.d.ts +10 -338
- package/dist/generators/index.js +154 -14
- package/dist/generators/index.js.map +1 -0
- package/dist/index-26W7ItWx.d.ts +760 -0
- package/dist/index-BPPQjAfs.d.cts +2359 -0
- package/dist/index-BXjlgBLz.d.cts +2139 -0
- package/dist/index-B_Wwo91H.d.ts +2359 -0
- package/dist/index-CpufydcI.d.cts +704 -0
- package/dist/index-Czc4O526.d.ts +333 -0
- package/dist/index-DPs1_p5G.d.cts +760 -0
- package/dist/index-DRpOyBSC.d.ts +1703 -0
- package/dist/index-DWWvtHUn.d.cts +822 -0
- package/dist/index-DnM0LD0n.d.cts +333 -0
- package/dist/index-GUZ9fK6T.d.ts +2139 -0
- package/dist/index-I4fAzwXV.d.ts +704 -0
- package/dist/index-JDrOl_19.d.ts +822 -0
- package/dist/index-b66P49Qe.d.cts +1703 -0
- package/dist/isBigInt-B1cijjqm.cjs +20 -0
- package/dist/isBigInt-B1cijjqm.cjs.map +1 -0
- package/dist/isBigInt-C0bN0Rhu.js +14 -0
- package/dist/isBigInt-C0bN0Rhu.js.map +1 -0
- package/dist/isEmptyObject-DI42NEo0.cjs +37 -0
- package/dist/isEmptyObject-DI42NEo0.cjs.map +1 -0
- package/dist/isEmptyObject-DeLVIJpl.js +25 -0
- package/dist/isEmptyObject-DeLVIJpl.js.map +1 -0
- package/dist/isEmptyString-BTUWYTbw.js +15 -0
- package/dist/isEmptyString-BTUWYTbw.js.map +1 -0
- package/dist/isEmptyString-CCK3bP74.cjs +21 -0
- package/dist/isEmptyString-CCK3bP74.cjs.map +1 -0
- package/dist/isEmptyValue-DMSMFTU8.cjs +30 -0
- package/dist/isEmptyValue-DMSMFTU8.cjs.map +1 -0
- package/dist/isEmptyValue-fjnfQnt5.js +24 -0
- package/dist/isEmptyValue-fjnfQnt5.js.map +1 -0
- package/dist/isEqual-B1fRgEuU.cjs +111 -0
- package/dist/isEqual-B1fRgEuU.cjs.map +1 -0
- package/dist/isEqual-DhyP8fB_.js +87 -0
- package/dist/isEqual-DhyP8fB_.js.map +1 -0
- package/dist/isFinite-BYMOo0os.js +15 -0
- package/dist/isFinite-BYMOo0os.js.map +1 -0
- package/dist/isFinite-sFkps2TY.cjs +21 -0
- package/dist/isFinite-sFkps2TY.cjs.map +1 -0
- package/dist/isInteger-DS9V7l_f.js +14 -0
- package/dist/isInteger-DS9V7l_f.js.map +1 -0
- package/dist/isInteger-FTCthMre.cjs +20 -0
- package/dist/isInteger-FTCthMre.cjs.map +1 -0
- package/dist/isPlainObject-DcFGh3_5.d.ts +530 -0
- package/dist/isPlainObject-doTI11Ib.d.cts +530 -0
- package/dist/isServer-D1TXfOs3.js +14 -0
- package/dist/isServer-D1TXfOs3.js.map +1 -0
- package/dist/isServer-q-QLFCqE.cjs +20 -0
- package/dist/isServer-q-QLFCqE.cjs.map +1 -0
- package/dist/isTypedArray-47R0wdrc.js +31 -0
- package/dist/isTypedArray-47R0wdrc.js.map +1 -0
- package/dist/isTypedArray-DiCoqffZ.cjs +43 -0
- package/dist/isTypedArray-DiCoqffZ.cjs.map +1 -0
- package/dist/isURL-CQiowFq2.js +14 -0
- package/dist/isURL-CQiowFq2.js.map +1 -0
- package/dist/isURL-WZypXsax.cjs +20 -0
- package/dist/isURL-WZypXsax.cjs.map +1 -0
- package/dist/isValidDomain-BSXshgkC.cjs +1788 -0
- package/dist/isValidDomain-BSXshgkC.cjs.map +1 -0
- package/dist/isValidDomain-DwA2EN79.js +1782 -0
- package/dist/isValidDomain-DwA2EN79.js.map +1 -0
- package/dist/next/index.cjs +119 -214
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +226 -0
- package/dist/next/index.d.ts +26 -31
- package/dist/next/index.js +117 -212
- package/dist/next/index.js.map +1 -0
- package/dist/next/server/index.cjs +25 -40
- package/dist/next/server/index.cjs.map +1 -0
- package/dist/next/server/index.d.cts +39 -0
- package/dist/next/server/index.d.ts +9 -10
- package/dist/next/server/index.js +23 -38
- package/dist/next/server/index.js.map +1 -0
- package/dist/noop-B2mTBhW-.cjs +18 -0
- package/dist/noop-B2mTBhW-.cjs.map +1 -0
- package/dist/noop-BzktGBVz.js +12 -0
- package/dist/noop-BzktGBVz.js.map +1 -0
- package/dist/normalizeSpaces-DQHR3Tlr.cjs +29 -0
- package/dist/normalizeSpaces-DQHR3Tlr.cjs.map +1 -0
- package/dist/normalizeSpaces-WS_iERJk.js +23 -0
- package/dist/normalizeSpaces-WS_iERJk.js.map +1 -0
- package/dist/normalizeString-2WLth_Gj.js +15 -0
- package/dist/normalizeString-2WLth_Gj.js.map +1 -0
- package/dist/normalizeString-D8euBcRD.cjs +21 -0
- package/dist/normalizeString-D8euBcRD.cjs.map +1 -0
- package/dist/operations/index.cjs +65 -32
- package/dist/operations/index.cjs.map +1 -0
- package/dist/operations/index.d.cts +139 -0
- package/dist/operations/index.d.ts +10 -15
- package/dist/operations/index.js +61 -17
- package/dist/operations/index.js.map +1 -0
- package/dist/parsers/index.cjs +12 -19
- package/dist/parsers/index.d.cts +239 -0
- package/dist/parsers/index.d.ts +71 -72
- package/dist/parsers/index.js +10 -12
- package/dist/parsers-DXtpsDyj.cjs +649 -0
- package/dist/parsers-DXtpsDyj.cjs.map +1 -0
- package/dist/parsers-Dpuq-V4u.js +643 -0
- package/dist/parsers-Dpuq-V4u.js.map +1 -0
- package/dist/parsing-B43x1sxn.js +50 -0
- package/dist/parsing-B43x1sxn.js.map +1 -0
- package/dist/parsing-lRoxn1Nz.cjs +56 -0
- package/dist/parsing-lRoxn1Nz.cjs.map +1 -0
- package/dist/predicates/index.cjs +91 -296
- package/dist/predicates/index.d.cts +13 -0
- package/dist/predicates/index.d.ts +12 -2482
- package/dist/predicates/index.js +23 -25
- package/dist/predicates-DiaYA7Ps.cjs +413 -0
- package/dist/predicates-DiaYA7Ps.cjs.map +1 -0
- package/dist/predicates-gNepszvo.js +257 -0
- package/dist/predicates-gNepszvo.js.map +1 -0
- package/dist/promises/index.cjs +76 -24
- package/dist/promises/index.cjs.map +1 -0
- package/dist/promises/index.d.cts +123 -0
- package/dist/promises/index.d.ts +28 -31
- package/dist/promises/index.js +73 -13
- package/dist/promises/index.js.map +1 -0
- package/dist/punyCode-CTWXVVFo.cjs +185 -0
- package/dist/punyCode-CTWXVVFo.cjs.map +1 -0
- package/dist/punyCode-hmiFzLWT.js +179 -0
- package/dist/punyCode-hmiFzLWT.js.map +1 -0
- package/dist/removeSpaces-BE8lfh-4.js +19 -0
- package/dist/removeSpaces-BE8lfh-4.js.map +1 -0
- package/dist/removeSpaces-DRRxNWlb.cjs +25 -0
- package/dist/removeSpaces-DRRxNWlb.cjs.map +1 -0
- package/dist/safeJsonParse-BBnQElk8.cjs +208 -0
- package/dist/safeJsonParse-BBnQElk8.cjs.map +1 -0
- package/dist/safeJsonParse-CXruaP0p.js +184 -0
- package/dist/safeJsonParse-CXruaP0p.js.map +1 -0
- package/dist/safeStableStringify-BNh3D0K0.js +88 -0
- package/dist/safeStableStringify-BNh3D0K0.js.map +1 -0
- package/dist/safeStableStringify-Cc62pfRp.cjs +106 -0
- package/dist/safeStableStringify-Cc62pfRp.cjs.map +1 -0
- package/dist/strings/index.cjs +76 -81
- package/dist/strings/index.cjs.map +1 -0
- package/dist/strings/index.d.cts +12 -0
- package/dist/strings/index.d.ts +10 -775
- package/dist/strings/index.js +59 -14
- package/dist/strings/index.js.map +1 -0
- package/dist/tailwind/index.cjs +19 -47
- package/dist/tailwind/index.d.cts +12 -0
- package/dist/tailwind/index.d.ts +11 -712
- package/dist/tailwind/index.js +10 -12
- package/dist/tailwind-DJ4cmLUw.cjs +247 -0
- package/dist/tailwind-DJ4cmLUw.cjs.map +1 -0
- package/dist/tailwind-IJvOdkZp.js +199 -0
- package/dist/tailwind-IJvOdkZp.js.map +1 -0
- package/dist/toStringArrayUnRecursive-CFs0jTEg.js +39 -0
- package/dist/toStringArrayUnRecursive-CFs0jTEg.js.map +1 -0
- package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs +51 -0
- package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs.map +1 -0
- package/dist/urls/index.cjs +129 -57
- package/dist/urls/index.cjs.map +1 -0
- package/dist/urls/index.d.cts +740 -0
- package/dist/urls/index.d.ts +218 -224
- package/dist/urls/index.js +121 -26
- package/dist/urls/index.js.map +1 -0
- package/package.json +203 -194
- package/dist/chunk-2AFQ33D3.cjs +0 -64
- package/dist/chunk-2CYDJVGM.js +0 -246
- package/dist/chunk-2MW4JDQ2.cjs +0 -598
- package/dist/chunk-2VTDXC3N.cjs +0 -1825
- package/dist/chunk-44XX2P34.js +0 -209
- package/dist/chunk-4YLBKLGS.cjs +0 -18
- package/dist/chunk-566CXQW7.cjs +0 -560
- package/dist/chunk-57EPKYID.cjs +0 -397
- package/dist/chunk-5MGEC3YG.js +0 -63
- package/dist/chunk-6EF52423.cjs +0 -249
- package/dist/chunk-6SCOKU3S.js +0 -109
- package/dist/chunk-6VUXD3CF.js +0 -119
- package/dist/chunk-7B76BSNK.cjs +0 -118
- package/dist/chunk-7Y6I2DSU.cjs +0 -101
- package/dist/chunk-A7S7E2EE.cjs +0 -308
- package/dist/chunk-AJZ6PMMZ.js +0 -16
- package/dist/chunk-AXGBL2IO.cjs +0 -251
- package/dist/chunk-B4TC6FBV.cjs +0 -678
- package/dist/chunk-BAV5T2E3.cjs +0 -15
- package/dist/chunk-BKIJBNIE.js +0 -21
- package/dist/chunk-BNIMTFK5.js +0 -59
- package/dist/chunk-BXW7YXB7.js +0 -1823
- package/dist/chunk-CFYZC4S6.js +0 -53
- package/dist/chunk-CSG4SCL3.js +0 -1587
- package/dist/chunk-CWQW7AKK.js +0 -676
- package/dist/chunk-DVMHRLKP.cjs +0 -16
- package/dist/chunk-EN7LVZBZ.js +0 -548
- package/dist/chunk-EV4Y7HCY.cjs +0 -26
- package/dist/chunk-F66VDYIZ.cjs +0 -18
- package/dist/chunk-FLJX37EL.cjs +0 -30
- package/dist/chunk-GKC3UDMC.cjs +0 -1623
- package/dist/chunk-H65I3GRZ.cjs +0 -106
- package/dist/chunk-HHYWB7VZ.js +0 -24
- package/dist/chunk-HNGGISFL.cjs +0 -65
- package/dist/chunk-HNSQAVSZ.cjs +0 -35
- package/dist/chunk-HSP6IWZK.js +0 -17
- package/dist/chunk-IDZS7J6T.js +0 -242
- package/dist/chunk-JS6R55VL.js +0 -302
- package/dist/chunk-JZVT5FK7.js +0 -232
- package/dist/chunk-KHO2SBNA.cjs +0 -16
- package/dist/chunk-KIDJCMNJ.js +0 -33
- package/dist/chunk-KOLEURVT.cjs +0 -38
- package/dist/chunk-L4V53MQK.cjs +0 -269
- package/dist/chunk-L5RDAVVH.js +0 -14
- package/dist/chunk-NODTV4F3.js +0 -16
- package/dist/chunk-NYK5K3V2.cjs +0 -211
- package/dist/chunk-ODUO3RTL.cjs +0 -113
- package/dist/chunk-ONZFBJVW.js +0 -14
- package/dist/chunk-PFXCTE37.js +0 -28
- package/dist/chunk-PPST7QAQ.js +0 -587
- package/dist/chunk-Q5IMYDFL.cjs +0 -33
- package/dist/chunk-QFFBIOJ4.js +0 -31
- package/dist/chunk-QNKGP5DY.js +0 -14
- package/dist/chunk-RRQHMOPE.cjs +0 -19
- package/dist/chunk-RU5OSRBU.js +0 -95
- package/dist/chunk-SDMPEJ4F.js +0 -35
- package/dist/chunk-SYNL5IKP.js +0 -115
- package/dist/chunk-TCDOWZQE.js +0 -16
- package/dist/chunk-TQPGXGKB.cjs +0 -123
- package/dist/chunk-TULOI4GL.js +0 -370
- package/dist/chunk-UBHCP4N5.cjs +0 -36
- package/dist/chunk-UCHF3M34.cjs +0 -56
- package/dist/chunk-UDA26MCU.cjs +0 -16
- package/dist/chunk-V3C4FYZL.cjs +0 -18
- package/dist/chunk-VAAHZFBF.js +0 -32
- package/dist/chunk-VJDDGRIK.cjs +0 -16
- package/dist/chunk-WVSPXFTY.js +0 -14
- package/dist/chunk-WYP76WXB.js +0 -101
- package/dist/chunk-YDE4ZBB7.cjs +0 -237
- package/dist/chunk-YKQEOO7C.cjs +0 -23
- package/dist/chunk-YSZC56SZ.js +0 -264
- package/dist/chunk-YWHHVDT4.js +0 -13
- package/dist/index.d.ts +0 -24
- package/dist/isPlainObject-DTJVV2Kf.d.ts +0 -536
- package/dist/rzl-utils.global.js +0 -10
package/dist/chunk-566CXQW7.cjs
DELETED
|
@@ -1,560 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
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
|
-
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
21
|
-
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
22
|
-
|
|
23
|
-
function toNumberArrayUnRecursive(array, options = {}) {
|
|
24
|
-
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
25
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
26
|
-
});
|
|
27
|
-
const riv = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeInvalidValueNumber") ? options.removeInvalidValueNumber : true;
|
|
28
|
-
chunkGKC3UDMC_cjs.assertIsBoolean(riv, {
|
|
29
|
-
message: ({ currentType, validType }) => `Parameter \`removeInvalidValueNumber\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
30
|
-
});
|
|
31
|
-
if (chunkGKC3UDMC_cjs.isArray(array)) {
|
|
32
|
-
const result = Array.from(array, (x) => {
|
|
33
|
-
if (chunkUDA26MCU_cjs.isBigInt(x)) return Number(x);
|
|
34
|
-
const str = String(x).trim();
|
|
35
|
-
const match = str.match(/-?\d+(\.\d+)?/);
|
|
36
|
-
return match ? Number(match[0]) : chunkGKC3UDMC_cjs.isNull(x) ? null : void 0;
|
|
37
|
-
});
|
|
38
|
-
return riv ? chunkUCHF3M34_cjs.filterNilArray(result) : result;
|
|
39
|
-
}
|
|
40
|
-
return void 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function toStringDeepForce(value, forceToString) {
|
|
44
|
-
if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
|
|
45
|
-
throw new TypeError(
|
|
46
|
-
`Second parameter \`forceToString\` must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
47
|
-
forceToString
|
|
48
|
-
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(forceToString, {
|
|
49
|
-
keepUndefined: true
|
|
50
|
-
})}\`.`
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
if (chunkGKC3UDMC_cjs.isNaN(value)) {
|
|
54
|
-
return forceToString === "primitives" || forceToString === "all" ? "NaN" : NaN;
|
|
55
|
-
}
|
|
56
|
-
if (chunkGKC3UDMC_cjs.isString(value) || chunkGKC3UDMC_cjs.isNumber(value)) {
|
|
57
|
-
return forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
58
|
-
}
|
|
59
|
-
if (chunkGKC3UDMC_cjs.isBoolean(value) || chunkUDA26MCU_cjs.isBigInt(value) || chunkGKC3UDMC_cjs.isNil(value)) {
|
|
60
|
-
return forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
61
|
-
}
|
|
62
|
-
if (chunkGKC3UDMC_cjs.isNumberObject(value) || chunkGKC3UDMC_cjs.isBooleanObject(value) || chunkGKC3UDMC_cjs.isStringObject(value)) {
|
|
63
|
-
return forceToString === "all" ? value.valueOf().toString() : value;
|
|
64
|
-
}
|
|
65
|
-
if (chunkGKC3UDMC_cjs.isSymbol(value)) {
|
|
66
|
-
return forceToString === "all" ? value.toString() : value;
|
|
67
|
-
}
|
|
68
|
-
if (chunkGKC3UDMC_cjs.isFunction(value)) {
|
|
69
|
-
return forceToString === "all" ? value.toString() : value;
|
|
70
|
-
}
|
|
71
|
-
if (chunkGKC3UDMC_cjs.isArray(value)) {
|
|
72
|
-
return value.map((v) => toStringDeepForce(v, forceToString));
|
|
73
|
-
}
|
|
74
|
-
if (chunkGKC3UDMC_cjs.isObjectOrArray(value)) {
|
|
75
|
-
if (chunkTQPGXGKB_cjs.isDate(value)) {
|
|
76
|
-
return forceToString === "all" ? value.toISOString() : value;
|
|
77
|
-
}
|
|
78
|
-
if (chunkH65I3GRZ_cjs.isRegExp(value)) {
|
|
79
|
-
return forceToString === "all" ? value.toString() : value;
|
|
80
|
-
}
|
|
81
|
-
if (chunkGKC3UDMC_cjs.isError(value) || value instanceof Promise) {
|
|
82
|
-
return forceToString === "all" ? value.toString() : value;
|
|
83
|
-
}
|
|
84
|
-
if (chunkGKC3UDMC_cjs.isSet(value)) {
|
|
85
|
-
return forceToString === "all" ? [...value].map((v) => toStringDeepForce(v, forceToString)) : value;
|
|
86
|
-
}
|
|
87
|
-
if (chunkTQPGXGKB_cjs.isMap(value)) {
|
|
88
|
-
return forceToString === "all" ? [...value.entries()].map(([k, v]) => [
|
|
89
|
-
toStringDeepForce(k, forceToString),
|
|
90
|
-
toStringDeepForce(v, forceToString)
|
|
91
|
-
]) : value;
|
|
92
|
-
}
|
|
93
|
-
const result = {};
|
|
94
|
-
if (chunkGKC3UDMC_cjs.isObject(value)) {
|
|
95
|
-
for (const key of Object.keys(value)) {
|
|
96
|
-
result[key] = toStringDeepForce(value[key], forceToString);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return result;
|
|
100
|
-
}
|
|
101
|
-
return value;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var dedupeArray = (inputArray, options = {}) => {
|
|
105
|
-
chunkRRQHMOPE_cjs.assertIsArray(inputArray, {
|
|
106
|
-
message: ({ currentType, validType }) => `First parameter (\`inputArray\`) must be of type \`${validType}\` (array literal or instance), but received: \`${currentType}\`.`
|
|
107
|
-
});
|
|
108
|
-
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
109
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
110
|
-
});
|
|
111
|
-
const flatten = chunkGKC3UDMC_cjs.hasOwnProp(options, "flatten") ? options.flatten : false;
|
|
112
|
-
const forceToString = chunkGKC3UDMC_cjs.hasOwnProp(options, "forceToString") ? options.forceToString : false;
|
|
113
|
-
if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
|
|
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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
116
|
-
forceToString
|
|
117
|
-
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(forceToString, {
|
|
118
|
-
keepUndefined: true
|
|
119
|
-
})}\`.`
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
chunkGKC3UDMC_cjs.assertIsBoolean(flatten, {
|
|
123
|
-
message: ({ currentType, validType }) => `Parameter \`flatten\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
124
|
-
});
|
|
125
|
-
const process = (arr) => {
|
|
126
|
-
const seen = [];
|
|
127
|
-
return arr.reduce((acc, item) => {
|
|
128
|
-
const value = chunkGKC3UDMC_cjs.isArray(item) ? process(item) : toStringDeepForce(item, forceToString);
|
|
129
|
-
if (!seen.some((s) => chunkH65I3GRZ_cjs.isEqual(s, value))) {
|
|
130
|
-
seen.push(value);
|
|
131
|
-
acc.push(value);
|
|
132
|
-
}
|
|
133
|
-
return acc;
|
|
134
|
-
}, []);
|
|
135
|
-
};
|
|
136
|
-
const deepFlatten = (value) => {
|
|
137
|
-
if (chunkGKC3UDMC_cjs.isArray(value)) {
|
|
138
|
-
return value.flatMap(deepFlatten);
|
|
139
|
-
}
|
|
140
|
-
if (chunkGKC3UDMC_cjs.isSet(value)) {
|
|
141
|
-
return [...value].flatMap(deepFlatten);
|
|
142
|
-
}
|
|
143
|
-
if (chunkTQPGXGKB_cjs.isMap(value)) {
|
|
144
|
-
return [...value.values()].flatMap(deepFlatten);
|
|
145
|
-
}
|
|
146
|
-
return [value];
|
|
147
|
-
};
|
|
148
|
-
return flatten ? process(deepFlatten(inputArray)) : process(inputArray);
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
var toBooleanContent = (value) => {
|
|
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
|
-
return Boolean(value);
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var toBooleanContentDeep = (value) => {
|
|
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
|
-
return false;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
var toBooleanExplicit = (value, options = {}) => {
|
|
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
|
-
throw new TypeError(
|
|
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
|
-
ci
|
|
180
|
-
)}\`, 'trimString': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
181
|
-
ts
|
|
182
|
-
)}\`, 'includeIndeterminate': \`${chunkGKC3UDMC_cjs.getPreciseType(incInd)}\`].`
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
if (chunkGKC3UDMC_cjs.isString(value)) {
|
|
186
|
-
let normalized = value;
|
|
187
|
-
if (ts) normalized = normalized.trim();
|
|
188
|
-
if (ci) normalized = normalized.toLowerCase();
|
|
189
|
-
const validTrueStrings = ["true", "on", "yes", "1"];
|
|
190
|
-
if (incInd) validTrueStrings.push("indeterminate");
|
|
191
|
-
return validTrueStrings.includes(normalized);
|
|
192
|
-
}
|
|
193
|
-
if (chunkGKC3UDMC_cjs.isNumber(value)) return value === 1;
|
|
194
|
-
if (chunkGKC3UDMC_cjs.isBoolean(value)) return value;
|
|
195
|
-
return false;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
var toBooleanLoose = (value) => {
|
|
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
|
-
return Boolean(value);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
var convertType = (value) => {
|
|
208
|
-
const predefinedValues = {
|
|
209
|
-
undefined: void 0,
|
|
210
|
-
null: null,
|
|
211
|
-
nan: NaN,
|
|
212
|
-
true: true,
|
|
213
|
-
false: false,
|
|
214
|
-
yes: true,
|
|
215
|
-
no: false
|
|
216
|
-
};
|
|
217
|
-
if (chunkGKC3UDMC_cjs.isString(value)) {
|
|
218
|
-
const normalized = value.trim().toLowerCase();
|
|
219
|
-
if (Object.prototype.hasOwnProperty.call(predefinedValues, normalized)) {
|
|
220
|
-
return predefinedValues[normalized];
|
|
221
|
-
}
|
|
222
|
-
const numericString = normalized.replace(/,/g, "");
|
|
223
|
-
const numberString = Number(numericString);
|
|
224
|
-
if (!chunkGKC3UDMC_cjs.isNaN(numberString) && chunkGKC3UDMC_cjs.isNonEmptyString(numericString)) {
|
|
225
|
-
return numberString;
|
|
226
|
-
}
|
|
227
|
-
return value.trim();
|
|
228
|
-
}
|
|
229
|
-
return value;
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
var deepCloneSafe = (obj) => {
|
|
233
|
-
try {
|
|
234
|
-
if (chunkGKC3UDMC_cjs.isFunction(structuredClone)) {
|
|
235
|
-
return structuredClone(obj);
|
|
236
|
-
}
|
|
237
|
-
} catch {
|
|
238
|
-
}
|
|
239
|
-
return JSON.parse(JSON.stringify(obj));
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
var deleteNestedKey = (obj, path) => {
|
|
243
|
-
if (!chunkGKC3UDMC_cjs.isObjectOrArray(obj)) return obj;
|
|
244
|
-
const [currentKey, ...rest] = path;
|
|
245
|
-
if (chunkGKC3UDMC_cjs.isArray(obj)) {
|
|
246
|
-
for (const item of obj) {
|
|
247
|
-
if (chunkGKC3UDMC_cjs.isObjectOrArray(item)) deleteNestedKey(item, path);
|
|
248
|
-
}
|
|
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
|
-
deleteNestedKey(obj[currentKey], rest);
|
|
253
|
-
}
|
|
254
|
-
return obj;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
var deleteExactPathOnce = (obj, path) => {
|
|
258
|
-
if (!chunkGKC3UDMC_cjs.isPlainObject(obj)) return obj;
|
|
259
|
-
const [currentKey, ...rest] = path;
|
|
260
|
-
if (rest.length === 0) {
|
|
261
|
-
if (chunkGKC3UDMC_cjs.isPlainObject(obj)) delete obj[currentKey];
|
|
262
|
-
} else if (chunkGKC3UDMC_cjs.isPlainObject(obj[currentKey])) {
|
|
263
|
-
deleteExactPathOnce(obj[currentKey], rest);
|
|
264
|
-
}
|
|
265
|
-
return obj;
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
269
|
-
if (chunkKOLEURVT_cjs.isEmptyObject(object, { checkSymbols: true }))
|
|
270
|
-
return {};
|
|
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
|
-
keysToDelete,
|
|
274
|
-
{ keepUndefined: true }
|
|
275
|
-
)}\`.`
|
|
276
|
-
});
|
|
277
|
-
if (!keysToDelete.every((k) => chunkGKC3UDMC_cjs.isPlainObject(k) && "key" in k)) {
|
|
278
|
-
throw new TypeError(
|
|
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(
|
|
280
|
-
keysToDelete,
|
|
281
|
-
{ keepUndefined: true }
|
|
282
|
-
)}\`.`
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
let result = deepClone ? deepCloneSafe(object) : object;
|
|
286
|
-
for (const { key, deep } of keysToDelete) {
|
|
287
|
-
chunkYKQEOO7C_cjs.assertIsString(key, {
|
|
288
|
-
message: ({ currentType, validType }) => `Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
289
|
-
});
|
|
290
|
-
if (!chunkGKC3UDMC_cjs.isUndefined(deep) && !chunkGKC3UDMC_cjs.isBoolean(deep)) {
|
|
291
|
-
throw new TypeError(
|
|
292
|
-
`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
293
|
-
deep
|
|
294
|
-
)}\`.`
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
const path = key.split(".");
|
|
298
|
-
result = deep ? deleteNestedKey(result, path) : deleteExactPathOnce(result, path);
|
|
299
|
-
}
|
|
300
|
-
return result;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function toNumberDeep(input, options = {}) {
|
|
304
|
-
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
305
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
306
|
-
});
|
|
307
|
-
const removeEmptyObjects = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
308
|
-
const removeEmptyArrays = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
309
|
-
function _internal(input2, options2) {
|
|
310
|
-
if (chunkGKC3UDMC_cjs.isNil(input2) || chunkH65I3GRZ_cjs.isRegExp(input2)) return void 0;
|
|
311
|
-
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
312
|
-
if (!chunkGKC3UDMC_cjs.isBoolean(removeEmptyObjects2) || !chunkGKC3UDMC_cjs.isBoolean(removeEmptyArrays2)) {
|
|
313
|
-
throw new TypeError(
|
|
314
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
315
|
-
removeEmptyObjects2
|
|
316
|
-
)}\`, 'removeEmptyArrays': \`${chunkGKC3UDMC_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
317
|
-
);
|
|
318
|
-
}
|
|
319
|
-
if (chunkGKC3UDMC_cjs.isNumber(input2) || chunkGKC3UDMC_cjs.isBoolean(input2) || chunkGKC3UDMC_cjs.isNonEmptyString(input2)) {
|
|
320
|
-
const num = Number(input2);
|
|
321
|
-
return chunkGKC3UDMC_cjs.isInfinityNumber(num) || chunkGKC3UDMC_cjs.isNaN(num) ? void 0 : num;
|
|
322
|
-
}
|
|
323
|
-
if (chunkGKC3UDMC_cjs.isNumberObject(input2) || chunkGKC3UDMC_cjs.isStringObject(input2) || chunkGKC3UDMC_cjs.isBooleanObject(input2)) {
|
|
324
|
-
const valOf = Number(input2.valueOf());
|
|
325
|
-
return chunkGKC3UDMC_cjs.isInfinityNumber(valOf) || chunkGKC3UDMC_cjs.isNaN(valOf) ? void 0 : valOf;
|
|
326
|
-
}
|
|
327
|
-
if (chunkTQPGXGKB_cjs.isDate(input2, { skipInvalidDate: true })) {
|
|
328
|
-
try {
|
|
329
|
-
return !chunkGKC3UDMC_cjs.isNaN(input2.getTime()) ? input2.getTime() : 0;
|
|
330
|
-
} catch {
|
|
331
|
-
return 0;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
if (chunkGKC3UDMC_cjs.isBuffer(input2)) {
|
|
335
|
-
const arr = Array.from(input2).map(
|
|
336
|
-
(n) => _internal(n, {
|
|
337
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
338
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
339
|
-
isRoot: false
|
|
340
|
-
})
|
|
341
|
-
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
342
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(arr)) return void 0;
|
|
343
|
-
return arr;
|
|
344
|
-
}
|
|
345
|
-
if (chunkUBHCP4N5_cjs.isTypedArray(input2)) {
|
|
346
|
-
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
347
|
-
const newArray = Array.from(input2).map(
|
|
348
|
-
(item) => _internal(item, {
|
|
349
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
350
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
351
|
-
isRoot: false
|
|
352
|
-
})
|
|
353
|
-
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
354
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
355
|
-
return newArray;
|
|
356
|
-
} else {
|
|
357
|
-
const newArray = Array.from(input2).map(
|
|
358
|
-
(item) => _internal(item, {
|
|
359
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
360
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
361
|
-
isRoot: false
|
|
362
|
-
})
|
|
363
|
-
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
364
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
365
|
-
return newArray;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
if (chunkGKC3UDMC_cjs.isSet(input2)) {
|
|
369
|
-
const newArray = Array.from(input2).map(
|
|
370
|
-
(item) => _internal(item, {
|
|
371
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
372
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
373
|
-
isRoot: false
|
|
374
|
-
})
|
|
375
|
-
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
376
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
377
|
-
return newArray;
|
|
378
|
-
}
|
|
379
|
-
if (chunkTQPGXGKB_cjs.isMap(input2)) {
|
|
380
|
-
let newArray = Array.from(input2.entries()).map(([k, v]) => {
|
|
381
|
-
const key = _internal(k, {
|
|
382
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
383
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
384
|
-
isRoot: false
|
|
385
|
-
});
|
|
386
|
-
const value = _internal(v, {
|
|
387
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
388
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
389
|
-
isRoot: false
|
|
390
|
-
});
|
|
391
|
-
return !chunkGKC3UDMC_cjs.isUndefined(key) && !chunkGKC3UDMC_cjs.isUndefined(value) ? [key, value] : void 0;
|
|
392
|
-
}).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
393
|
-
if (removeEmptyArrays2) {
|
|
394
|
-
newArray = newArray.filter((v) => !chunkKOLEURVT_cjs.isEmptyArray(v));
|
|
395
|
-
}
|
|
396
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
397
|
-
return newArray;
|
|
398
|
-
}
|
|
399
|
-
if (chunkGKC3UDMC_cjs.isArray(input2)) {
|
|
400
|
-
const newArray = input2.map(
|
|
401
|
-
(item) => _internal(item, {
|
|
402
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
403
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
404
|
-
isRoot: false
|
|
405
|
-
})
|
|
406
|
-
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
407
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
408
|
-
return newArray;
|
|
409
|
-
}
|
|
410
|
-
if (chunkGKC3UDMC_cjs.isObject(input2)) {
|
|
411
|
-
const newObject = {};
|
|
412
|
-
for (const [key, value] of Object.entries(input2)) {
|
|
413
|
-
const convertedValue = _internal(value, {
|
|
414
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
415
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
416
|
-
isRoot: false
|
|
417
|
-
});
|
|
418
|
-
if (!chunkGKC3UDMC_cjs.isUndefined(convertedValue)) {
|
|
419
|
-
newObject[key] = convertedValue;
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
if (removeEmptyObjects2 && chunkKOLEURVT_cjs.isEmptyObject(newObject)) {
|
|
423
|
-
return isRoot ? {} : void 0;
|
|
424
|
-
}
|
|
425
|
-
return newObject;
|
|
426
|
-
}
|
|
427
|
-
return void 0;
|
|
428
|
-
}
|
|
429
|
-
return _internal(input, {
|
|
430
|
-
removeEmptyObjects,
|
|
431
|
-
removeEmptyArrays,
|
|
432
|
-
isRoot: true
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
function toStringDeep(input, options = {}) {
|
|
437
|
-
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
438
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
439
|
-
});
|
|
440
|
-
const removeEmptyObjects = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
441
|
-
const removeEmptyArrays = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
442
|
-
function _internal(input2, options2) {
|
|
443
|
-
if (chunkGKC3UDMC_cjs.isNil(input2) || chunkGKC3UDMC_cjs.isInfinityNumber(input2)) return void 0;
|
|
444
|
-
const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
|
|
445
|
-
if (!chunkGKC3UDMC_cjs.isBoolean(removeEmptyObjects2) || !chunkGKC3UDMC_cjs.isBoolean(removeEmptyArrays2)) {
|
|
446
|
-
throw new TypeError(
|
|
447
|
-
`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
448
|
-
removeEmptyObjects2
|
|
449
|
-
)}\`, 'removeEmptyArrays': \`${chunkGKC3UDMC_cjs.getPreciseType(removeEmptyArrays2)}\`].`
|
|
450
|
-
);
|
|
451
|
-
}
|
|
452
|
-
if (chunkGKC3UDMC_cjs.isNumber(input2) || chunkGKC3UDMC_cjs.isString(input2) || chunkGKC3UDMC_cjs.isBoolean(input2)) return String(input2);
|
|
453
|
-
if (chunkGKC3UDMC_cjs.isNumberObject(input2)) {
|
|
454
|
-
const valOf = input2.valueOf();
|
|
455
|
-
return chunkGKC3UDMC_cjs.isInfinityNumber(valOf) || chunkGKC3UDMC_cjs.isNaN(valOf) ? void 0 : valOf.toString();
|
|
456
|
-
}
|
|
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 })) {
|
|
460
|
-
try {
|
|
461
|
-
return input2.toISOString();
|
|
462
|
-
} catch {
|
|
463
|
-
return input2.toString();
|
|
464
|
-
}
|
|
465
|
-
}
|
|
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));
|
|
469
|
-
}
|
|
470
|
-
if (chunkUBHCP4N5_cjs.isTypedArray(input2)) {
|
|
471
|
-
if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
|
|
472
|
-
const newArray = Array.from(input2).map(
|
|
473
|
-
(item) => _internal(item, {
|
|
474
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
475
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
476
|
-
isRoot: false
|
|
477
|
-
})
|
|
478
|
-
).map((v) => String(v)).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
479
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
480
|
-
return newArray;
|
|
481
|
-
} else {
|
|
482
|
-
const newArray = Array.from(input2).map(
|
|
483
|
-
(item) => _internal(item, {
|
|
484
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
485
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
486
|
-
isRoot: false
|
|
487
|
-
})
|
|
488
|
-
).map((v) => String(v)).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
489
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
490
|
-
return newArray;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
if (chunkGKC3UDMC_cjs.isSet(input2)) {
|
|
494
|
-
const arr = Array.from(input2).map(
|
|
495
|
-
(v) => _internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
496
|
-
).filter((v) => !chunkGKC3UDMC_cjs.isUndefined(v));
|
|
497
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(arr)) return void 0;
|
|
498
|
-
return arr;
|
|
499
|
-
}
|
|
500
|
-
if (chunkTQPGXGKB_cjs.isMap(input2)) {
|
|
501
|
-
const arr = Array.from(input2.entries()).map(([k, v]) => [
|
|
502
|
-
_internal(k, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false }),
|
|
503
|
-
_internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
|
|
504
|
-
]).filter(([k, v]) => !chunkGKC3UDMC_cjs.isUndefined(k) && !chunkGKC3UDMC_cjs.isUndefined(v));
|
|
505
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(arr)) return void 0;
|
|
506
|
-
return arr;
|
|
507
|
-
}
|
|
508
|
-
if (chunkGKC3UDMC_cjs.isArray(input2)) {
|
|
509
|
-
let newArray = input2.map(
|
|
510
|
-
(item) => _internal(item, {
|
|
511
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
512
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
513
|
-
isRoot: false
|
|
514
|
-
})
|
|
515
|
-
).filter((item) => !chunkGKC3UDMC_cjs.isUndefined(item));
|
|
516
|
-
if (removeEmptyArrays2) {
|
|
517
|
-
newArray = newArray.filter((v) => !(chunkGKC3UDMC_cjs.isArray(v) && v.length === 0));
|
|
518
|
-
}
|
|
519
|
-
if (removeEmptyArrays2 && chunkKOLEURVT_cjs.isEmptyArray(newArray)) return void 0;
|
|
520
|
-
return newArray;
|
|
521
|
-
}
|
|
522
|
-
if (chunkGKC3UDMC_cjs.isObject(input2)) {
|
|
523
|
-
const newObject = {};
|
|
524
|
-
for (const [key, value] of Object.entries(input2)) {
|
|
525
|
-
const convertedValue = _internal(value, {
|
|
526
|
-
removeEmptyObjects: removeEmptyObjects2,
|
|
527
|
-
removeEmptyArrays: removeEmptyArrays2,
|
|
528
|
-
isRoot: false
|
|
529
|
-
});
|
|
530
|
-
if (!chunkGKC3UDMC_cjs.isUndefined(convertedValue)) {
|
|
531
|
-
newObject[key] = convertedValue;
|
|
532
|
-
} else if (chunkGKC3UDMC_cjs.isArray(value) && !removeEmptyArrays2) {
|
|
533
|
-
newObject[key] = [];
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
if (removeEmptyObjects2 && Object.keys(newObject).length === 0) {
|
|
537
|
-
return isRoot ? {} : void 0;
|
|
538
|
-
}
|
|
539
|
-
return newObject;
|
|
540
|
-
}
|
|
541
|
-
return void 0;
|
|
542
|
-
}
|
|
543
|
-
return _internal(input, {
|
|
544
|
-
removeEmptyObjects,
|
|
545
|
-
removeEmptyArrays,
|
|
546
|
-
isRoot: true
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
exports.convertType = convertType;
|
|
551
|
-
exports.dedupeArray = dedupeArray;
|
|
552
|
-
exports.removeObjectPaths = removeObjectPaths;
|
|
553
|
-
exports.toBooleanContent = toBooleanContent;
|
|
554
|
-
exports.toBooleanContentDeep = toBooleanContentDeep;
|
|
555
|
-
exports.toBooleanExplicit = toBooleanExplicit;
|
|
556
|
-
exports.toBooleanLoose = toBooleanLoose;
|
|
557
|
-
exports.toNumberArrayUnRecursive = toNumberArrayUnRecursive;
|
|
558
|
-
exports.toNumberDeep = toNumberDeep;
|
|
559
|
-
exports.toStringDeep = toStringDeep;
|
|
560
|
-
exports.toStringDeepForce = toStringDeepForce;
|