@rzl-zone/utils-js 3.13.1 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/README.md +7 -6
  2. package/dist/.references/index.d.cts +2 -1
  3. package/dist/.references/index.d.ts +2 -1
  4. package/dist/AbortError-CgE6QNOR.js +20 -0
  5. package/dist/AbortError-CgE6QNOR.js.map +1 -0
  6. package/dist/AbortError-D54txsmn.cjs +26 -0
  7. package/dist/AbortError-D54txsmn.cjs.map +1 -0
  8. package/dist/{assertIsArray-HgzPQIAM.js → assertIsArray-DmlqnTiq.js} +3 -3
  9. package/dist/assertIsArray-DmlqnTiq.js.map +1 -0
  10. package/dist/{assertIsArray-CeXL4xv5.cjs → assertIsArray-Xx-zlo6O.cjs} +5 -5
  11. package/dist/assertIsArray-Xx-zlo6O.cjs.map +1 -0
  12. package/dist/assertIsPlainObject-CIzDchLs.js +20 -0
  13. package/dist/assertIsPlainObject-CIzDchLs.js.map +1 -0
  14. package/dist/assertIsPlainObject-DYoxHcW5.cjs +26 -0
  15. package/dist/assertIsPlainObject-DYoxHcW5.cjs.map +1 -0
  16. package/dist/{assertIsString-DUrVt82d.cjs → assertIsString-CuPbh3FB.cjs} +6 -6
  17. package/dist/assertIsString-CuPbh3FB.cjs.map +1 -0
  18. package/dist/{assertIsString-CY_WkCLr.js → assertIsString-sgY3ml5f.js} +4 -4
  19. package/dist/assertIsString-sgY3ml5f.js.map +1 -0
  20. package/dist/assertions/index.cjs +14 -12
  21. package/dist/assertions/index.cjs.map +1 -1
  22. package/dist/assertions/index.d.cts +2 -2
  23. package/dist/assertions/index.d.ts +2 -2
  24. package/dist/assertions/index.js +10 -8
  25. package/dist/assertions/index.js.map +1 -1
  26. package/dist/conversions/index.cjs +6 -6
  27. package/dist/conversions/index.d.cts +2 -2
  28. package/dist/conversions/index.d.ts +2 -2
  29. package/dist/conversions/index.js +6 -6
  30. package/dist/{conversions-1s7xMBe_.js → conversions-BkxqYXxy.js} +43 -40
  31. package/dist/conversions-BkxqYXxy.js.map +1 -0
  32. package/dist/conversions-UdMB90xR.cjs +449 -0
  33. package/dist/conversions-UdMB90xR.cjs.map +1 -0
  34. package/dist/errors/index.cjs +13 -0
  35. package/dist/errors/index.d.cts +180 -0
  36. package/dist/errors/index.d.ts +180 -0
  37. package/dist/errors/index.js +11 -0
  38. package/dist/events/index.cjs +10 -9
  39. package/dist/events/index.cjs.map +1 -1
  40. package/dist/events/index.d.cts +185 -100
  41. package/dist/events/index.d.ts +185 -100
  42. package/dist/events/index.js +9 -8
  43. package/dist/events/index.js.map +1 -1
  44. package/dist/formatter-BFgV1HhV-BtIJs2H2.js +55 -0
  45. package/dist/formatter-BFgV1HhV-BtIJs2H2.js.map +1 -0
  46. package/dist/formatter-BFgV1HhV-DyybWSuj.cjs +67 -0
  47. package/dist/formatter-BFgV1HhV-DyybWSuj.cjs.map +1 -0
  48. package/dist/formatters/index.cjs +2 -2
  49. package/dist/formatters/index.d.cts +2 -2
  50. package/dist/formatters/index.d.ts +2 -2
  51. package/dist/formatters/index.js +2 -2
  52. package/dist/formatters-Cjng28nY.cjs +436 -0
  53. package/dist/formatters-Cjng28nY.cjs.map +1 -0
  54. package/dist/{formatters-C6cVZBbG.js → formatters-Dqccnt-p.js} +78 -71
  55. package/dist/formatters-Dqccnt-p.js.map +1 -0
  56. package/dist/generators/index.cjs +37 -31
  57. package/dist/generators/index.cjs.map +1 -1
  58. package/dist/generators/index.d.cts +2 -2
  59. package/dist/generators/index.d.ts +2 -2
  60. package/dist/generators/index.js +29 -23
  61. package/dist/generators/index.js.map +1 -1
  62. package/dist/hasOwnProp-DTWYqy7S.cjs +53 -0
  63. package/dist/hasOwnProp-DTWYqy7S.cjs.map +1 -0
  64. package/dist/hasOwnProp-yVVsxPin.js +47 -0
  65. package/dist/hasOwnProp-yVVsxPin.js.map +1 -0
  66. package/dist/{index-BG8wdusZ.d.cts → index-9Ql1W3gt.d.cts} +229 -200
  67. package/dist/{index-RNQBTK8A.d.cts → index-BD0J8wkE.d.cts} +1374 -936
  68. package/dist/index-BcoUy2oV.d.ts +2424 -0
  69. package/dist/{index-B5EBAgmC.d.cts → index-Bpk3YwGW.d.ts} +1592 -790
  70. package/dist/index-CTMG8cZV.d.ts +1041 -0
  71. package/dist/index-DUBCXPy4.d.cts +1041 -0
  72. package/dist/{index-CRz9rSZL.d.ts → index-DhUTzQ_o.d.ts} +1374 -936
  73. package/dist/{index-B1VQ6USF.d.ts → index-DqYMKSmd.d.ts} +229 -200
  74. package/dist/index-JfwSupYB.d.ts +1103 -0
  75. package/dist/{index-ORbo-7zA.d.cts → index-O2q2f-pu.d.cts} +242 -133
  76. package/dist/{index-DPJ-e2JZ.d.ts → index-VgNZ6ndx.d.cts} +1592 -790
  77. package/dist/{index-ORbo-7zA.d.ts → index-k_rjVRjU.d.ts} +242 -133
  78. package/dist/index-or0oP9i2.d.cts +2179 -0
  79. package/dist/index-or0oP9i2.d.ts +2179 -0
  80. package/dist/index-u4-Euidh.d.cts +1103 -0
  81. package/dist/index-zAqCZxGr.d.cts +2424 -0
  82. package/dist/{isBigInt-y7s3rsKc.js → isBigInt-DdFRCpeE.js} +2 -2
  83. package/dist/isBigInt-DdFRCpeE.js.map +1 -0
  84. package/dist/{isBigInt-BVj0M5pq.cjs → isBigInt-LkCpVJ3E.cjs} +2 -2
  85. package/dist/isBigInt-LkCpVJ3E.cjs.map +1 -0
  86. package/dist/{isEmptyString-BYMz_wt9.js → isEmptyString-B6ubItgT.js} +4 -4
  87. package/dist/isEmptyString-B6ubItgT.js.map +1 -0
  88. package/dist/{isEmptyString-C8PYNPgw.cjs → isEmptyString-Csc5Sf_W.cjs} +5 -5
  89. package/dist/isEmptyString-Csc5Sf_W.cjs.map +1 -0
  90. package/dist/isEmptyValue-h97JT4pD.js +36 -0
  91. package/dist/isEmptyValue-h97JT4pD.js.map +1 -0
  92. package/dist/isEmptyValue-qNOhUBFE.cjs +54 -0
  93. package/dist/isEmptyValue-qNOhUBFE.cjs.map +1 -0
  94. package/dist/{isFinite-DeDaBDr2.cjs → isFinite-CKeuVXbD.cjs} +6 -6
  95. package/dist/isFinite-CKeuVXbD.cjs.map +1 -0
  96. package/dist/{isFinite-BEJFOv6B.js → isFinite-CzYYv-mQ.js} +5 -5
  97. package/dist/isFinite-CzYYv-mQ.js.map +1 -0
  98. package/dist/{isInteger-DEDbBGez.js → isInteger-BtA3flbk.js} +4 -4
  99. package/dist/isInteger-BtA3flbk.js.map +1 -0
  100. package/dist/{isInteger-CQLThJOR.cjs → isInteger-iTok9NaH.cjs} +4 -4
  101. package/dist/isInteger-iTok9NaH.cjs.map +1 -0
  102. package/dist/isNumber-C1mOuBuA.js +20 -0
  103. package/dist/isNumber-C1mOuBuA.js.map +1 -0
  104. package/dist/isNumber-CM1vdNcW.cjs +26 -0
  105. package/dist/isNumber-CM1vdNcW.cjs.map +1 -0
  106. package/dist/isPlainObject-DQoM4DGQ.d.ts +331 -0
  107. package/dist/isPlainObject-Y__iykWN.d.cts +331 -0
  108. package/dist/{isServer-DmycqWsF.cjs → isServer-CWlp2R2N.cjs} +2 -2
  109. package/dist/isServer-CWlp2R2N.cjs.map +1 -0
  110. package/dist/{isServer-q3o6cSwD.js → isServer-Drgyboev.js} +2 -2
  111. package/dist/isServer-Drgyboev.js.map +1 -0
  112. package/dist/{isEqual-DM4S_kWh.js → isTypedArray-BY8CIj3k.js} +29 -9
  113. package/dist/isTypedArray-BY8CIj3k.js.map +1 -0
  114. package/dist/{isEqual-DaPDxMyw.cjs → isTypedArray-DspIjxdk.cjs} +45 -13
  115. package/dist/isTypedArray-DspIjxdk.cjs.map +1 -0
  116. package/dist/{isValidDomain-B8Nukgw0.js → isValidDomain-BPfJEkFk.js} +13 -54
  117. package/dist/isValidDomain-BPfJEkFk.js.map +1 -0
  118. package/dist/{isValidDomain-ZbyeGOO9.cjs → isValidDomain-DUUCoKtD.cjs} +16 -69
  119. package/dist/isValidDomain-DUUCoKtD.cjs.map +1 -0
  120. package/dist/{assertIsBoolean-D41HrTB_.cjs → logger-BXg2xufj.cjs} +658 -612
  121. package/dist/logger-BXg2xufj.cjs.map +1 -0
  122. package/dist/{assertIsBoolean-CWUs-I5l.js → logger-Wxl_Krg6.js} +657 -587
  123. package/dist/logger-Wxl_Krg6.js.map +1 -0
  124. package/dist/{noop-BY43WaoU.cjs → noop-ByxeOveJ.cjs} +2 -2
  125. package/dist/noop-ByxeOveJ.cjs.map +1 -0
  126. package/dist/{noop-CjY8xVHv.js → noop-D8aGbjbP.js} +2 -2
  127. package/dist/noop-D8aGbjbP.js.map +1 -0
  128. package/dist/{normalizeSpaces-BhZp0U_6.cjs → normalizeSpaces-CQ7tZLNG.cjs} +6 -9
  129. package/dist/normalizeSpaces-CQ7tZLNG.cjs.map +1 -0
  130. package/dist/{normalizeSpaces-BoUDtq5P.js → normalizeSpaces-DNUOxp_8.js} +4 -7
  131. package/dist/normalizeSpaces-DNUOxp_8.js.map +1 -0
  132. package/dist/operations/index.cjs +152 -22
  133. package/dist/operations/index.cjs.map +1 -1
  134. package/dist/operations/index.d.cts +257 -35
  135. package/dist/operations/index.d.ts +257 -35
  136. package/dist/operations/index.js +142 -13
  137. package/dist/operations/index.js.map +1 -1
  138. package/dist/parsers/index.cjs +2 -2
  139. package/dist/parsers/index.d.cts +238 -180
  140. package/dist/parsers/index.d.ts +238 -180
  141. package/dist/parsers/index.js +2 -2
  142. package/dist/{parsers-B_FPX35n.cjs → parsers-CJ5tHtqF.cjs} +10 -9
  143. package/dist/parsers-CJ5tHtqF.cjs.map +1 -0
  144. package/dist/{parsers-B8KYXIjE.js → parsers-DMlqliPw.js} +9 -8
  145. package/dist/parsers-DMlqliPw.js.map +1 -0
  146. package/dist/{parsing-BCZGco7n.cjs → parsing-DB_S0WFz.cjs} +4 -4
  147. package/dist/parsing-DB_S0WFz.cjs.map +1 -0
  148. package/dist/{parsing-Bfaw85Hd.js → parsing-DhIQhWpX.js} +3 -3
  149. package/dist/parsing-DhIQhWpX.js.map +1 -0
  150. package/dist/predicates/index.cjs +43 -43
  151. package/dist/predicates/index.d.cts +3 -3
  152. package/dist/predicates/index.d.ts +3 -3
  153. package/dist/predicates/index.js +14 -14
  154. package/dist/{predicates-KlyOvBSC.js → predicates-BzYMbNrZ.js} +45 -40
  155. package/dist/predicates-BzYMbNrZ.js.map +1 -0
  156. package/dist/{predicates-8y28VrbT.cjs → predicates-DDW3etqF.cjs} +89 -84
  157. package/dist/predicates-DDW3etqF.cjs.map +1 -0
  158. package/dist/promises/index.cjs +27 -26
  159. package/dist/promises/index.cjs.map +1 -1
  160. package/dist/promises/index.d.cts +227 -75
  161. package/dist/promises/index.d.ts +227 -75
  162. package/dist/promises/index.js +27 -26
  163. package/dist/promises/index.js.map +1 -1
  164. package/dist/{punyCode-DnKi0qjS.cjs → punyCode-B_VPjG0d.cjs} +12 -12
  165. package/dist/punyCode-B_VPjG0d.cjs.map +1 -0
  166. package/dist/{punyCode-Dwto1RpA.js → punyCode-DsuJbWCl.js} +12 -12
  167. package/dist/punyCode-DsuJbWCl.js.map +1 -0
  168. package/dist/{removeSpaces--8NW-HSx.js → removeSpaces-BF-T_1Yt.js} +4 -4
  169. package/dist/removeSpaces-BF-T_1Yt.js.map +1 -0
  170. package/dist/{removeSpaces-CmrrkeXz.cjs → removeSpaces-BJu-gKps.cjs} +7 -7
  171. package/dist/removeSpaces-BJu-gKps.cjs.map +1 -0
  172. package/dist/rzl-utils.global.js +13 -13
  173. package/dist/safeJsonParse-B5F8XtrZ.cjs +209 -0
  174. package/dist/safeJsonParse-B5F8XtrZ.cjs.map +1 -0
  175. package/dist/{safeJsonParse-OnUwG2El.js → safeJsonParse-DYSkUnhM.js} +29 -28
  176. package/dist/safeJsonParse-DYSkUnhM.js.map +1 -0
  177. package/dist/{safeStableStringify-B2KTTS3r.js → safeStableStringify-CDSYnLUz.js} +20 -13
  178. package/dist/safeStableStringify-CDSYnLUz.js.map +1 -0
  179. package/dist/safeStableStringify-MuBiT-4B.cjs +125 -0
  180. package/dist/safeStableStringify-MuBiT-4B.cjs.map +1 -0
  181. package/dist/strings/index.cjs +26 -30
  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 +13 -17
  186. package/dist/strings/index.js.map +1 -1
  187. package/dist/tailwind/index.cjs +3 -3
  188. package/dist/tailwind/index.d.cts +3 -3
  189. package/dist/tailwind/index.d.ts +3 -3
  190. package/dist/tailwind/index.js +3 -3
  191. package/dist/{tailwind-CUdmv-oO.js → tailwind-BhHULklj.js} +38 -32
  192. package/dist/tailwind-BhHULklj.js.map +1 -0
  193. package/dist/{tailwind-DUuboq52.cjs → tailwind-hx6TIFIL.cjs} +59 -53
  194. package/dist/tailwind-hx6TIFIL.cjs.map +1 -0
  195. package/dist/{toStringArrayUnRecursive-OOHGazks.js → toStringArrayUnRecursive-U-nkEIDs.js} +9 -9
  196. package/dist/toStringArrayUnRecursive-U-nkEIDs.js.map +1 -0
  197. package/dist/toStringArrayUnRecursive-_lJEmBlf.cjs +51 -0
  198. package/dist/toStringArrayUnRecursive-_lJEmBlf.cjs.map +1 -0
  199. package/dist/urls/index.cjs +3 -3
  200. package/dist/urls/index.d.cts +635 -443
  201. package/dist/urls/index.d.ts +635 -443
  202. package/dist/urls/index.js +3 -3
  203. package/dist/{urls-BXT4Krsq.js → urls-BcGIFgfR.js} +50 -41
  204. package/dist/urls-BcGIFgfR.js.map +1 -0
  205. package/dist/urls-DGvZsMSN.cjs +308 -0
  206. package/dist/urls-DGvZsMSN.cjs.map +1 -0
  207. package/package.json +6 -6
  208. package/dist/assertIsArray-CeXL4xv5.cjs.map +0 -1
  209. package/dist/assertIsArray-HgzPQIAM.js.map +0 -1
  210. package/dist/assertIsBoolean-CWUs-I5l.js.map +0 -1
  211. package/dist/assertIsBoolean-D41HrTB_.cjs.map +0 -1
  212. package/dist/assertIsString-CY_WkCLr.js.map +0 -1
  213. package/dist/assertIsString-DUrVt82d.cjs.map +0 -1
  214. package/dist/conversions-1s7xMBe_.js.map +0 -1
  215. package/dist/conversions-B3Rf8uId.cjs +0 -446
  216. package/dist/conversions-B3Rf8uId.cjs.map +0 -1
  217. package/dist/formatters-C6cVZBbG.js.map +0 -1
  218. package/dist/formatters-aEAAuzjx.cjs +0 -429
  219. package/dist/formatters-aEAAuzjx.cjs.map +0 -1
  220. package/dist/index-CPCt6_Wq.d.cts +0 -765
  221. package/dist/index-CPCt6_Wq.d.ts +0 -765
  222. package/dist/index-DBwNa1iO.d.ts +0 -947
  223. package/dist/index-DPTYOQkn.d.cts +0 -947
  224. package/dist/index-Dig1fIhZ.d.cts +0 -1716
  225. package/dist/index-Dig1fIhZ.d.ts +0 -1716
  226. package/dist/isBigInt-BVj0M5pq.cjs.map +0 -1
  227. package/dist/isBigInt-y7s3rsKc.js.map +0 -1
  228. package/dist/isEmptyObject-BsHngDz4.cjs +0 -37
  229. package/dist/isEmptyObject-BsHngDz4.cjs.map +0 -1
  230. package/dist/isEmptyObject-DPGR9iPj.js +0 -25
  231. package/dist/isEmptyObject-DPGR9iPj.js.map +0 -1
  232. package/dist/isEmptyString-BYMz_wt9.js.map +0 -1
  233. package/dist/isEmptyString-C8PYNPgw.cjs.map +0 -1
  234. package/dist/isEmptyValue-BXf7f1jz.cjs +0 -30
  235. package/dist/isEmptyValue-BXf7f1jz.cjs.map +0 -1
  236. package/dist/isEmptyValue-D4OHTB3u.js +0 -24
  237. package/dist/isEmptyValue-D4OHTB3u.js.map +0 -1
  238. package/dist/isEqual-DM4S_kWh.js.map +0 -1
  239. package/dist/isEqual-DaPDxMyw.cjs.map +0 -1
  240. package/dist/isFinite-BEJFOv6B.js.map +0 -1
  241. package/dist/isFinite-DeDaBDr2.cjs.map +0 -1
  242. package/dist/isInteger-CQLThJOR.cjs.map +0 -1
  243. package/dist/isInteger-DEDbBGez.js.map +0 -1
  244. package/dist/isPlainObject-BwTkj3G0.d.cts +0 -339
  245. package/dist/isPlainObject-BwTkj3G0.d.ts +0 -339
  246. package/dist/isServer-DmycqWsF.cjs.map +0 -1
  247. package/dist/isServer-q3o6cSwD.js.map +0 -1
  248. package/dist/isTypedArray-BQLbLXsU.cjs +0 -43
  249. package/dist/isTypedArray-BQLbLXsU.cjs.map +0 -1
  250. package/dist/isTypedArray-XiBnifLN.js +0 -31
  251. package/dist/isTypedArray-XiBnifLN.js.map +0 -1
  252. package/dist/isValidDomain-B8Nukgw0.js.map +0 -1
  253. package/dist/isValidDomain-ZbyeGOO9.cjs.map +0 -1
  254. package/dist/noop-BY43WaoU.cjs.map +0 -1
  255. package/dist/noop-CjY8xVHv.js.map +0 -1
  256. package/dist/normalizeSpaces-BhZp0U_6.cjs.map +0 -1
  257. package/dist/normalizeSpaces-BoUDtq5P.js.map +0 -1
  258. package/dist/parsers-B8KYXIjE.js.map +0 -1
  259. package/dist/parsers-B_FPX35n.cjs.map +0 -1
  260. package/dist/parsing-BCZGco7n.cjs.map +0 -1
  261. package/dist/parsing-Bfaw85Hd.js.map +0 -1
  262. package/dist/predicates-8y28VrbT.cjs.map +0 -1
  263. package/dist/predicates-KlyOvBSC.js.map +0 -1
  264. package/dist/punyCode-DnKi0qjS.cjs.map +0 -1
  265. package/dist/punyCode-Dwto1RpA.js.map +0 -1
  266. package/dist/removeSpaces--8NW-HSx.js.map +0 -1
  267. package/dist/removeSpaces-CmrrkeXz.cjs.map +0 -1
  268. package/dist/safeJsonParse-OnUwG2El.js.map +0 -1
  269. package/dist/safeJsonParse-sFqVXf-e.cjs +0 -208
  270. package/dist/safeJsonParse-sFqVXf-e.cjs.map +0 -1
  271. package/dist/safeStableStringify-B2KTTS3r.js.map +0 -1
  272. package/dist/safeStableStringify-Cmi6GyWj.cjs +0 -106
  273. package/dist/safeStableStringify-Cmi6GyWj.cjs.map +0 -1
  274. package/dist/tailwind-CUdmv-oO.js.map +0 -1
  275. package/dist/tailwind-DUuboq52.cjs.map +0 -1
  276. package/dist/toStringArrayUnRecursive-OOHGazks.js.map +0 -1
  277. package/dist/toStringArrayUnRecursive-pfk2oP8C.cjs +0 -51
  278. package/dist/toStringArrayUnRecursive-pfk2oP8C.cjs.map +0 -1
  279. package/dist/urls-BL9C_yU3.cjs +0 -299
  280. package/dist/urls-BL9C_yU3.cjs.map +0 -1
  281. package/dist/urls-BXT4Krsq.js.map +0 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </a>
