@rzl-zone/utils-js 3.12.1-beta.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 (239) hide show
  1. package/README.md +7 -7
  2. package/dist/.references/index.d.cts +1 -1
  3. package/dist/.references/index.d.ts +1 -1
  4. package/dist/{assertIsArray-BChqwPiP.cjs → assertIsArray-DJXkjHZs.cjs} +3 -3
  5. package/dist/{assertIsArray-BChqwPiP.cjs.map → assertIsArray-DJXkjHZs.cjs.map} +1 -1
  6. package/dist/{assertIsArray-BfAbIUfa.js → assertIsArray-bTA3XLjq.js} +3 -3
  7. package/dist/{assertIsArray-BfAbIUfa.js.map → assertIsArray-bTA3XLjq.js.map} +1 -1
  8. package/dist/{assertIsBoolean-DozdtbNi.cjs → assertIsBoolean-C8WEXVr2.cjs} +8 -8
  9. package/dist/assertIsBoolean-C8WEXVr2.cjs.map +1 -0
  10. package/dist/{assertIsBoolean-BlBct0Fc.js → assertIsBoolean-DR1SaXPD.js} +8 -8
  11. package/dist/assertIsBoolean-DR1SaXPD.js.map +1 -0
  12. package/dist/{assertIsString-Bvk7bUL7.cjs → assertIsString-BiHQSrB2.cjs} +3 -3
  13. package/dist/{assertIsString-Bvk7bUL7.cjs.map → assertIsString-BiHQSrB2.cjs.map} +1 -1
  14. package/dist/{assertIsString-DqV9NwbI.js → assertIsString-CEB07_83.js} +3 -3
  15. package/dist/{assertIsString-DqV9NwbI.js.map → assertIsString-CEB07_83.js.map} +1 -1
  16. package/dist/assertions/index.cjs +5 -5
  17. package/dist/assertions/index.d.cts +2 -2
  18. package/dist/assertions/index.d.ts +2 -2
  19. package/dist/assertions/index.js +5 -5
  20. package/dist/conversions/index.cjs +6 -6
  21. package/dist/conversions/index.d.cts +2 -2
  22. package/dist/conversions/index.d.ts +2 -2
  23. package/dist/conversions/index.js +6 -6
  24. package/dist/{conversions-EMJa3g-D.js → conversions-BNIh_tCH.js} +16 -18
  25. package/dist/conversions-BNIh_tCH.js.map +1 -0
  26. package/dist/{conversions-CBs8-REq.cjs → conversions-D_Kh0a_C.cjs} +16 -18
  27. package/dist/conversions-D_Kh0a_C.cjs.map +1 -0
  28. package/dist/events/index.cjs +4 -4
  29. package/dist/events/index.cjs.map +1 -1
  30. package/dist/events/index.d.cts +153 -151
  31. package/dist/events/index.d.ts +153 -151
  32. package/dist/events/index.js +4 -4
  33. package/dist/events/index.js.map +1 -1
  34. package/dist/{formatEnvPort-hHNvOim-.cjs → formatEnvPort-B3OLxQk9.cjs} +9 -9
  35. package/dist/formatEnvPort-B3OLxQk9.cjs.map +1 -0
  36. package/dist/{formatEnvPort-DpIXzPAZ.js → formatEnvPort-ByFVLjSV.js} +9 -9
  37. package/dist/formatEnvPort-ByFVLjSV.js.map +1 -0
  38. package/dist/formatters/index.cjs +2 -2
  39. package/dist/formatters/index.d.cts +2 -2
  40. package/dist/formatters/index.d.ts +2 -2
  41. package/dist/formatters/index.js +2 -2
  42. package/dist/{formatters-QcZO_Cpx.js → formatters--1m_vpE8.js} +17 -15
  43. package/dist/formatters--1m_vpE8.js.map +1 -0
  44. package/dist/{formatters-lAYgA11L.cjs → formatters-Cbij0XLU.cjs} +17 -15
  45. package/dist/formatters-Cbij0XLU.cjs.map +1 -0
  46. package/dist/generators/index.cjs +12 -8
  47. package/dist/generators/index.cjs.map +1 -1
  48. package/dist/generators/index.d.cts +2 -2
  49. package/dist/generators/index.d.ts +2 -2
  50. package/dist/generators/index.js +12 -8
  51. package/dist/generators/index.js.map +1 -1
  52. package/dist/index-59zbLcPr.d.ts +340 -0
  53. package/dist/index-B6tawc8L.d.cts +1716 -0
  54. package/dist/index-C267akkJ.d.ts +2158 -0
  55. package/dist/index-CeBC2Vvl.d.cts +2361 -0
  56. package/dist/index-CgRDTI6f.d.ts +822 -0
  57. package/dist/index-CoiUBVmr.d.ts +720 -0
  58. package/dist/index-D4fcasfZ.d.cts +720 -0
  59. package/dist/index-DDrSQKIc.d.ts +1716 -0
  60. package/dist/index-DsGxO31H.d.cts +765 -0
  61. package/dist/index-Hg1qJkjl.d.ts +765 -0
  62. package/dist/index-Qm3iFwd0.d.cts +2158 -0
  63. package/dist/index-UPp94Agr.d.ts +2361 -0
  64. package/dist/index-gBA_8SuF.d.cts +340 -0
  65. package/dist/index-jyDqzicx.d.cts +822 -0
  66. package/dist/{isBigInt-B1cijjqm.cjs → isBigInt-C4krUeAw.cjs} +2 -2
  67. package/dist/{isBigInt-B1cijjqm.cjs.map → isBigInt-C4krUeAw.cjs.map} +1 -1
  68. package/dist/{isBigInt-C0bN0Rhu.js → isBigInt-DKe0M6hp.js} +2 -2
  69. package/dist/{isBigInt-C0bN0Rhu.js.map → isBigInt-DKe0M6hp.js.map} +1 -1
  70. package/dist/{isEmptyObject-DeLVIJpl.js → isEmptyObject-DCipFwxJ.js} +3 -3
  71. package/dist/{isEmptyObject-DeLVIJpl.js.map → isEmptyObject-DCipFwxJ.js.map} +1 -1
  72. package/dist/{isEmptyObject-DI42NEo0.cjs → isEmptyObject-ZkSwRC_D.cjs} +3 -3
  73. package/dist/{isEmptyObject-DI42NEo0.cjs.map → isEmptyObject-ZkSwRC_D.cjs.map} +1 -1
  74. package/dist/{isEmptyString-BTUWYTbw.js → isEmptyString-BXzKAC2j.js} +3 -3
  75. package/dist/{isEmptyString-BTUWYTbw.js.map → isEmptyString-BXzKAC2j.js.map} +1 -1
  76. package/dist/{isEmptyString-CCK3bP74.cjs → isEmptyString-UiiUsSQj.cjs} +3 -3
  77. package/dist/{isEmptyString-CCK3bP74.cjs.map → isEmptyString-UiiUsSQj.cjs.map} +1 -1
  78. package/dist/{isEmptyValue-DMSMFTU8.cjs → isEmptyValue-BQzcjVaL.cjs} +5 -5
  79. package/dist/{isEmptyValue-DMSMFTU8.cjs.map → isEmptyValue-BQzcjVaL.cjs.map} +1 -1
  80. package/dist/{isEmptyValue-fjnfQnt5.js → isEmptyValue-jqOr7OHD.js} +5 -5
  81. package/dist/{isEmptyValue-fjnfQnt5.js.map → isEmptyValue-jqOr7OHD.js.map} +1 -1
  82. package/dist/{isEqual-DhyP8fB_.js → isEqual-BX49cF9m.js} +4 -4
  83. package/dist/{isEqual-DhyP8fB_.js.map → isEqual-BX49cF9m.js.map} +1 -1
  84. package/dist/{isEqual-B1fRgEuU.cjs → isEqual-BvumA3RA.cjs} +4 -4
  85. package/dist/{isEqual-B1fRgEuU.cjs.map → isEqual-BvumA3RA.cjs.map} +1 -1
  86. package/dist/{isFinite-BYMOo0os.js → isFinite-BCnaDpod.js} +3 -3
  87. package/dist/{isFinite-BYMOo0os.js.map → isFinite-BCnaDpod.js.map} +1 -1
  88. package/dist/{isFinite-sFkps2TY.cjs → isFinite-D24ZaE6c.cjs} +3 -3
  89. package/dist/{isFinite-sFkps2TY.cjs.map → isFinite-D24ZaE6c.cjs.map} +1 -1
  90. package/dist/{isInteger-FTCthMre.cjs → isInteger-Caeuz0rB.cjs} +2 -2
  91. package/dist/{isInteger-FTCthMre.cjs.map → isInteger-Caeuz0rB.cjs.map} +1 -1
  92. package/dist/{isInteger-DS9V7l_f.js → isInteger-naMbJsxJ.js} +2 -2
  93. package/dist/{isInteger-DS9V7l_f.js.map → isInteger-naMbJsxJ.js.map} +1 -1
  94. package/dist/isPlainObject-BF-2-phb.d.cts +339 -0
  95. package/dist/isPlainObject-DxNDL8XU.d.ts +339 -0
  96. package/dist/{isServer-q-QLFCqE.cjs → isServer-BJHVnixd.cjs} +2 -2
  97. package/dist/{isServer-q-QLFCqE.cjs.map → isServer-BJHVnixd.cjs.map} +1 -1
  98. package/dist/{isServer-D1TXfOs3.js → isServer-Da3o3XSs.js} +2 -2
  99. package/dist/{isServer-D1TXfOs3.js.map → isServer-Da3o3XSs.js.map} +1 -1
  100. package/dist/{isTypedArray-47R0wdrc.js → isTypedArray-DuNA8tK6.js} +3 -3
  101. package/dist/{isTypedArray-47R0wdrc.js.map → isTypedArray-DuNA8tK6.js.map} +1 -1
  102. package/dist/{isTypedArray-DiCoqffZ.cjs → isTypedArray-TJptiw2b.cjs} +3 -3
  103. package/dist/{isTypedArray-DiCoqffZ.cjs.map → isTypedArray-TJptiw2b.cjs.map} +1 -1
  104. package/dist/{isURL-CQiowFq2.js → isURL-C-kSk6KJ.js} +2 -2
  105. package/dist/{isURL-CQiowFq2.js.map → isURL-C-kSk6KJ.js.map} +1 -1
  106. package/dist/{isURL-WZypXsax.cjs → isURL-DeUPO_oR.cjs} +2 -2
  107. package/dist/{isURL-WZypXsax.cjs.map → isURL-DeUPO_oR.cjs.map} +1 -1
  108. package/dist/{isValidDomain-BSXshgkC.cjs → isValidDomain-BB9IGhJs.cjs} +65 -8
  109. package/dist/isValidDomain-BB9IGhJs.cjs.map +1 -0
  110. package/dist/{isValidDomain-DwA2EN79.js → isValidDomain-DoE98yhJ.js} +54 -9
  111. package/dist/isValidDomain-DoE98yhJ.js.map +1 -0
  112. package/dist/next/index.cjs +7 -7
  113. package/dist/next/index.cjs.map +1 -1
  114. package/dist/next/index.d.cts +185 -191
  115. package/dist/next/index.d.ts +185 -191
  116. package/dist/next/index.js +7 -7
  117. package/dist/next/index.js.map +1 -1
  118. package/dist/next/server/index.cjs +2 -2
  119. package/dist/next/server/index.d.cts +26 -26
  120. package/dist/next/server/index.d.ts +26 -26
  121. package/dist/next/server/index.js +2 -2
  122. package/dist/{noop-B2mTBhW-.cjs → noop-B13_ii35.cjs} +2 -2
  123. package/dist/{noop-B2mTBhW-.cjs.map → noop-B13_ii35.cjs.map} +1 -1
  124. package/dist/{noop-BzktGBVz.js → noop-ubqAIbHD.js} +2 -2
  125. package/dist/{noop-BzktGBVz.js.map → noop-ubqAIbHD.js.map} +1 -1
  126. package/dist/{normalizeSpaces-WS_iERJk.js → normalizeSpaces-Bg2IZW7W.js} +3 -3
  127. package/dist/{normalizeSpaces-WS_iERJk.js.map → normalizeSpaces-Bg2IZW7W.js.map} +1 -1
  128. package/dist/{normalizeSpaces-DQHR3Tlr.cjs → normalizeSpaces-ZXnR4Qzp.cjs} +3 -3
  129. package/dist/{normalizeSpaces-DQHR3Tlr.cjs.map → normalizeSpaces-ZXnR4Qzp.cjs.map} +1 -1
  130. package/dist/{normalizeString-2WLth_Gj.js → normalizeString-BDdkaXui.js} +3 -3
  131. package/dist/{normalizeString-2WLth_Gj.js.map → normalizeString-BDdkaXui.js.map} +1 -1
  132. package/dist/{normalizeString-D8euBcRD.cjs → normalizeString-BE6ELqEb.cjs} +3 -3
  133. package/dist/{normalizeString-D8euBcRD.cjs.map → normalizeString-BE6ELqEb.cjs.map} +1 -1
  134. package/dist/operations/index.cjs +10 -10
  135. package/dist/operations/index.cjs.map +1 -1
  136. package/dist/operations/index.d.cts +120 -120
  137. package/dist/operations/index.d.ts +120 -120
  138. package/dist/operations/index.js +10 -10
  139. package/dist/operations/index.js.map +1 -1
  140. package/dist/parsers/index.cjs +2 -2
  141. package/dist/parsers/index.d.cts +222 -222
  142. package/dist/parsers/index.d.ts +222 -222
  143. package/dist/parsers/index.js +2 -2
  144. package/dist/{parsers-Dpuq-V4u.js → parsers-BSBPgvsq.js} +4 -4
  145. package/dist/{parsers-Dpuq-V4u.js.map → parsers-BSBPgvsq.js.map} +1 -1
  146. package/dist/{parsers-DXtpsDyj.cjs → parsers-OqDeffqc.cjs} +4 -4
  147. package/dist/{parsers-DXtpsDyj.cjs.map → parsers-OqDeffqc.cjs.map} +1 -1
  148. package/dist/{parsing-B43x1sxn.js → parsing-Cao8b358.js} +3 -3
  149. package/dist/{parsing-B43x1sxn.js.map → parsing-Cao8b358.js.map} +1 -1
  150. package/dist/{parsing-lRoxn1Nz.cjs → parsing-DOGSCH6N.cjs} +3 -3
  151. package/dist/{parsing-lRoxn1Nz.cjs.map → parsing-DOGSCH6N.cjs.map} +1 -1
  152. package/dist/predicates/index.cjs +15 -15
  153. package/dist/predicates/index.d.cts +3 -3
  154. package/dist/predicates/index.d.ts +3 -3
  155. package/dist/predicates/index.js +15 -15
  156. package/dist/{predicates-gNepszvo.js → predicates-Bj6meyXV.js} +13 -14
  157. package/dist/{predicates-gNepszvo.js.map → predicates-Bj6meyXV.js.map} +1 -1
  158. package/dist/{predicates-DiaYA7Ps.cjs → predicates-D0ubqgqy.cjs} +13 -14
  159. package/dist/{predicates-DiaYA7Ps.cjs.map → predicates-D0ubqgqy.cjs.map} +1 -1
  160. package/dist/promises/index.cjs +4 -4
  161. package/dist/promises/index.d.cts +101 -101
  162. package/dist/promises/index.d.ts +101 -101
  163. package/dist/promises/index.js +4 -4
  164. package/dist/{punyCode-hmiFzLWT.js → punyCode-8SrbMWfM.js} +6 -6
  165. package/dist/punyCode-8SrbMWfM.js.map +1 -0
  166. package/dist/{punyCode-CTWXVVFo.cjs → punyCode-D-Qu6nj6.cjs} +6 -6
  167. package/dist/punyCode-D-Qu6nj6.cjs.map +1 -0
  168. package/dist/{removeSpaces-BE8lfh-4.js → removeSpaces-Bmc5DX4F.js} +3 -3
  169. package/dist/removeSpaces-Bmc5DX4F.js.map +1 -0
  170. package/dist/{removeSpaces-DRRxNWlb.cjs → removeSpaces-CWIvhZHg.cjs} +3 -3
  171. package/dist/removeSpaces-CWIvhZHg.cjs.map +1 -0
  172. package/dist/rzl-utils.global.js +21 -0
  173. package/dist/{safeJsonParse-CXruaP0p.js → safeJsonParse-BP38mwlj.js} +9 -9
  174. package/dist/safeJsonParse-BP38mwlj.js.map +1 -0
  175. package/dist/{safeJsonParse-BBnQElk8.cjs → safeJsonParse-Sms2CJf4.cjs} +9 -9
  176. package/dist/safeJsonParse-Sms2CJf4.cjs.map +1 -0
  177. package/dist/{safeStableStringify-Cc62pfRp.cjs → safeStableStringify-CJtP89qn.cjs} +4 -4
  178. package/dist/{safeStableStringify-Cc62pfRp.cjs.map → safeStableStringify-CJtP89qn.cjs.map} +1 -1
  179. package/dist/{safeStableStringify-BNh3D0K0.js → safeStableStringify-CXOZ9Ub8.js} +4 -4
  180. package/dist/{safeStableStringify-BNh3D0K0.js.map → safeStableStringify-CXOZ9Ub8.js.map} +1 -1
  181. package/dist/strings/index.cjs +12 -9
  182. package/dist/strings/index.cjs.map +1 -1
  183. package/dist/strings/index.d.cts +2 -2
  184. package/dist/strings/index.d.ts +2 -2
  185. package/dist/strings/index.js +12 -9
  186. package/dist/strings/index.js.map +1 -1
  187. package/dist/tailwind/index.cjs +2 -2
  188. package/dist/tailwind/index.d.cts +2 -2
  189. package/dist/tailwind/index.d.ts +2 -2
  190. package/dist/tailwind/index.js +2 -2
  191. package/dist/{tailwind-IJvOdkZp.js → tailwind-B2ssevxq.js} +5 -5
  192. package/dist/tailwind-B2ssevxq.js.map +1 -0
  193. package/dist/{tailwind-DJ4cmLUw.cjs → tailwind-CHIx9uxu.cjs} +5 -5
  194. package/dist/tailwind-CHIx9uxu.cjs.map +1 -0
  195. package/dist/{toStringArrayUnRecursive-xUaU8Ot9.cjs → toStringArrayUnRecursive-C4zYCja7.cjs} +6 -6
  196. package/dist/{toStringArrayUnRecursive-xUaU8Ot9.cjs.map → toStringArrayUnRecursive-C4zYCja7.cjs.map} +1 -1
  197. package/dist/{toStringArrayUnRecursive-CFs0jTEg.js → toStringArrayUnRecursive-DJGtPsFb.js} +6 -6
  198. package/dist/{toStringArrayUnRecursive-CFs0jTEg.js.map → toStringArrayUnRecursive-DJGtPsFb.js.map} +1 -1
  199. package/dist/urls/index.cjs +15 -14
  200. package/dist/urls/index.cjs.map +1 -1
  201. package/dist/urls/index.d.cts +656 -659
  202. package/dist/urls/index.d.ts +656 -659
  203. package/dist/urls/index.js +15 -14
  204. package/dist/urls/index.js.map +1 -1
  205. package/package.json +2 -2
  206. package/dist/assertIsBoolean-BlBct0Fc.js.map +0 -1
  207. package/dist/assertIsBoolean-DozdtbNi.cjs.map +0 -1
  208. package/dist/conversions-CBs8-REq.cjs.map +0 -1
  209. package/dist/conversions-EMJa3g-D.js.map +0 -1
  210. package/dist/formatEnvPort-DpIXzPAZ.js.map +0 -1
  211. package/dist/formatEnvPort-hHNvOim-.cjs.map +0 -1
  212. package/dist/formatters-QcZO_Cpx.js.map +0 -1
  213. package/dist/formatters-lAYgA11L.cjs.map +0 -1
  214. package/dist/index-26W7ItWx.d.ts +0 -760
  215. package/dist/index-BPPQjAfs.d.cts +0 -2359
  216. package/dist/index-BXjlgBLz.d.cts +0 -2139
  217. package/dist/index-B_Wwo91H.d.ts +0 -2359
  218. package/dist/index-CpufydcI.d.cts +0 -704
  219. package/dist/index-Czc4O526.d.ts +0 -333
  220. package/dist/index-DPs1_p5G.d.cts +0 -760
  221. package/dist/index-DRpOyBSC.d.ts +0 -1703
  222. package/dist/index-DWWvtHUn.d.cts +0 -822
  223. package/dist/index-DnM0LD0n.d.cts +0 -333
  224. package/dist/index-GUZ9fK6T.d.ts +0 -2139
  225. package/dist/index-I4fAzwXV.d.ts +0 -704
  226. package/dist/index-JDrOl_19.d.ts +0 -822
  227. package/dist/index-b66P49Qe.d.cts +0 -1703
  228. package/dist/isPlainObject-DcFGh3_5.d.ts +0 -530
  229. package/dist/isPlainObject-doTI11Ib.d.cts +0 -530
  230. package/dist/isValidDomain-BSXshgkC.cjs.map +0 -1
  231. package/dist/isValidDomain-DwA2EN79.js.map +0 -1
  232. package/dist/punyCode-CTWXVVFo.cjs.map +0 -1
  233. package/dist/punyCode-hmiFzLWT.js.map +0 -1
  234. package/dist/removeSpaces-BE8lfh-4.js.map +0 -1
  235. package/dist/removeSpaces-DRRxNWlb.cjs.map +0 -1
  236. package/dist/safeJsonParse-BBnQElk8.cjs.map +0 -1
  237. package/dist/safeJsonParse-CXruaP0p.js.map +0 -1
  238. package/dist/tailwind-DJ4cmLUw.cjs.map +0 -1
  239. package/dist/tailwind-IJvOdkZp.js.map +0 -1
