@rzl-zone/utils-js 3.12.0 → 3.12.1-beta.1

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.
Files changed (286) hide show
  1. package/{LICENSE.md → LICENSE} +3 -3
  2. package/README.md +69 -96
  3. package/dist/.references/index.d.cts +25 -0
  4. package/dist/.references/index.d.ts +25 -0
  5. package/dist/assertIsArray-DJXkjHZs.cjs +26 -0
  6. package/dist/assertIsArray-DJXkjHZs.cjs.map +1 -0
  7. package/dist/assertIsArray-bTA3XLjq.js +20 -0
  8. package/dist/assertIsArray-bTA3XLjq.js.map +1 -0
  9. package/dist/assertIsBoolean-C8WEXVr2.cjs +1283 -0
  10. package/dist/assertIsBoolean-C8WEXVr2.cjs.map +1 -0
  11. package/dist/assertIsBoolean-DR1SaXPD.js +1073 -0
  12. package/dist/assertIsBoolean-DR1SaXPD.js.map +1 -0
  13. package/dist/assertIsString-BiHQSrB2.cjs +26 -0
  14. package/dist/assertIsString-BiHQSrB2.cjs.map +1 -0
  15. package/dist/assertIsString-CEB07_83.js +20 -0
  16. package/dist/assertIsString-CEB07_83.js.map +1 -0
  17. package/dist/assertions/index.cjs +37 -40
  18. package/dist/assertions/index.cjs.map +1 -0
  19. package/dist/assertions/index.d.cts +12 -0
  20. package/dist/assertions/index.d.ts +10 -824
  21. package/dist/assertions/index.js +30 -13
  22. package/dist/assertions/index.js.map +1 -0
  23. package/dist/conversions/index.cjs +34 -103
  24. package/dist/conversions/index.d.cts +12 -0
  25. package/dist/conversions/index.d.ts +10 -1791
  26. package/dist/conversions/index.js +14 -24
  27. package/dist/conversions-BNIh_tCH.js +380 -0
  28. package/dist/conversions-BNIh_tCH.js.map +1 -0
  29. package/dist/conversions-D_Kh0a_C.cjs +446 -0
  30. package/dist/conversions-D_Kh0a_C.cjs.map +1 -0
  31. package/dist/events/index.cjs +55 -31
  32. package/dist/events/index.cjs.map +1 -0
  33. package/dist/events/index.d.cts +176 -0
  34. package/dist/events/index.d.ts +164 -166
  35. package/dist/events/index.js +50 -12
  36. package/dist/events/index.js.map +1 -0
  37. package/dist/formatEnvPort-B3OLxQk9.cjs +171 -0
  38. package/dist/formatEnvPort-B3OLxQk9.cjs.map +1 -0
  39. package/dist/formatEnvPort-ByFVLjSV.js +159 -0
  40. package/dist/formatEnvPort-ByFVLjSV.js.map +1 -0
  41. package/dist/formatters/index.cjs +21 -61
  42. package/dist/formatters/index.d.cts +12 -0
  43. package/dist/formatters/index.d.ts +10 -2152
  44. package/dist/formatters/index.js +10 -18
  45. package/dist/formatters--1m_vpE8.js +369 -0
  46. package/dist/formatters--1m_vpE8.js.map +1 -0
  47. package/dist/formatters-Cbij0XLU.cjs +429 -0
  48. package/dist/formatters-Cbij0XLU.cjs.map +1 -0
  49. package/dist/generators/index.cjs +165 -41
  50. package/dist/generators/index.cjs.map +1 -0
  51. package/dist/generators/index.d.cts +12 -0
  52. package/dist/generators/index.d.ts +10 -338
  53. package/dist/generators/index.js +158 -14
  54. package/dist/generators/index.js.map +1 -0
  55. package/dist/index-59zbLcPr.d.ts +340 -0
  56. package/dist/index-B6tawc8L.d.cts +1716 -0
  57. package/dist/index-C267akkJ.d.ts +2158 -0
  58. package/dist/index-CeBC2Vvl.d.cts +2361 -0
  59. package/dist/index-CgRDTI6f.d.ts +822 -0
  60. package/dist/index-CoiUBVmr.d.ts +720 -0
  61. package/dist/index-D4fcasfZ.d.cts +720 -0
  62. package/dist/index-DDrSQKIc.d.ts +1716 -0
  63. package/dist/index-DsGxO31H.d.cts +765 -0
  64. package/dist/index-Hg1qJkjl.d.ts +765 -0
  65. package/dist/index-Qm3iFwd0.d.cts +2158 -0
  66. package/dist/index-UPp94Agr.d.ts +2361 -0
  67. package/dist/index-gBA_8SuF.d.cts +340 -0
  68. package/dist/index-jyDqzicx.d.cts +822 -0
  69. package/dist/isBigInt-C4krUeAw.cjs +20 -0
  70. package/dist/isBigInt-C4krUeAw.cjs.map +1 -0
  71. package/dist/isBigInt-DKe0M6hp.js +14 -0
  72. package/dist/isBigInt-DKe0M6hp.js.map +1 -0
  73. package/dist/isEmptyObject-DCipFwxJ.js +25 -0
  74. package/dist/isEmptyObject-DCipFwxJ.js.map +1 -0
  75. package/dist/isEmptyObject-ZkSwRC_D.cjs +37 -0
  76. package/dist/isEmptyObject-ZkSwRC_D.cjs.map +1 -0
  77. package/dist/isEmptyString-BXzKAC2j.js +15 -0
  78. package/dist/isEmptyString-BXzKAC2j.js.map +1 -0
  79. package/dist/isEmptyString-UiiUsSQj.cjs +21 -0
  80. package/dist/isEmptyString-UiiUsSQj.cjs.map +1 -0
  81. package/dist/isEmptyValue-BQzcjVaL.cjs +30 -0
  82. package/dist/isEmptyValue-BQzcjVaL.cjs.map +1 -0
  83. package/dist/isEmptyValue-jqOr7OHD.js +24 -0
  84. package/dist/isEmptyValue-jqOr7OHD.js.map +1 -0
  85. package/dist/isEqual-BX49cF9m.js +87 -0
  86. package/dist/isEqual-BX49cF9m.js.map +1 -0
  87. package/dist/isEqual-BvumA3RA.cjs +111 -0
  88. package/dist/isEqual-BvumA3RA.cjs.map +1 -0
  89. package/dist/isFinite-BCnaDpod.js +15 -0
  90. package/dist/isFinite-BCnaDpod.js.map +1 -0
  91. package/dist/isFinite-D24ZaE6c.cjs +21 -0
  92. package/dist/isFinite-D24ZaE6c.cjs.map +1 -0
  93. package/dist/isInteger-Caeuz0rB.cjs +20 -0
  94. package/dist/isInteger-Caeuz0rB.cjs.map +1 -0
  95. package/dist/isInteger-naMbJsxJ.js +14 -0
  96. package/dist/isInteger-naMbJsxJ.js.map +1 -0
  97. package/dist/isPlainObject-BF-2-phb.d.cts +339 -0
  98. package/dist/isPlainObject-DxNDL8XU.d.ts +339 -0
  99. package/dist/isServer-BJHVnixd.cjs +20 -0
  100. package/dist/isServer-BJHVnixd.cjs.map +1 -0
  101. package/dist/isServer-Da3o3XSs.js +14 -0
  102. package/dist/isServer-Da3o3XSs.js.map +1 -0
  103. package/dist/isTypedArray-DuNA8tK6.js +31 -0
  104. package/dist/isTypedArray-DuNA8tK6.js.map +1 -0
  105. package/dist/isTypedArray-TJptiw2b.cjs +43 -0
  106. package/dist/isTypedArray-TJptiw2b.cjs.map +1 -0
  107. package/dist/isURL-C-kSk6KJ.js +14 -0
  108. package/dist/isURL-C-kSk6KJ.js.map +1 -0
  109. package/dist/isURL-DeUPO_oR.cjs +20 -0
  110. package/dist/isURL-DeUPO_oR.cjs.map +1 -0
  111. package/dist/isValidDomain-BB9IGhJs.cjs +1845 -0
  112. package/dist/isValidDomain-BB9IGhJs.cjs.map +1 -0
  113. package/dist/isValidDomain-DoE98yhJ.js +1827 -0
  114. package/dist/isValidDomain-DoE98yhJ.js.map +1 -0
  115. package/dist/next/index.cjs +119 -214
  116. package/dist/next/index.cjs.map +1 -0
  117. package/dist/next/index.d.cts +220 -0
  118. package/dist/next/index.d.ts +203 -214
  119. package/dist/next/index.js +117 -212
  120. package/dist/next/index.js.map +1 -0
  121. package/dist/next/server/index.cjs +25 -40
  122. package/dist/next/server/index.cjs.map +1 -0
  123. package/dist/next/server/index.d.cts +39 -0
  124. package/dist/next/server/index.d.ts +34 -35
  125. package/dist/next/server/index.js +23 -38
  126. package/dist/next/server/index.js.map +1 -0
  127. package/dist/noop-B13_ii35.cjs +18 -0
  128. package/dist/noop-B13_ii35.cjs.map +1 -0
  129. package/dist/noop-ubqAIbHD.js +12 -0
  130. package/dist/noop-ubqAIbHD.js.map +1 -0
  131. package/dist/normalizeSpaces-Bg2IZW7W.js +23 -0
  132. package/dist/normalizeSpaces-Bg2IZW7W.js.map +1 -0
  133. package/dist/normalizeSpaces-ZXnR4Qzp.cjs +29 -0
  134. package/dist/normalizeSpaces-ZXnR4Qzp.cjs.map +1 -0
  135. package/dist/normalizeString-BDdkaXui.js +15 -0
  136. package/dist/normalizeString-BDdkaXui.js.map +1 -0
  137. package/dist/normalizeString-BE6ELqEb.cjs +21 -0
  138. package/dist/normalizeString-BE6ELqEb.cjs.map +1 -0
  139. package/dist/operations/index.cjs +65 -32
  140. package/dist/operations/index.cjs.map +1 -0
  141. package/dist/operations/index.d.cts +139 -0
  142. package/dist/operations/index.d.ts +129 -134
  143. package/dist/operations/index.js +61 -17
  144. package/dist/operations/index.js.map +1 -0
  145. package/dist/parsers/index.cjs +12 -19
  146. package/dist/parsers/index.d.cts +239 -0
  147. package/dist/parsers/index.d.ts +234 -235
  148. package/dist/parsers/index.js +10 -12
  149. package/dist/parsers-BSBPgvsq.js +643 -0
  150. package/dist/parsers-BSBPgvsq.js.map +1 -0
  151. package/dist/parsers-OqDeffqc.cjs +649 -0
  152. package/dist/parsers-OqDeffqc.cjs.map +1 -0
  153. package/dist/parsing-Cao8b358.js +50 -0
  154. package/dist/parsing-Cao8b358.js.map +1 -0
  155. package/dist/parsing-DOGSCH6N.cjs +56 -0
  156. package/dist/parsing-DOGSCH6N.cjs.map +1 -0
  157. package/dist/predicates/index.cjs +91 -296
  158. package/dist/predicates/index.d.cts +13 -0
  159. package/dist/predicates/index.d.ts +12 -2482
  160. package/dist/predicates/index.js +23 -25
  161. package/dist/predicates-Bj6meyXV.js +256 -0
  162. package/dist/predicates-Bj6meyXV.js.map +1 -0
  163. package/dist/predicates-D0ubqgqy.cjs +412 -0
  164. package/dist/predicates-D0ubqgqy.cjs.map +1 -0
  165. package/dist/promises/index.cjs +76 -24
  166. package/dist/promises/index.cjs.map +1 -0
  167. package/dist/promises/index.d.cts +123 -0
  168. package/dist/promises/index.d.ts +116 -119
  169. package/dist/promises/index.js +73 -13
  170. package/dist/promises/index.js.map +1 -0
  171. package/dist/punyCode-8SrbMWfM.js +179 -0
  172. package/dist/punyCode-8SrbMWfM.js.map +1 -0
  173. package/dist/punyCode-D-Qu6nj6.cjs +185 -0
  174. package/dist/punyCode-D-Qu6nj6.cjs.map +1 -0
  175. package/dist/removeSpaces-Bmc5DX4F.js +19 -0
  176. package/dist/removeSpaces-Bmc5DX4F.js.map +1 -0
  177. package/dist/removeSpaces-CWIvhZHg.cjs +25 -0
  178. package/dist/removeSpaces-CWIvhZHg.cjs.map +1 -0
  179. package/dist/rzl-utils.global.js +20 -9
  180. package/dist/safeJsonParse-BP38mwlj.js +184 -0
  181. package/dist/safeJsonParse-BP38mwlj.js.map +1 -0
  182. package/dist/safeJsonParse-Sms2CJf4.cjs +208 -0
  183. package/dist/safeJsonParse-Sms2CJf4.cjs.map +1 -0
  184. package/dist/safeStableStringify-CJtP89qn.cjs +106 -0
  185. package/dist/safeStableStringify-CJtP89qn.cjs.map +1 -0
  186. package/dist/safeStableStringify-CXOZ9Ub8.js +88 -0
  187. package/dist/safeStableStringify-CXOZ9Ub8.js.map +1 -0
  188. package/dist/strings/index.cjs +79 -81
  189. package/dist/strings/index.cjs.map +1 -0
  190. package/dist/strings/index.d.cts +12 -0
  191. package/dist/strings/index.d.ts +10 -775
  192. package/dist/strings/index.js +62 -14
  193. package/dist/strings/index.js.map +1 -0
  194. package/dist/tailwind/index.cjs +19 -47
  195. package/dist/tailwind/index.d.cts +12 -0
  196. package/dist/tailwind/index.d.ts +11 -712
  197. package/dist/tailwind/index.js +10 -12
  198. package/dist/tailwind-B2ssevxq.js +199 -0
  199. package/dist/tailwind-B2ssevxq.js.map +1 -0
  200. package/dist/tailwind-CHIx9uxu.cjs +247 -0
  201. package/dist/tailwind-CHIx9uxu.cjs.map +1 -0
  202. package/dist/toStringArrayUnRecursive-C4zYCja7.cjs +51 -0
  203. package/dist/toStringArrayUnRecursive-C4zYCja7.cjs.map +1 -0
  204. package/dist/toStringArrayUnRecursive-DJGtPsFb.js +39 -0
  205. package/dist/toStringArrayUnRecursive-DJGtPsFb.js.map +1 -0
  206. package/dist/urls/index.cjs +130 -57
  207. package/dist/urls/index.cjs.map +1 -0
  208. package/dist/urls/index.d.cts +737 -0
  209. package/dist/urls/index.d.ts +699 -708
  210. package/dist/urls/index.js +122 -26
  211. package/dist/urls/index.js.map +1 -0
  212. package/package.json +203 -194
  213. package/dist/chunk-2AFQ33D3.cjs +0 -64
  214. package/dist/chunk-2CYDJVGM.js +0 -246
  215. package/dist/chunk-2MW4JDQ2.cjs +0 -598
  216. package/dist/chunk-2VTDXC3N.cjs +0 -1825
  217. package/dist/chunk-44XX2P34.js +0 -209
  218. package/dist/chunk-4YLBKLGS.cjs +0 -18
  219. package/dist/chunk-566CXQW7.cjs +0 -560
  220. package/dist/chunk-57EPKYID.cjs +0 -397
  221. package/dist/chunk-5MGEC3YG.js +0 -63
  222. package/dist/chunk-6EF52423.cjs +0 -249
  223. package/dist/chunk-6SCOKU3S.js +0 -109
  224. package/dist/chunk-6VUXD3CF.js +0 -119
  225. package/dist/chunk-7B76BSNK.cjs +0 -118
  226. package/dist/chunk-7Y6I2DSU.cjs +0 -101
  227. package/dist/chunk-A7S7E2EE.cjs +0 -308
  228. package/dist/chunk-AJZ6PMMZ.js +0 -16
  229. package/dist/chunk-AXGBL2IO.cjs +0 -251
  230. package/dist/chunk-B4TC6FBV.cjs +0 -678
  231. package/dist/chunk-BAV5T2E3.cjs +0 -15
  232. package/dist/chunk-BKIJBNIE.js +0 -21
  233. package/dist/chunk-BNIMTFK5.js +0 -59
  234. package/dist/chunk-BXW7YXB7.js +0 -1823
  235. package/dist/chunk-CFYZC4S6.js +0 -53
  236. package/dist/chunk-CSG4SCL3.js +0 -1587
  237. package/dist/chunk-CWQW7AKK.js +0 -676
  238. package/dist/chunk-DVMHRLKP.cjs +0 -16
  239. package/dist/chunk-EN7LVZBZ.js +0 -548
  240. package/dist/chunk-EV4Y7HCY.cjs +0 -26
  241. package/dist/chunk-F66VDYIZ.cjs +0 -18
  242. package/dist/chunk-FLJX37EL.cjs +0 -30
  243. package/dist/chunk-GKC3UDMC.cjs +0 -1623
  244. package/dist/chunk-H65I3GRZ.cjs +0 -106
  245. package/dist/chunk-HHYWB7VZ.js +0 -24
  246. package/dist/chunk-HNGGISFL.cjs +0 -65
  247. package/dist/chunk-HNSQAVSZ.cjs +0 -35
  248. package/dist/chunk-HSP6IWZK.js +0 -17
  249. package/dist/chunk-IDZS7J6T.js +0 -242
  250. package/dist/chunk-JS6R55VL.js +0 -302
  251. package/dist/chunk-JZVT5FK7.js +0 -232
  252. package/dist/chunk-KHO2SBNA.cjs +0 -16
  253. package/dist/chunk-KIDJCMNJ.js +0 -33
  254. package/dist/chunk-KOLEURVT.cjs +0 -38
  255. package/dist/chunk-L4V53MQK.cjs +0 -269
  256. package/dist/chunk-L5RDAVVH.js +0 -14
  257. package/dist/chunk-NODTV4F3.js +0 -16
  258. package/dist/chunk-NYK5K3V2.cjs +0 -211
  259. package/dist/chunk-ODUO3RTL.cjs +0 -113
  260. package/dist/chunk-ONZFBJVW.js +0 -14
  261. package/dist/chunk-PFXCTE37.js +0 -28
  262. package/dist/chunk-PPST7QAQ.js +0 -587
  263. package/dist/chunk-Q5IMYDFL.cjs +0 -33
  264. package/dist/chunk-QFFBIOJ4.js +0 -31
  265. package/dist/chunk-QNKGP5DY.js +0 -14
  266. package/dist/chunk-RRQHMOPE.cjs +0 -19
  267. package/dist/chunk-RU5OSRBU.js +0 -95
  268. package/dist/chunk-SDMPEJ4F.js +0 -35
  269. package/dist/chunk-SYNL5IKP.js +0 -115
  270. package/dist/chunk-TCDOWZQE.js +0 -16
  271. package/dist/chunk-TQPGXGKB.cjs +0 -123
  272. package/dist/chunk-TULOI4GL.js +0 -370
  273. package/dist/chunk-UBHCP4N5.cjs +0 -36
  274. package/dist/chunk-UCHF3M34.cjs +0 -56
  275. package/dist/chunk-UDA26MCU.cjs +0 -16
  276. package/dist/chunk-V3C4FYZL.cjs +0 -18
  277. package/dist/chunk-VAAHZFBF.js +0 -32
  278. package/dist/chunk-VJDDGRIK.cjs +0 -16
  279. package/dist/chunk-WVSPXFTY.js +0 -14
  280. package/dist/chunk-WYP76WXB.js +0 -101
  281. package/dist/chunk-YDE4ZBB7.cjs +0 -237
  282. package/dist/chunk-YKQEOO7C.cjs +0 -23
  283. package/dist/chunk-YSZC56SZ.js +0 -264
  284. package/dist/chunk-YWHHVDT4.js +0 -13
  285. package/dist/index.d.ts +0 -24
  286. package/dist/isPlainObject-DTJVV2Kf.d.ts +0 -536
@@ -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;