5
5
  </div>
6
6
 
7
- <h1 align="center"><strong>Utils-JS</strong></h1>
7
+ <h1 align="center"><strong>Utils JS</strong></h1>
8
8
 
9
9
  <p align="center">
10
10
  <i>
@@ -122,8 +122,8 @@ pnpm add @rzl-zone/utils-js@latest
122
122
  >
123
123
  > Migrated entry points:
124
124
  >
125
- > - `@rzl-zone/utils-js/next` `@rzl-zone/next-kit/utils`
126
- > - `@rzl-zone/utils-js/next/server` `@rzl-zone/next-kit/utils/server`
125
+ > - `@rzl-zone/utils-js/next` `@rzl-zone/next-kit/utils`
126
+ > - `@rzl-zone/utils-js/next/server` `@rzl-zone/next-kit/utils/server`
127
127
 
128
128
  ---
129
129
 
@@ -141,6 +141,7 @@ pnpm add @rzl-zone/utils-js@latest
141
141
  ```ts
142
142
  import { /* … */ } from "@rzl-zone/utils-js/assertions";
143
143
  import { /* … */ } from "@rzl-zone/utils-js/conversions";
144
+ import { /* … */ } from "@rzl-zone/utils-js/errors";
144
145
  import { /* … */ } from "@rzl-zone/utils-js/events";
145
146
  import { /* … */ } from "@rzl-zone/utils-js/formatters";
146
147
  import { /* … */ } from "@rzl-zone/utils-js/generators";
@@ -153,7 +154,7 @@ pnpm add @rzl-zone/utils-js@latest
153
154
  import { /* … */ } from "@rzl-zone/utils-js/urls";
154
155
  ```