package/README.md CHANGED
@@ -4,13 +4,13 @@
4
4
  </a>
5
5
  </div>
6
6
 
7
- <h1 align="center"><strong>UtilsJS</strong></h1>
7
+ <h1 align="center"><strong>Utils JS</strong></h1>
8
8
 
9
9
  <p align="center">
10
10
  <i>
11
- A lightweight, modern TypeScript utility library for Node.js & browser (via bundlers like <a href="https://webpack.js.org"><code>Webpack</code></a>, <a href="https://vercel.com/blog/turbopack"><code>Turbopack</code></a>, or <a href="https://vite.dev/"><code>Vite</code></a>).
11
+ A lightweight, modern TypeScript utility library for Node.js & browser (via bundlers like <a href="https://webpack.js.org/"><code>Webpack</code></a>, <a href="https://vercel.com/blog/turbopack/"><code>Turbopack</code></a>, <a href="https://rollupjs.org/"><code>Rollup</code></a>, <a href="https://esbuild.github.io/"><code>esbuild</code></a>, and higher-level tools like <a href="https://vite.dev/"><code>Vite</code></a>, <a href="https://tsup.egoist.dev/"><code>tsup</code></a> and <a href="https://tsdown.dev/"><code>tsdown</code></a>).
12
12
  </i><br/>