155
156
 
156
- #### Place your cursor inside `{ }` or right after the package path `@rzl-zone/utils-js/<put-cursor-here>`, then press Ctrl+Space (Windows/Linux) or Cmd+Space (macOS), or use your editor’s autocomplete shortcut, to see all available functions and types with full TSDoc hints.
157
+ #### Place your cursor inside `{ }` or right after the package path `@rzl-zone/utils-js/<put-cursor-here>`, then press Ctrl+Space (Windows/Linux) or Cmd+Space (macOS), or use your editor’s autocomplete shortcut, to see all available functions and types with full TSDoc hints.
157
158
 
158
159
  ---
159
160
 
@@ -179,9 +180,9 @@ pnpm add @rzl-zone/utils-js@latest
179
180
  > - Always include first the `<script/>` tag before your own scripts when using the CDN version.
180
181
  > - Some Node.js-specific utilities may **not** be available, e.g.:
181
182
  > - Category utils of `tailwind`.
182
- > - Server-only features (like Next.js helpers) will **not** be available.
183
+ > - Any `server-only` features will **not** be available.
183
184
  > - The global object provided is `RzlUtilsJs`.
184
- > - The CDN bundle is **~370KB+ minified**, for production, consider using bundlers or npm packages for smaller size and tree-shaking.
185
+ > - The CDN bundle is **~373KB+ minified**, for production, consider using bundlers or npm packages for smaller size and tree-shaking.
185
186
 
186
187
  ---
187
188
 
@@ -2,7 +2,7 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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
  * ========================================================================
@@ -11,6 +11,7 @@
11
11
  //! References Paths:
12
12
  /// <reference path="../assertions/index.d.cts" />
13
13
  /// <reference path="../conversions/index.d.cts" />
14
+ /// <reference path="../errors/index.d.cts" />
14
15
  /// <reference path="../events/index.d.cts" />
15
16
  /// <reference path="../formatters/index.d.cts" />
16
17
  /// <reference path="../generators/index.d.cts" />
@@ -2,7 +2,7 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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
  * ========================================================================
@@ -11,6 +11,7 @@
11
11
  //! References Paths:
12
12
  /// <reference path="../assertions/index.d.ts" />
13
13
  /// <reference path="../conversions/index.d.ts" />
14
+ /// <reference path="../errors/index.d.ts" />
14
15
  /// <reference path="../events/index.d.ts" />
15
16
  /// <reference path="../formatters/index.d.ts" />
16
17
  /// <reference path="../generators/index.d.ts" />
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * ========================================================================
3
+ * @rzl-zone/utils-js
4
+ * ------------------------------------------------------------------------
5
+ * Version: `3.14.0`
6
+ * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
+ * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
+ * ========================================================================
9
+ */
10
+ import { w as isNonEmptyString } from "./logger-Wxl_Krg6.js";
11
+ var AbortError = class extends Error {
12
+ constructor(message = "The operation was aborted", options) {
13
+ super(message);
14
+ const prefix = isNonEmptyString(options?.prefix) ? `${options.prefix.trim()}` : "";
15
+ const suffix = isNonEmptyString(options?.suffix) ? `${options.suffix.trim()}` : "";
16
+ this.name = `${prefix}AbortError${suffix}`;
17
+ }
18
+ };
19
+ export { AbortError as t };
20
+ //# sourceMappingURL=AbortError-CgE6QNOR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbortError-CgE6QNOR.js","names":[],"sources":["../src/errors/AbortError.ts"],"sourcesContent":["import { isNonEmptyString } from \"@/predicates\";\n\ntype AbortErrorOptions = {\n /** -------------------------------------------------------------------\n * * ***Optional text inserted before `\"AbortError\"`.***\n * --------------------------------------------------------------------\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @default \"\"\n */\n prefix?: string;\n\n /** -------------------------------------------------------------------\n * * ***Optional text inserted after `\"AbortError\"`.***\n * --------------------------------------------------------------------\n *\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @default \"\"\n */\n suffix?: string;\n};\n\n/** ---------------------------------------------------------------------\n * * ***Class: `AbortError`.***\n * ----------------------------------------------------------------------\n * **Custom error type used for cancellation-related operations.**\n *\n * ---\n * - **Behavior:**\n * - Extends the native ***`Error`*** class.\n * - Provides a consistent abort error shape across runtimes.\n * - Useful for Promise-based utilities that support\n * cancellation via ***`AbortSignal`***.\n * - Uses `\"AbortError\"` as the base error name.\n * - Supports optional `prefix` and `suffix`\n * for contextual error naming.\n *\n * ---\n *\n * @extends Error - Extending `Error` Class.\n *\n * ---\n * @param {string} [message=\"The operation was aborted\"]\n * The error message describing the abort reason.\n *\n * @param {object} [options]\n * Optional configuration object.\n *\n * @param {string} [options.prefix]\n * Optional text inserted before `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * @param {string} [options.suffix]\n * Optional text inserted after `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @example\n * ```ts\n * throw new AbortError();\n * ```\n *\n * @example\n * ```ts\n * throw new AbortError(\n * \"Delay cancelled\",\n * {\n * prefix: \"Delay\"\n * }\n * );\n *\n * // Result:\n * // name -> \"DelayAbortError\"\n * ```\n *\n * @example\n * ```ts\n * throw new AbortError(\n * \"Queue cancelled\",\n * {\n * suffix: \":Queue\"\n * }\n * );\n *\n * // Result:\n * // name \"AbortError:Queue\"\n * ```\n *\n * @example\n * ```ts\n * try {\n * await delay(\n * 5000,\n * controller.signal\n * );\n * } catch (error) {\n * if (error instanceof AbortError) {\n * console.log(error.message);\n * }\n * }\n * ```\n */\nexport class AbortError extends Error {\n /** ------------------------------------------------------------\n * * ***Constructor: `AbortError`.***\n * -------------------------------------------------------------\n * **Creates a new `AbortError` instance with optional\n * contextual error name customization.**\n *\n * ---\n * - **Behavior:**\n * - Initializes the native ***`Error`*** base class.\n * - Uses `\"AbortError\"` as the default error name.\n * - Automatically trims `prefix` and `suffix` values.\n * - Ignores empty or whitespace-only values.\n * - Generates a contextual error name using:\n * `prefix + \"AbortError\" + suffix`.\n *\n * ---\n * @param {string} [message=\"The operation was aborted\"]\n * The error message describing the abort reason.\n *\n * @param {AbortErrorOptions} [options]\n * Optional configuration object.\n *\n * @param {string} [options.prefix]\n * Optional text inserted before `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * @param {string} [options.suffix]\n * Optional text inserted after `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @example\n * ```ts\n * new AbortError();\n *\n * // Result:\n * // name -> \"AbortError\"\n * // message -> \"The operation was aborted\"\n * ```\n *\n * @example\n * ```ts\n * new AbortError(\n * \"Delay cancelled\",\n * {\n * prefix: \"Delay\"\n * }\n * );\n *\n * // Result:\n * // name -> \"DelayAbortError\"\n * ```\n *\n * @example\n * ```ts\n * new AbortError(\n * \"Queue cancelled\",\n * {\n * suffix: \":Queue\"\n * }\n * );\n *\n * // Result:\n * // name -> \"AbortError:Queue\"\n * ```\n */\n constructor(\n message: string = \"The operation was aborted\",\n options?: AbortErrorOptions\n ) {\n super(message);\n\n const prefix = isNonEmptyString(options?.prefix)\n ? `${options.prefix.trim()}`\n : \"\";\n\n const suffix = isNonEmptyString(options?.suffix)\n ? `${options.suffix.trim()}`\n : \"\";\n\n this.name = `${prefix}AbortError${suffix}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,IAAa,aAAb,cAAgC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEpC,YACE,UAAkB,6BAClB,SACA;EACA,MAAM,OAAO;EAEb,MAAM,SAAS,iBAAiB,SAAS,MAAM,IAC3C,GAAG,QAAQ,OAAO,KAAK,MACvB;EAEJ,MAAM,SAAS,iBAAiB,SAAS,MAAM,IAC3C,GAAG,QAAQ,OAAO,KAAK,MACvB;EAEJ,KAAK,OAAO,GAAG,OAAO,YAAY;CACpC;AACF"}
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * ========================================================================
3
+ * @rzl-zone/utils-js
4
+ * ------------------------------------------------------------------------
5
+ * Version: `3.14.0`
6
+ * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
+ * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
+ * ========================================================================
9
+ */
10
+ "use strict";
11
+ const require_logger = require('./logger-BXg2xufj.cjs');
12
+ var AbortError = class extends Error {
13
+ constructor(message = "The operation was aborted", options) {
14
+ super(message);
15
+ const prefix = require_logger.isNonEmptyString(options?.prefix) ? `${options.prefix.trim()}` : "";
16
+ const suffix = require_logger.isNonEmptyString(options?.suffix) ? `${options.suffix.trim()}` : "";
17
+ this.name = `${prefix}AbortError${suffix}`;
18
+ }
19
+ };
20
+ Object.defineProperty(exports, 'AbortError', {
21
+ enumerable: true,
22
+ get: function () {
23
+ return AbortError;
24
+ }
25
+ });
26
+ //# sourceMappingURL=AbortError-D54txsmn.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbortError-D54txsmn.cjs","names":["isNonEmptyString"],"sources":["../src/errors/AbortError.ts"],"sourcesContent":["import { isNonEmptyString } from \"@/predicates\";\n\ntype AbortErrorOptions = {\n /** -------------------------------------------------------------------\n * * ***Optional text inserted before `\"AbortError\"`.***\n * --------------------------------------------------------------------\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @default \"\"\n */\n prefix?: string;\n\n /** -------------------------------------------------------------------\n * * ***Optional text inserted after `\"AbortError\"`.***\n * --------------------------------------------------------------------\n *\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @default \"\"\n */\n suffix?: string;\n};\n\n/** ---------------------------------------------------------------------\n * * ***Class: `AbortError`.***\n * ----------------------------------------------------------------------\n * **Custom error type used for cancellation-related operations.**\n *\n * ---\n * - **Behavior:**\n * - Extends the native ***`Error`*** class.\n * - Provides a consistent abort error shape across runtimes.\n * - Useful for Promise-based utilities that support\n * cancellation via ***`AbortSignal`***.\n * - Uses `\"AbortError\"` as the base error name.\n * - Supports optional `prefix` and `suffix`\n * for contextual error naming.\n *\n * ---\n *\n * @extends Error - Extending `Error` Class.\n *\n * ---\n * @param {string} [message=\"The operation was aborted\"]\n * The error message describing the abort reason.\n *\n * @param {object} [options]\n * Optional configuration object.\n *\n * @param {string} [options.prefix]\n * Optional text inserted before `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * @param {string} [options.suffix]\n * Optional text inserted after `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @example\n * ```ts\n * throw new AbortError();\n * ```\n *\n * @example\n * ```ts\n * throw new AbortError(\n * \"Delay cancelled\",\n * {\n * prefix: \"Delay\"\n * }\n * );\n *\n * // Result:\n * // name -> \"DelayAbortError\"\n * ```\n *\n * @example\n * ```ts\n * throw new AbortError(\n * \"Queue cancelled\",\n * {\n * suffix: \":Queue\"\n * }\n * );\n *\n * // Result:\n * // name \"AbortError:Queue\"\n * ```\n *\n * @example\n * ```ts\n * try {\n * await delay(\n * 5000,\n * controller.signal\n * );\n * } catch (error) {\n * if (error instanceof AbortError) {\n * console.log(error.message);\n * }\n * }\n * ```\n */\nexport class AbortError extends Error {\n /** ------------------------------------------------------------\n * * ***Constructor: `AbortError`.***\n * -------------------------------------------------------------\n * **Creates a new `AbortError` instance with optional\n * contextual error name customization.**\n *\n * ---\n * - **Behavior:**\n * - Initializes the native ***`Error`*** base class.\n * - Uses `\"AbortError\"` as the default error name.\n * - Automatically trims `prefix` and `suffix` values.\n * - Ignores empty or whitespace-only values.\n * - Generates a contextual error name using:\n * `prefix + \"AbortError\" + suffix`.\n *\n * ---\n * @param {string} [message=\"The operation was aborted\"]\n * The error message describing the abort reason.\n *\n * @param {AbortErrorOptions} [options]\n * Optional configuration object.\n *\n * @param {string} [options.prefix]\n * Optional text inserted before `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * @param {string} [options.suffix]\n * Optional text inserted after `\"AbortError\"`.\n * Empty strings and whitespace-only values are ignored.\n *\n * ---\n * @example\n * ```ts\n * new AbortError();\n *\n * // Result:\n * // name -> \"AbortError\"\n * // message -> \"The operation was aborted\"\n * ```\n *\n * @example\n * ```ts\n * new AbortError(\n * \"Delay cancelled\",\n * {\n * prefix: \"Delay\"\n * }\n * );\n *\n * // Result:\n * // name -> \"DelayAbortError\"\n * ```\n *\n * @example\n * ```ts\n * new AbortError(\n * \"Queue cancelled\",\n * {\n * suffix: \":Queue\"\n * }\n * );\n *\n * // Result:\n * // name -> \"AbortError:Queue\"\n * ```\n */\n constructor(\n message: string = \"The operation was aborted\",\n options?: AbortErrorOptions\n ) {\n super(message);\n\n const prefix = isNonEmptyString(options?.prefix)\n ? `${options.prefix.trim()}`\n : \"\";\n\n const suffix = isNonEmptyString(options?.suffix)\n ? `${options.suffix.trim()}`\n : \"\";\n\n this.name = `${prefix}AbortError${suffix}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,IAAa,aAAb,cAAgC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEpC,YACE,UAAkB,6BAClB,SACA;EACA,MAAM,OAAO;EAEb,MAAM,SAASA,gCAAiB,SAAS,MAAM,IAC3C,GAAG,QAAQ,OAAO,KAAK,MACvB;EAEJ,MAAM,SAASA,gCAAiB,SAAS,MAAM,IAC3C,GAAG,QAAQ,OAAO,KAAK,MACvB;EAEJ,KAAK,OAAO,GAAG,OAAO,YAAY;CACpC;AACF"}
@@ -2,12 +2,12 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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-CWUs-I5l.js";
10
+ import { O as isArray, r as resolveErrorMessageAssertions } from "./logger-Wxl_Krg6.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-HgzPQIAM.js.map
20
+ //# sourceMappingURL=assertIsArray-DmlqnTiq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertIsArray-DmlqnTiq.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 *\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 *\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 *\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 * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n *\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":";;;;;;;;;;;;;AAyJA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAI,QAAQ,KAAK,GAAG;CAEpB,8BAA8B;EAAE;EAAO;EAAS,mBAAmB;CAAQ,CAAC;AAC9E"}
@@ -2,16 +2,16 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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-D41HrTB_.cjs');
11
+ const require_logger = require('./logger-BXg2xufj.cjs');
12
12
  function assertIsArray(value, options) {
13
- if (require_assertIsBoolean.isArray(value)) return;
14
- require_assertIsBoolean.resolveErrorMessageAssertions({
13
+ if (require_logger.isArray(value)) return;
14
+ require_logger.resolveErrorMessageAssertions({
15
15
  value,
16
16
  options,
17
17
  requiredValidType: "array"
@@ -23,4 +23,4 @@ Object.defineProperty(exports, 'assertIsArray', {
23
23
  return assertIsArray;
24
24
  }
25
25
  });
26
- //# sourceMappingURL=assertIsArray-CeXL4xv5.cjs.map
26
+ //# sourceMappingURL=assertIsArray-Xx-zlo6O.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertIsArray-Xx-zlo6O.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 *\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 *\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 *\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 * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n *\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":";;;;;;;;;;;;;AAyJA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAIA,uBAAQ,KAAK,GAAG;CAEpB,6CAA8B;EAAE;EAAO;EAAS,mBAAmB;CAAQ,CAAC;AAC9E"}
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * ========================================================================
3
+ * @rzl-zone/utils-js
4
+ * ------------------------------------------------------------------------
5
+ * Version: `3.14.0`
6
+ * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
+ * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
+ * ========================================================================
9
+ */
10
+ import { E as isPlainObject, r as resolveErrorMessageAssertions } from "./logger-Wxl_Krg6.js";
11
+ function assertIsPlainObject(value, options) {
12
+ if (isPlainObject(value)) return;
13
+ resolveErrorMessageAssertions({
14
+ value,
15
+ options,
16
+ requiredValidType: "plain object"
17
+ });
18
+ }
19
+ export { assertIsPlainObject as t };
20
+ //# sourceMappingURL=assertIsPlainObject-CIzDchLs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertIsPlainObject-CIzDchLs.js","names":[],"sources":["../src/assertions/objects/assertIsPlainObject.ts"],"sourcesContent":["import {\n isPlainObject,\n type IsPlainObjectResult\n} from \"@/predicates/is/isPlainObject\";\nimport {\n type OptionsAssertIs,\n resolveErrorMessageAssertions\n} from \"../_private/assertIs\";\n\n/** --------------------------------------------------------------------------------\n * * ***Type guard assertion: `assertIsPlainObject`.***\n * ---------------------------------------------------------------------------------\n * **This function is an **assertion function**.**\n *\n * - **Behavior:**\n * - Validates that the given `value` is a **plain-object**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `plain-object` **(generic support)**.\n * - If `value` is a `plain-object` ➔ execution continues normally.\n * - If `value` is not a `plain-object` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **A valid `plain object` is:**\n * - Created by the `Object` constructor, or\n * - Has a `[[Prototype]]` of `null` (e.g. `Object.create(null)`).\n * - **Returns `undefined` (valid) for:**\n * - Empty object literals: `{}`\n * - Objects with null prototype: `Object.create(null)`\n * - **Returns `throws` for:**\n * - Arrays (`[]`, `new Array()`)\n * - Functions (regular, arrow, or class constructors)\n * - Built-in objects: `Date`, `RegExp`, `Error`, `Map`, `Set`, `WeakMap`, `WeakSet`\n * - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`\n * - `null` or `undefined`\n * - Symbols\n * - Class instances\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 *\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 *\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 `value` is not a plain-object.\n * @returns {boolean} Narrows `value` to a `plain-object` **(generic support)** if no error is thrown.\n *\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsPlainObject({ a: 1, b: 2 });\n * // No error, value is plain-object\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a plain-object\n * assertIsPlainObject(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `plain-object`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsPlainObject(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `plain-object`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsPlainObject(\"123\", { message: \"Must be a plain-object!\" });\n * // ➔ TypeError: \"Must be a plain-object!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsPlainObject(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected plain-object but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsPlainObject(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (url).\"\n * assertIsPlainObject(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (URL).\"\n *\n * // Case 2:\n * assertIsPlainObject(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (UrlSearchParams).\"\n * assertIsPlainObject(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage with generic narrowing***:\n * ```ts\n * type User = { name: string; email: string };\n * const mixedValue: string | User | boolean | number | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `plain-object`\n * assertIsPlainObject(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be plain object!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `User` here\n * const user: User = mixedValue; // ➔ Safe type assignment\n * console.log(user.email); // ➔ Safe to access object properties\n * ```\n */\nexport function assertIsPlainObject<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is IsPlainObjectResult<T> {\n if (isPlainObject(value)) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"plain object\"\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyIA,SAAgB,oBACd,OACA,SACyC;CACzC,IAAI,cAAc,KAAK,GAAG;CAE1B,8BAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH"}
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * ========================================================================
3
+ * @rzl-zone/utils-js
4
+ * ------------------------------------------------------------------------
5
+ * Version: `3.14.0`
6
+ * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
+ * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
+ * ========================================================================
9
+ */
10
+ "use strict";
11
+ const require_logger = require('./logger-BXg2xufj.cjs');
12
+ function assertIsPlainObject(value, options) {
13
+ if (require_logger.isPlainObject(value)) return;
14
+ require_logger.resolveErrorMessageAssertions({
15
+ value,
16
+ options,
17
+ requiredValidType: "plain object"
18
+ });
19
+ }
20
+ Object.defineProperty(exports, 'assertIsPlainObject', {
21
+ enumerable: true,
22
+ get: function () {
23
+ return assertIsPlainObject;
24
+ }
25
+ });
26
+ //# sourceMappingURL=assertIsPlainObject-DYoxHcW5.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertIsPlainObject-DYoxHcW5.cjs","names":["isPlainObject"],"sources":["../src/assertions/objects/assertIsPlainObject.ts"],"sourcesContent":["import {\n isPlainObject,\n type IsPlainObjectResult\n} from \"@/predicates/is/isPlainObject\";\nimport {\n type OptionsAssertIs,\n resolveErrorMessageAssertions\n} from \"../_private/assertIs\";\n\n/** --------------------------------------------------------------------------------\n * * ***Type guard assertion: `assertIsPlainObject`.***\n * ---------------------------------------------------------------------------------\n * **This function is an **assertion function**.**\n *\n * - **Behavior:**\n * - Validates that the given `value` is a **plain-object**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `plain-object` **(generic support)**.\n * - If `value` is a `plain-object` ➔ execution continues normally.\n * - If `value` is not a `plain-object` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **A valid `plain object` is:**\n * - Created by the `Object` constructor, or\n * - Has a `[[Prototype]]` of `null` (e.g. `Object.create(null)`).\n * - **Returns `undefined` (valid) for:**\n * - Empty object literals: `{}`\n * - Objects with null prototype: `Object.create(null)`\n * - **Returns `throws` for:**\n * - Arrays (`[]`, `new Array()`)\n * - Functions (regular, arrow, or class constructors)\n * - Built-in objects: `Date`, `RegExp`, `Error`, `Map`, `Set`, `WeakMap`, `WeakSet`\n * - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`\n * - `null` or `undefined`\n * - Symbols\n * - Class instances\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 *\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 *\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 `value` is not a plain-object.\n * @returns {boolean} Narrows `value` to a `plain-object` **(generic support)** if no error is thrown.\n *\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsPlainObject({ a: 1, b: 2 });\n * // No error, value is plain-object\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a plain-object\n * assertIsPlainObject(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `plain-object`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsPlainObject(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `plain-object`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsPlainObject(\"123\", { message: \"Must be a plain-object!\" });\n * // ➔ TypeError: \"Must be a plain-object!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsPlainObject(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected plain-object but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsPlainObject(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (url).\"\n * assertIsPlainObject(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (URL).\"\n *\n * // Case 2:\n * assertIsPlainObject(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (UrlSearchParams).\"\n * assertIsPlainObject(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected plain-object but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage with generic narrowing***:\n * ```ts\n * type User = { name: string; email: string };\n * const mixedValue: string | User | boolean | number | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `plain-object`\n * assertIsPlainObject(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be plain object!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `User` here\n * const user: User = mixedValue; // ➔ Safe type assignment\n * console.log(user.email); // ➔ Safe to access object properties\n * ```\n */\nexport function assertIsPlainObject<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is IsPlainObjectResult<T> {\n if (isPlainObject(value)) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"plain object\"\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyIA,SAAgB,oBACd,OACA,SACyC;CACzC,IAAIA,6BAAc,KAAK,GAAG;CAE1B,6CAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH"}
@@ -2,16 +2,16 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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-D41HrTB_.cjs');
12
- const assertIsString = (value, options = {}) => {
13
- if (require_assertIsBoolean.isString(value)) return;
14
- require_assertIsBoolean.resolveErrorMessageAssertions({
11
+ const require_logger = require('./logger-BXg2xufj.cjs');
12
+ const assertIsString = (value, options) => {
13
+ if (require_logger.isString(value)) return;
14
+ require_logger.resolveErrorMessageAssertions({
15
15
  value,
16
16
  options,
17
17
  requiredValidType: "string"
@@ -23,4 +23,4 @@ Object.defineProperty(exports, 'assertIsString', {
23
23
  return assertIsString;
24
24
  }
25
25
  });
26
- //# sourceMappingURL=assertIsString-DUrVt82d.cjs.map
26
+ //# sourceMappingURL=assertIsString-CuPbh3FB.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertIsString-CuPbh3FB.cjs","names":["isString"],"sources":["../src/assertions/strings/assertIsString.ts"],"sourcesContent":["import { isString } from \"@/predicates/is/isString\";\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n/** --------------------------------------------------------------------------------\n * * ***Type guard assertion: `assertIsString`.***\n * ---------------------------------------------------------------------------------\n * **This function is an **assertion function**.**\n *\n * - **Behavior:**\n * - Validates that the given `value` is a **primitive-string**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `primitive-string`.\n * - If `value` is a `primitive-string` ➔ execution continues normally.\n * - If `value` is not a `primitive-string` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **Note:**\n * - A \"string\" refers strictly to a JavaScript `primitive-string` type (e.g., `\"hello\"`, `\"\"`, `\"123\"`).\n * - This function excludes `String` objects created with `new String()`.\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 *\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 *\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 a primitive string.\n * @returns {boolean} Narrows `value` to `string` if no error is thrown.\n *\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsString(\"hello\");\n * // No error, value is string\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a string\n * assertIsString(42);\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `string`, but received: `number`.\"\n *\n * // Case 3: The new String() is a String object (constructor), not a primitive string\n * assertIsString(new String(\"abc\"));\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `string`, but received: `string-constructor`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsString(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `string`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsString(123, { message: \"Must be a string!\" });\n * // ➔ TypeError: \"Must be a string!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsString(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected string but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsString(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (url).\"\n * assertIsString(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (URL).\"\n *\n * // Case 2:\n * assertIsString(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (UrlSearchParams).\"\n * assertIsString(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage with generic narrowing***:\n * ```ts\n * const mixedValue: string | boolean | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `string`\n * assertIsString(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be a string!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `string` here\n * const result: string = mixedValue; // ➔ Safe type assignment\n * console.log(result.toUpperCase()); // ➔ Safe to call String.prototype methods\n * ```\n */\nexport const assertIsString: (\n value: unknown,\n options?: OptionsAssertIs\n) => asserts value is string = (\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is string => {\n if (isString(value)) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"string\"\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,MAAa,kBAIX,OACA,YAC4B;CAC5B,IAAIA,wBAAS,KAAK,GAAG;CAErB,6CAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH"}
@@ -2,13 +2,13 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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 { k as isString, n as resolveErrorMessageAssertions } from "./assertIsBoolean-CWUs-I5l.js";
11
- const assertIsString = (value, options = {}) => {
10
+ import { T as isString, r as resolveErrorMessageAssertions } from "./logger-Wxl_Krg6.js";
11
+ const assertIsString = (value, options) => {
12
12
  if (isString(value)) return;
13
13
  resolveErrorMessageAssertions({
14
14
  value,
@@ -17,4 +17,4 @@ const assertIsString = (value, options = {}) => {
17
17
  });
18
18
  };
19
19
  export { assertIsString as t };
20
- //# sourceMappingURL=assertIsString-CY_WkCLr.js.map
20
+ //# sourceMappingURL=assertIsString-sgY3ml5f.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertIsString-sgY3ml5f.js","names":[],"sources":["../src/assertions/strings/assertIsString.ts"],"sourcesContent":["import { isString } from \"@/predicates/is/isString\";\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n/** --------------------------------------------------------------------------------\n * * ***Type guard assertion: `assertIsString`.***\n * ---------------------------------------------------------------------------------\n * **This function is an **assertion function**.**\n *\n * - **Behavior:**\n * - Validates that the given `value` is a **primitive-string**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `primitive-string`.\n * - If `value` is a `primitive-string` ➔ execution continues normally.\n * - If `value` is not a `primitive-string` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **Note:**\n * - A \"string\" refers strictly to a JavaScript `primitive-string` type (e.g., `\"hello\"`, `\"\"`, `\"123\"`).\n * - This function excludes `String` objects created with `new String()`.\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 *\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 *\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 a primitive string.\n * @returns {boolean} Narrows `value` to `string` if no error is thrown.\n *\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsString(\"hello\");\n * // No error, value is string\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a string\n * assertIsString(42);\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `string`, but received: `number`.\"\n *\n * // Case 3: The new String() is a String object (constructor), not a primitive string\n * assertIsString(new String(\"abc\"));\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `string`, but received: `string-constructor`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsString(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `string`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsString(123, { message: \"Must be a string!\" });\n * // ➔ TypeError: \"Must be a string!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsString(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected string but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsString(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (url).\"\n * assertIsString(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (URL).\"\n *\n * // Case 2:\n * assertIsString(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (UrlSearchParams).\"\n * assertIsString(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected string but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage with generic narrowing***:\n * ```ts\n * const mixedValue: string | boolean | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `string`\n * assertIsString(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be a string!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `string` here\n * const result: string = mixedValue; // ➔ Safe type assignment\n * console.log(result.toUpperCase()); // ➔ Safe to call String.prototype methods\n * ```\n */\nexport const assertIsString: (\n value: unknown,\n options?: OptionsAssertIs\n) => asserts value is string = (\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is string => {\n if (isString(value)) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"string\"\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,MAAa,kBAIX,OACA,YAC4B;CAC5B,IAAI,SAAS,KAAK,GAAG;CAErB,8BAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH"}
@@ -2,28 +2,30 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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
11
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12
- const require_assertIsBoolean = require('../assertIsBoolean-D41HrTB_.cjs');
13
- const require_isBigInt = require('../isBigInt-BVj0M5pq.cjs');
14
- const require_assertIsArray = require('../assertIsArray-CeXL4xv5.cjs');
15
- const require_assertIsString = require('../assertIsString-DUrVt82d.cjs');
16
- const assertIsBigInt = (value, options = {}) => {
12
+ const require_logger = require('../logger-BXg2xufj.cjs');
13
+ const require_isBigInt = require('../isBigInt-LkCpVJ3E.cjs');
14
+ const require_isNumber = require('../isNumber-CM1vdNcW.cjs');
15
+ const require_assertIsArray = require('../assertIsArray-Xx-zlo6O.cjs');
16
+ const require_assertIsPlainObject = require('../assertIsPlainObject-DYoxHcW5.cjs');
17
+ const require_assertIsString = require('../assertIsString-CuPbh3FB.cjs');
18
+ const assertIsBigInt = (value, options) => {
17
19
  if (require_isBigInt.isBigInt(value)) return;
18
- require_assertIsBoolean.resolveErrorMessageAssertions({
20
+ require_logger.resolveErrorMessageAssertions({
19
21
  value,
20
22
  options,
21
23
  requiredValidType: "bigint"
22
24
  });
23
25
  };
24
- const assertIsNumber = (value, options = {}) => {
25
- if (require_assertIsBoolean.isNumber(value, { includeNaN: require_assertIsBoolean.hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0 })) return;
26
- require_assertIsBoolean.resolveErrorMessageAssertions({
26
+ const assertIsNumber = (value, options) => {
27
+ if (require_isNumber.isNumber(value, { includeNaN: options?.includeNaN ?? void 0 })) return;
28
+ require_logger.resolveErrorMessageAssertions({
27
29
  value,
28
30
  options,
29
31
  requiredValidType: "number"
@@ -31,8 +33,8 @@ const assertIsNumber = (value, options = {}) => {
31
33
  };
32
34
  exports.assertIsArray = require_assertIsArray.assertIsArray;
33
35
  exports.assertIsBigInt = assertIsBigInt;
34
- exports.assertIsBoolean = require_assertIsBoolean.assertIsBoolean;
36
+ exports.assertIsBoolean = require_logger.assertIsBoolean;
35
37
  exports.assertIsNumber = assertIsNumber;
36
- exports.assertIsPlainObject = require_assertIsBoolean.assertIsPlainObject;
38
+ exports.assertIsPlainObject = require_assertIsPlainObject.assertIsPlainObject;
37
39
  exports.assertIsString = require_assertIsString.assertIsString;
38
40
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["isBigInt","isNumber","hasOwnProp"],"sources":["../../src/assertions/number/assertIsBigInt.ts","../../src/assertions/number/assertIsNumber.ts"],"sourcesContent":["import { isBigInt } from \"@/predicates/is/isBigInt\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsBigInt`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is a **bigint**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `bigint`.\n * - ✅ If `value` is a `bigint` ➔ execution continues normally.\n * - ❌ If `value` is not a `bigint` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **ℹ️ Note:**\n * - A `bigint` refers strictly to the JavaScript `bigint` primitive type (e.g., `123n`, `0n`, `-999999999999999999999n`).\n * - This excludes `BigInt` objects created with `Object(BigInt(123))`.\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 * @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 `bigint` 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 a bigint.\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsBigInt(123n);\n * // No error, value is bigint\n *\n * // ❌ Throws TypeError (default behavior)\n * assertIsBigInt(42);\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `bigint`, but received: `number`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsBigInt(\"123\", { message: \"Must be a bigint!\" });\n * // ➔ TypeError: \"Must be a bigint!\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsBigInt(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `bigint`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsBigInt(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected bigint but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsBigInt(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (url).\"\n * assertIsBigInt(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (URL).\"\n *\n * // Case 2:\n * assertIsBigInt(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (UrlSearchParams).\"\n * assertIsBigInt(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | bigint | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `bigint`\n * assertIsBigInt(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be bigint!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `bigint` here\n * const result: bigint = mixedValue; // ➔ Safe type assignment\n * console.log(result + 100n); // ➔ Safe to operation\n * ```\n */\nexport const assertIsBigInt: (\n value: unknown,\n options?: OptionsAssertIs\n) => asserts value is bigint = (\n value: unknown,\n options: OptionsAssertIs = {}\n): asserts value is bigint => {\n if (isBigInt(value)) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"bigint\"\n });\n};\n","import { isNumber, type IsNumberOptions } from \"@/predicates/is/isNumber\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\n\ntype OptionsAssertIsNumber = OptionsAssertIs & IsNumberOptions;\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsNumber`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is a **number**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `number`.\n * - ✅ If `value` is a `number` ➔ execution continues normally.\n * - ❌ If `value` is not a `number` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **ℹ️ Note:**\n * - A `number` refers strictly to the JavaScript `number` primitive type (e.g., `42`, `3.14`, `-1`, `0`).\n * - This excludes `Number` objects created with `new Number(123)`.\n * - By default, `NaN` is **not considered** valid, you can allow it with `{ includeNaN: true }`.\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 * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIsNumber} [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 * - `includeNaN`: Whether to treat `NaN` as valid.\n * @returns {boolean} Narrows `value` to `number` 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 a number (or is `NaN` when `includeNaN` is `false`).\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsNumber(123);\n * assertIsNumber(NaN, { includeNaN: true });\n * // No error, value is number\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a number\n * assertIsNumber(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `number`, but received: `string`.\"\n *\n * // Case 2: Default option includeNaN is false\n * assertIsNumber(NaN);\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `number`, but received: `NaN`.\"\n *\n * // Case 3: The new Number() is a Number object (constructor), not a primitive number\n * assertIsNumber(new Number(\"123\"));\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `number`, but received: `number-constructor`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsNumber(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `number`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsNumber(\"123\", { message: \"Must be a number!\" });\n * // ➔ TypeError: \"Must be a number!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsNumber(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected number but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsNumber(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number but got (url).\"\n * assertIsNumber(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number but got (URL).\"\n *\n * // Case 2:\n * assertIsNumber(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number but got (UrlSearchParams).\"\n * assertIsNumber(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number 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 * assertIsNumber(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be number!\"\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 + 100); // ➔ Safe to operation\n * ```\n */\nexport const assertIsNumber: (\n value: unknown,\n options?: OptionsAssertIsNumber\n) => asserts value is number = (\n value: unknown,\n options: OptionsAssertIsNumber = {}\n): asserts value is number => {\n const includeNaN = hasOwnProp(options, \"includeNaN\")\n ? options.includeNaN\n : undefined;\n\n if (isNumber(value, { includeNaN })) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"number\"\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA,MAAa,kBAIX,OACA,UAA2B,CAAC,MACA;CAC5B,IAAIA,0BAAS,KAAK,GAAG;CAErB,sDAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACCA,MAAa,kBAIX,OACA,UAAiC,CAAC,MACN;CAK5B,IAAIC,iCAAS,OAAO,EAAE,YAJHC,mCAAW,SAAS,YAAY,IAC/C,QAAQ,aACR,OAE6B,CAAC,GAAG;CAErC,sDAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH"}
1
+ {"version":3,"file":"index.cjs","names":["isBigInt","isNumber"],"sources":["../../src/assertions/number/assertIsBigInt.ts","../../src/assertions/number/assertIsNumber.ts"],"sourcesContent":["import { isBigInt } from \"@/predicates/is/isBigInt\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n/** --------------------------------------------------------------------------------\n * * ***Type guard assertion: `assertIsBigInt`.***\n * ---------------------------------------------------------------------------------\n * **This function is an **assertion function**.**\n *\n * - **Behavior:**\n * - Validates that the given `value` is a **bigint**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `bigint`.\n * - If `value` is a `bigint` ➔ execution continues normally.\n * - If `value` is not a `bigint` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **Note:**\n * - A `bigint` refers strictly to the JavaScript `bigint` primitive type (e.g., `123n`, `0n`, `-999999999999999999999n`).\n * - This excludes `BigInt` objects created with `Object(BigInt(123))`.\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 *\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 *\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 a bigint.\n * @returns {boolean} Narrows `value` to `bigint` if no error is thrown.\n *\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsBigInt(123n);\n * // No error, value is bigint\n *\n * // ❌ Throws TypeError (default behavior)\n * assertIsBigInt(42);\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `bigint`, but received: `number`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsBigInt(\"123\", { message: \"Must be a bigint!\" });\n * // ➔ TypeError: \"Must be a bigint!\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsBigInt(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `bigint`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsBigInt(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected bigint but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsBigInt(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (url).\"\n * assertIsBigInt(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (URL).\"\n *\n * // Case 2:\n * assertIsBigInt(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (UrlSearchParams).\"\n * assertIsBigInt(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected bigint but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | bigint | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `bigint`\n * assertIsBigInt(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be bigint!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `bigint` here\n * const result: bigint = mixedValue; // ➔ Safe type assignment\n * console.log(result + 100n); // ➔ Safe to operation\n * ```\n */\nexport const assertIsBigInt: (\n value: unknown,\n options?: OptionsAssertIs\n) => asserts value is bigint = (\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is bigint => {\n if (isBigInt(value)) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"bigint\"\n });\n};\n","import { isNumber, type IsNumberOptions } from \"@/predicates/is/isNumber\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\ntype OptionsAssertIsNumber = OptionsAssertIs & IsNumberOptions;\n\n/** --------------------------------------------------------------------------------\n * * ***Type guard assertion: `assertIsNumber`.***\n * ---------------------------------------------------------------------------------\n * **This function is an **assertion function**.**\n *\n * - **Behavior:**\n * - Validates that the given `value` is a **number**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `number`.\n * - If `value` is a `number` ➔ execution continues normally.\n * - If `value` is not a `number` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **Note:**\n * - A `number` refers strictly to the JavaScript `number` primitive type (e.g., `42`, `3.14`, `-1`, `0`).\n * - This excludes `Number` objects created with `new Number(123)`.\n * - By default, `NaN` is **not considered** valid, you can allow it with `{ includeNaN: true }`.\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 *\n * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIsNumber} [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 * - `includeNaN`: Whether to treat `NaN` as valid.\n *\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 a number (or is `NaN` when `includeNaN` is `false`).\n * @returns {boolean} Narrows `value` to `number` if no error is thrown.\n *\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsNumber(123);\n * assertIsNumber(NaN, { includeNaN: true });\n * // No error, value is number\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a number\n * assertIsNumber(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `number`, but received: `string`.\"\n *\n * // Case 2: Default option includeNaN is false\n * assertIsNumber(NaN);\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `number`, but received: `NaN`.\"\n *\n * // Case 3: The new Number() is a Number object (constructor), not a primitive number\n * assertIsNumber(new Number(\"123\"));\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `number`, but received: `number-constructor`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsNumber(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `number`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsNumber(\"123\", { message: \"Must be a number!\" });\n * // ➔ TypeError: \"Must be a number!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsNumber(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected number but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsNumber(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number but got (url).\"\n * assertIsNumber(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number but got (URL).\"\n *\n * // Case 2:\n * assertIsNumber(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number but got (UrlSearchParams).\"\n * assertIsNumber(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected number 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 * assertIsNumber(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be number!\"\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 + 100); // ➔ Safe to operation\n * ```\n */\nexport const assertIsNumber: (\n value: unknown,\n options?: OptionsAssertIsNumber\n) => asserts value is number = (\n value: unknown,\n options?: OptionsAssertIsNumber\n): asserts value is number => {\n const includeNaN = options?.includeNaN ?? undefined;\n\n if (isNumber(value, { includeNaN })) return;\n\n resolveErrorMessageAssertions({\n value,\n options,\n requiredValidType: \"number\"\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHA,MAAa,kBAIX,OACA,YAC4B;CAC5B,IAAIA,0BAAS,KAAK,GAAG;CAErB,6CAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,MAAa,kBAIX,OACA,YAC4B;CAG5B,IAAIC,0BAAS,OAAO,EAAE,YAFH,SAAS,cAAc,OAET,CAAC,GAAG;CAErC,6CAA8B;EAC5B;EACA;EACA,mBAAmB;CACrB,CAAC;AACH"}
@@ -2,11 +2,11 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1`
5
+ * Version: `3.14.0`
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
 
11
- import { a as assertIsBigInt, i as assertIsNumber, n as assertIsPlainObject, o as assertIsBoolean, r as assertIsArray, t as assertIsString } from "../index-BG8wdusZ.cjs";
11
+ import { a as assertIsBigInt, i as assertIsNumber, n as assertIsPlainObject, o as assertIsBoolean, r as assertIsArray, t as assertIsString } from "../index-9Ql1W3gt.cjs";
12
12
  export { assertIsArray, assertIsBigInt, assertIsBoolean, assertIsNumber, assertIsPlainObject, assertIsString };