13
- <i>Provides reusable helpers to simplify your JavaScript or TypeScript projects.</i><br/>
13
+ <i>It provides reusable helpers to simplify everyday JavaScript and TypeScript tasks projects.</i><br/>
14
14
  <strong><i>Built with ❤️ by <a href="https://github.com/rzl-zone" target="_blank" rel="nofollow noreferrer noopener">@rzl-zone</a>.</i></strong>
15
15
  </p>
16
16
 
@@ -75,7 +75,7 @@
75
75
  - **Works with:**
76
76
  - ✅ Node.js (18.18.0+) - ***Without NextJS***.
77
77
  - ✅ Node.js (20.9.0, or higher depending on NextJS version) - ***With NextJS***.
78
- - ✅ Modern browsers (via bundlers like [`Webpack`](https://webpack.js.org), [`Turbopack`](https://vercel.com/blog/turbopack), or [`Vite`](https://vite.dev)).
78
+ - ✅ Modern browsers (via **ESM-compatible** bundlers such as [`Webpack`](https://webpack.js.org/), [`Turbopack`](https://vercel.com/blog/turbopack), [`Rollup`](https://rollupjs.org/), [`esbuild`](https://esbuild.github.io/), and higher-level tools like [`Vite`](https://vite.dev/), [`tsup`](https://tsup.egoist.dev/), and [`tsdown`](https://tsdown.dev/)).
79
79
 
80
80
  - **TypeScript Build Info:**
81
81
  - Target: `ES2022`.
@@ -130,7 +130,7 @@ pnpm add @rzl-zone/utils-js@latest
130
130
 
131
131
  ✅ Safe to use in both Next.js pages & API routes.
132
132
 
133
- [**Read More Docs**](/docs/next-js/global.md#docs-sub-main--title)
133
+ [**Read More Docs**](https://github.com/rzl-zone/rzl-zone/blob/main/packages/utils-js/docs/next-js/global.md#docs-sub-main--title)
134
134
 
135
135
  ---
136
136
 
@@ -139,7 +139,7 @@ pnpm add @rzl-zone/utils-js@latest
139
139
 
140
140
  > ⚠️ Will throw Error if used outside a ***Next.js* server environment**.
141
141
 
142
- [**Read More Docs**](/docs/next-js/server-only.md#docs-sub-main--title)
142
+ [**Read More Docs**](https://github.com/rzl-zone/rzl-zone/blob/main/packages/utils-js/docs/next-js/server-only.md#docs-sub-main--title)
143
143
 
144
144
  ---
145
145
 
@@ -201,7 +201,7 @@ pnpm add @rzl-zone/utils-js@latest
201
201
  > - Category utils of `tailwind`, `next`, `next/server`.
202
202
  > - Server-only features (like Next.js helpers) will **not** be available.
203
203
  > - The global object provided is `RzlUtilsJs`.
204
- > - The CDN bundle is **~350KB minified**, for production, consider using bundlers or npm packages for smaller size and tree-shaking.
204
+ > - The CDN bundle is **~370KB+ minified**, for production, consider using bundlers or npm packages for smaller size and tree-shaking.
205
205
 
206
206
  ---
207
207
 
@@ -2,7 +2,7 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.12.1-beta.0`
5
+ * Version: `3.12.1-beta.1`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
@@ -2,7 +2,7 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.12.1-beta.0`
5
+ * Version: `3.12.1-beta.1`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
@@ -2,13 +2,13 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.12.1-beta.0`
5
+ * Version: `3.12.1-beta.1`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
9
9
  */
10
10
  "use strict";
11
- const require_assertIsBoolean = require('./assertIsBoolean-DozdtbNi.cjs');
11
+ const require_assertIsBoolean = require('./assertIsBoolean-C8WEXVr2.cjs');
12
12
  function assertIsArray(value, options) {
13
13
  if (require_assertIsBoolean.isArray(value)) return;
14
14
  require_assertIsBoolean.resolveErrorMessageAssertions({
@@ -23,4 +23,4 @@ Object.defineProperty(exports, 'assertIsArray', {
23
23
  return assertIsArray;
24
24
  }
25
25
  });
26
- //# sourceMappingURL=assertIsArray-BChqwPiP.cjs.map
26
+ //# sourceMappingURL=assertIsArray-DJXkjHZs.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertIsArray-BChqwPiP.cjs","names":["isArray"],"sources":["../src/assertions/objects/assertIsArray.ts"],"sourcesContent":["import type {\n IsArray,\n IsReadonlyArray,\n IsUnknown\n} from \"@rzl-zone/ts-types-plus\";\nimport type { ArrayFallback } from \"@/_private/types.arrays\";\n\nimport { isArray } from \"@/predicates/is/isArray\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype AssertIsArrayResult<T> =\n IsUnknown<T> extends true\n ? unknown[] & T\n : IsReadonlyArray<T> extends true\n ? T\n : T extends []\n ? T\n : IsArray<T> extends true\n ? T\n : Extract<T, unknown[] | [] | readonly []>;\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsArray`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is an **array**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `array` **(generic support)**.\n * - ✅ If `value` is an `array` ➔ execution continues normally.\n * - ❌ If `value` is not an `array` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **⚠️ Error type selection (`options.errorType`):**\n * - You can override the type of error thrown when validation fails.\n * - Must be one of the standard JavaScript built-in errors:\n * - [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) |\n * [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) |\n * [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) |\n * [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) |\n * [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) |\n * [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) |\n * [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)\n * - **Default:** `\"TypeError\"` if not provided or invalid.\n * @template T - The input type being asserted.\n * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIs} [options]\n * ***Optional configuration:***\n * - `message`: A custom error message (`string` or `function`).\n * - `errorType`: Built-in JavaScript error type to throw on failure (default `\"TypeError\"`).\n * - `formatCase`: Controls how detected type names are formatted case in error messages.\n * - `useAcronyms`: Control uppercase preservation of recognized acronyms during formatting.\n * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n * @throws [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) | [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) | [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) | [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) | [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) | [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) if the value is not an array.\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsArray([]);\n * assertIsArray([\"123\", 456]);\n * assertIsArray(Array.from([\"abc\"]));\n * // No error, value is array\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a array\n * assertIsArray(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `array`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsArray(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `array`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsArray(\"123\", { message: \"Must be a array!\" });\n * // ➔ TypeError: \"Must be a array!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsArray(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected array but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsArray(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (url).\"\n * assertIsArray(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URL).\"\n *\n * // Case 2:\n * assertIsArray(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (UrlSearchParams).\"\n * assertIsArray(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | number[] | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `number[]`\n * assertIsArray(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be array!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `number[]` here\n * const result: number[] = mixedValue; // ➔ Safe type assignment\n * console.log(result.push(1, 2, 3)); // ➔ Safe to use array methods\n * ```\n */\nexport function assertIsArray(\n value: [],\n options?: OptionsAssertIs\n): asserts value is [];\nexport function assertIsArray<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is ArrayFallback<T>;\n// export function assertIsArray<T extends unknown[]>(\n// value: T,\n// options?: OptionsAssertIs\n// ): asserts value is Extract<T, unknown[]>;\n// export function assertIsArray<T extends readonly unknown[]>(\n// value: T,\n// options?: OptionsAssertIs\n// ): asserts value is Extract<T, readonly unknown[]>;\nexport function assertIsArray(\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is unknown[];\nexport function assertIsArray<T>(value: T, options?: OptionsAssertIs) {\n if (isArray(value)) return;\n\n resolveErrorMessageAssertions({ value, options, requiredValidType: \"array\" });\n}\n"],"mappings":";;;;;;;;;;;;;AA6JA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAIA,gCAAQ,MAAM,EAAE;CAEpB,sDAA8B;EAAE;EAAO;EAAS,mBAAmB;EAAS,CAAC"}
1
+ {"version":3,"file":"assertIsArray-DJXkjHZs.cjs","names":["isArray"],"sources":["../src/assertions/objects/assertIsArray.ts"],"sourcesContent":["import type {\n IsArray,\n IsReadonlyArray,\n IsUnknown\n} from \"@rzl-zone/ts-types-plus\";\nimport type { ArrayFallback } from \"@/_private/types.arrays\";\n\nimport { isArray } from \"@/predicates/is/isArray\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype AssertIsArrayResult<T> =\n IsUnknown<T> extends true\n ? unknown[] & T\n : IsReadonlyArray<T> extends true\n ? T\n : T extends []\n ? T\n : IsArray<T> extends true\n ? T\n : Extract<T, unknown[] | [] | readonly []>;\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsArray`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is an **array**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `array` **(generic support)**.\n * - ✅ If `value` is an `array` ➔ execution continues normally.\n * - ❌ If `value` is not an `array` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **⚠️ Error type selection (`options.errorType`):**\n * - You can override the type of error thrown when validation fails.\n * - Must be one of the standard JavaScript built-in errors:\n * - [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) |\n * [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) |\n * [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) |\n * [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) |\n * [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) |\n * [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) |\n * [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)\n * - **Default:** `\"TypeError\"` if not provided or invalid.\n * @template T - The input type being asserted.\n * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIs} [options]\n * ***Optional configuration:***\n * - `message`: A custom error message (`string` or `function`).\n * - `errorType`: Built-in JavaScript error type to throw on failure (default `\"TypeError\"`).\n * - `formatCase`: Controls how detected type names are formatted case in error messages.\n * - `useAcronyms`: Control uppercase preservation of recognized acronyms during formatting.\n * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n * @throws [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) | [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) | [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) | [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) | [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) | [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) if the value is not an array.\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsArray([]);\n * assertIsArray([\"123\", 456]);\n * assertIsArray(Array.from([\"abc\"]));\n * // No error, value is array\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a array\n * assertIsArray(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `array`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsArray(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `array`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsArray(\"123\", { message: \"Must be a array!\" });\n * // ➔ TypeError: \"Must be a array!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsArray(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected array but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsArray(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (url).\"\n * assertIsArray(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URL).\"\n *\n * // Case 2:\n * assertIsArray(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (UrlSearchParams).\"\n * assertIsArray(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | number[] | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `number[]`\n * assertIsArray(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be array!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `number[]` here\n * const result: number[] = mixedValue; // ➔ Safe type assignment\n * console.log(result.push(1, 2, 3)); // ➔ Safe to use array methods\n * ```\n */\nexport function assertIsArray(\n value: [],\n options?: OptionsAssertIs\n): asserts value is [];\nexport function assertIsArray<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is ArrayFallback<T>;\nexport function assertIsArray(\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is unknown[];\nexport function assertIsArray<T>(value: T, options?: OptionsAssertIs) {\n if (isArray(value)) return;\n\n resolveErrorMessageAssertions({ value, options, requiredValidType: \"array\" });\n}\n"],"mappings":";;;;;;;;;;;;;AAqJA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAIA,gCAAQ,MAAM,EAAE;CAEpB,sDAA8B;EAAE;EAAO;EAAS,mBAAmB;EAAS,CAAC"}
@@ -2,12 +2,12 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.12.1-beta.0`
5
+ * Version: `3.12.1-beta.1`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
9
9
  */
10
- import { M as isArray, n as resolveErrorMessageAssertions } from "./assertIsBoolean-BlBct0Fc.js";
10
+ import { M as isArray, n as resolveErrorMessageAssertions } from "./assertIsBoolean-DR1SaXPD.js";
11
11
  function assertIsArray(value, options) {
12
12
  if (isArray(value)) return;
13
13
  resolveErrorMessageAssertions({
@@ -17,4 +17,4 @@ function assertIsArray(value, options) {
17
17
  });
18
18
  }
19
19
  export { assertIsArray as t };
20
- //# sourceMappingURL=assertIsArray-BfAbIUfa.js.map
20
+ //# sourceMappingURL=assertIsArray-bTA3XLjq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertIsArray-BfAbIUfa.js","names":[],"sources":["../src/assertions/objects/assertIsArray.ts"],"sourcesContent":["import type {\n IsArray,\n IsReadonlyArray,\n IsUnknown\n} from \"@rzl-zone/ts-types-plus\";\nimport type { ArrayFallback } from \"@/_private/types.arrays\";\n\nimport { isArray } from \"@/predicates/is/isArray\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype AssertIsArrayResult<T> =\n IsUnknown<T> extends true\n ? unknown[] & T\n : IsReadonlyArray<T> extends true\n ? T\n : T extends []\n ? T\n : IsArray<T> extends true\n ? T\n : Extract<T, unknown[] | [] | readonly []>;\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsArray`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is an **array**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `array` **(generic support)**.\n * - ✅ If `value` is an `array` ➔ execution continues normally.\n * - ❌ If `value` is not an `array` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **⚠️ Error type selection (`options.errorType`):**\n * - You can override the type of error thrown when validation fails.\n * - Must be one of the standard JavaScript built-in errors:\n * - [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) |\n * [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) |\n * [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) |\n * [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) |\n * [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) |\n * [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) |\n * [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)\n * - **Default:** `\"TypeError\"` if not provided or invalid.\n * @template T - The input type being asserted.\n * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIs} [options]\n * ***Optional configuration:***\n * - `message`: A custom error message (`string` or `function`).\n * - `errorType`: Built-in JavaScript error type to throw on failure (default `\"TypeError\"`).\n * - `formatCase`: Controls how detected type names are formatted case in error messages.\n * - `useAcronyms`: Control uppercase preservation of recognized acronyms during formatting.\n * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n * @throws [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) | [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) | [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) | [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) | [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) | [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) if the value is not an array.\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsArray([]);\n * assertIsArray([\"123\", 456]);\n * assertIsArray(Array.from([\"abc\"]));\n * // No error, value is array\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a array\n * assertIsArray(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `array`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsArray(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `array`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsArray(\"123\", { message: \"Must be a array!\" });\n * // ➔ TypeError: \"Must be a array!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsArray(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected array but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsArray(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (url).\"\n * assertIsArray(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URL).\"\n *\n * // Case 2:\n * assertIsArray(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (UrlSearchParams).\"\n * assertIsArray(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | number[] | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `number[]`\n * assertIsArray(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be array!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `number[]` here\n * const result: number[] = mixedValue; // ➔ Safe type assignment\n * console.log(result.push(1, 2, 3)); // ➔ Safe to use array methods\n * ```\n */\nexport function assertIsArray(\n value: [],\n options?: OptionsAssertIs\n): asserts value is [];\nexport function assertIsArray<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is ArrayFallback<T>;\n// export function assertIsArray<T extends unknown[]>(\n// value: T,\n// options?: OptionsAssertIs\n// ): asserts value is Extract<T, unknown[]>;\n// export function assertIsArray<T extends readonly unknown[]>(\n// value: T,\n// options?: OptionsAssertIs\n// ): asserts value is Extract<T, readonly unknown[]>;\nexport function assertIsArray(\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is unknown[];\nexport function assertIsArray<T>(value: T, options?: OptionsAssertIs) {\n if (isArray(value)) return;\n\n resolveErrorMessageAssertions({ value, options, requiredValidType: \"array\" });\n}\n"],"mappings":";;;;;;;;;;;;;AA6JA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAI,QAAQ,MAAM,EAAE;CAEpB,8BAA8B;EAAE;EAAO;EAAS,mBAAmB;EAAS,CAAC"}
1
+ {"version":3,"file":"assertIsArray-bTA3XLjq.js","names":[],"sources":["../src/assertions/objects/assertIsArray.ts"],"sourcesContent":["import type {\n IsArray,\n IsReadonlyArray,\n IsUnknown\n} from \"@rzl-zone/ts-types-plus\";\nimport type { ArrayFallback } from \"@/_private/types.arrays\";\n\nimport { isArray } from \"@/predicates/is/isArray\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype AssertIsArrayResult<T> =\n IsUnknown<T> extends true\n ? unknown[] & T\n : IsReadonlyArray<T> extends true\n ? T\n : T extends []\n ? T\n : IsArray<T> extends true\n ? T\n : Extract<T, unknown[] | [] | readonly []>;\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsArray`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is an **array**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `array` **(generic support)**.\n * - ✅ If `value` is an `array` ➔ execution continues normally.\n * - ❌ If `value` is not an `array` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **⚠️ Error type selection (`options.errorType`):**\n * - You can override the type of error thrown when validation fails.\n * - Must be one of the standard JavaScript built-in errors:\n * - [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) |\n * [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) |\n * [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) |\n * [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) |\n * [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) |\n * [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) |\n * [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)\n * - **Default:** `\"TypeError\"` if not provided or invalid.\n * @template T - The input type being asserted.\n * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIs} [options]\n * ***Optional configuration:***\n * - `message`: A custom error message (`string` or `function`).\n * - `errorType`: Built-in JavaScript error type to throw on failure (default `\"TypeError\"`).\n * - `formatCase`: Controls how detected type names are formatted case in error messages.\n * - `useAcronyms`: Control uppercase preservation of recognized acronyms during formatting.\n * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n * @throws [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) | [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) | [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) | [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) | [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) | [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) if the value is not an array.\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsArray([]);\n * assertIsArray([\"123\", 456]);\n * assertIsArray(Array.from([\"abc\"]));\n * // No error, value is array\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a array\n * assertIsArray(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `array`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsArray(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `array`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsArray(\"123\", { message: \"Must be a array!\" });\n * // ➔ TypeError: \"Must be a array!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsArray(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected array but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsArray(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (url).\"\n * assertIsArray(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URL).\"\n *\n * // Case 2:\n * assertIsArray(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (UrlSearchParams).\"\n * assertIsArray(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | number[] | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `number[]`\n * assertIsArray(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be array!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `number[]` here\n * const result: number[] = mixedValue; // ➔ Safe type assignment\n * console.log(result.push(1, 2, 3)); // ➔ Safe to use array methods\n * ```\n */\nexport function assertIsArray(\n value: [],\n options?: OptionsAssertIs\n): asserts value is [];\nexport function assertIsArray<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is ArrayFallback<T>;\nexport function assertIsArray(\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is unknown[];\nexport function assertIsArray<T>(value: T, options?: OptionsAssertIs) {\n if (isArray(value)) return;\n\n resolveErrorMessageAssertions({ value, options, requiredValidType: \"array\" });\n}\n"],"mappings":";;;;;;;;;;;;;AAqJA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAI,QAAQ,MAAM,EAAE;CAEpB,8BAA8B;EAAE;EAAO;EAAS,mBAAmB;EAAS,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.12.1-beta.0`
5
+ * Version: `3.12.1-beta.1`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
@@ -975,7 +975,7 @@ var PreciseType = class PreciseType {
975
975
  }
976
976
  }
977
977
  static normalizeKeyForCase(k) {
978
- return k.replace(/[\s_\-\.]+/g, "").toLowerCase();
978
+ return k.replace(/[\s_\-.]+/g, "").toLowerCase();
979
979
  }
980
980
  static get castableTable() {
981
981
  return PreciseType.FIXES_CASTABLE_TABLE;
@@ -1008,10 +1008,10 @@ const getPreciseType = (() => {
1008
1008
  if (isNull(value)) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("null")] ?? "Null");
1009
1009
  if (isNaN(value)) return "NaN";
1010
1010
  if (isInfinityNumber(value)) return String(value);
1011
- if (typeof BigInt !== "undefined" && value === BigInt) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("bigint constructor")]);
1012
- if (isNumberObject(value) || value === Number) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("number constructor")]);
1013
- if (isStringObject(value) || value === String) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("string constructor")]);
1014
- if (isBooleanObject(value) || value === Boolean) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("boolean constructor")]);
1011
+ if (typeof BigInt !== "undefined" && value === BigInt) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("bigint constructor")] ?? "bigint constructor");
1012
+ if (isNumberObject(value) || value === Number) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("number constructor")] ?? "number constructor");
1013
+ if (isStringObject(value) || value === String) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("string constructor")] ?? "string constructor");
1014
+ if (isBooleanObject(value) || value === Boolean) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("boolean constructor")] ?? "boolean constructor");
1015
1015
  const prim = typeof value;
1016
1016
  if (!isObjectOrArray(value) && !isFunction(value) && prim !== "symbol") return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase(prim)] ?? prim);
1017
1017
  if (prim === "symbol") return ClassPrecise.getSymbolName(value);
@@ -1025,7 +1025,7 @@ const getPreciseType = (() => {
1025
1025
  const ctorName = value.constructor?.name ?? "Error";
1026
1026
  return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase(ctorName)] ?? PreciseType.castableTable[PreciseType.normalizeKeyForCase(ctorName.replace(/\s+/g, ""))] ?? ctorName);
1027
1027
  }
1028
- if (isObjectOrArray(value) && "done" in value && "value" in value && Object.keys(value).length === 2) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("iterator result")]);
1028
+ if (isObjectOrArray(value) && "done" in value && "value" in value && Object.keys(value).length === 2) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("iterator result")] ?? "iterator result");
1029
1029
  if (isNull(Object.getPrototypeOf(value))) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("object")] ?? "Object");
1030
1030
  const tag = Object.prototype.toString.call(value).slice(8, -1) || "Object";
1031
1031
  const mapped = PreciseType.castableTable[PreciseType.normalizeKeyForCase(tag)];
@@ -1280,4 +1280,4 @@ Object.defineProperty(exports, 'toSnakeCase', {
1280
1280
  return toSnakeCase;
1281
1281
  }
1282
1282
  });
1283
- //# sourceMappingURL=assertIsBoolean-DozdtbNi.cjs.map
1283
+ //# sourceMappingURL=assertIsBoolean-C8WEXVr2.cjs.map