@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
@@ -2,28 +2,222 @@
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 { NumberRangeUnion } from "@rzl-zone/ts-types-plus";
11
+ import { D as NumberRangeUnion } from "../index-or0oP9i2.cjs";
12
+ type CopyMethod = "clipboard" | "fallback" | "manual";
13
+ type CopyStatus = "success" | "error";
14
+ type CopyResult = {
15
+ /** ---------------------------------------------------------
16
+ * * ***Final operation status.***
17
+ * ----------------------------------------------------------
18
+ *
19
+ * ---
20
+ * Usually `"success"` when copy succeeds, otherwise `"error"`.
21
+ */
22
+ status: CopyStatus;
23
+ /** ---------------------------------------------------------
24
+ * * ***Indicates whether the operation succeeded.***
25
+ * ----------------------------------------------------------
26
+ *
27
+ * Usually `true` on successful copy operations.
28
+ */
29
+ success: boolean;
30
+ /** ---------------------------------------------------------
31
+ * * ***Copy mechanism that was used.***
32
+ * ----------------------------------------------------------
33
+ *
34
+ * - **Possible values:**
35
+ * - `"clipboard"`.
36
+ * - `"fallback"`.
37
+ * - `"manual"`.
38
+ */
39
+ method: CopyMethod;
40
+ /**
41
+ * * ***Optional error object captured during execution.***
42
+ */
43
+ error?: unknown;
44
+ /** ---------------------------------------------------------
45
+ * * ***Optional failure or fallback reason.***
46
+ * ----------------------------------------------------------
47
+ *
48
+ * - **Possible values:**
49
+ * - `"no-browser"`.
50
+ * - `"no-clipboard"`.
51
+ * - `"clipboard-error"`.
52
+ * - `"timeout"`.
53
+ * - `"fallback-failed"`.
54
+ */
55
+ reason?: "no-browser" | "no-clipboard" | "clipboard-error" | "timeout" | "fallback-failed";
56
+ /**
57
+ * * ***Total number of attempts performed.***
58
+ */
59
+ attempts: number;
60
+ /**
61
+ * * ***Total execution duration in milliseconds.***
62
+ */
63
+ duration: number;
64
+ /**
65
+ * * ***Unix timestamp of execution completion.***
66
+ */
67
+ timestamp: number;
68
+ };
69
+ /** ----------------------------------------------------------------------
70
+ * * ***Type: `CopyOptions`.***
71
+ * -----------------------------------------------------------------------
72
+ * **Configuration options for the `copyText` utility.**
73
+ *
74
+ * ---
75
+ * - **Behavior:**
76
+ * - Controls retry attempts and timeout handling.
77
+ * - Enables optional debug logging.
78
+ * - All properties are optional.
79
+ */
80
+ type CopyOptions = {
81
+ /** -----------------------------------------------------------------------
82
+ * * ***Enables internal debug logging.***
83
+ * ------------------------------------------------------------------------
84
+ *
85
+ * @default false
86
+ */
87
+ debug?: boolean;
88
+ /** -----------------------------------------------------------------------
89
+ * * ***Number of retry attempts before fallback.***
90
+ * ------------------------------------------------------------------------
91
+ *
92
+ * @default 1
93
+ */
94
+ retries?: number;
95
+ /** -----------------------------------------------------------------------
96
+ * * ***Timeout duration (in milliseconds) for each Clipboard API attempt.***
97
+ * ------------------------------------------------------------------------
98
+ *
99
+ * @default 2000
100
+ */
101
+ timeout?: number;
102
+ };
103
+ /** ----------------------------------------------------------------------
104
+ * * ***Utility: `copyText`.***
105
+ * -----------------------------------------------------------------------
106
+ * **Copies text to the user's clipboard with robust fallback handling.**
107
+ *
108
+ * ---
109
+ * - **Behavior:**
110
+ * - Attempts to use the modern
111
+ * ***`navigator.clipboard.writeText`*** Clipboard API.
112
+ * - Automatically retries clipboard operations when configured.
113
+ * - Falls back to legacy
114
+ * ***`document.execCommand("copy")`***
115
+ * if the Clipboard API is unavailable or fails.
116
+ * - As a last resort, programmatically selects the text
117
+ * to allow manual copying by the user.
118
+ * - Detects non-browser environments and safely exits
119
+ * without accessing browser-only APIs.
120
+ * - Returns detailed operation metadata including method,
121
+ * duration, attempts, and failure reason.
122
+ * - Does **not throw** on copy failure;
123
+ * instead returns a structured
124
+ * ***{@link CopyResult | `CopyResult`}*** object.
125
+ *
126
+ * ---
127
+ * @param {string} text
128
+ * The text content to copy to the clipboard.
129
+ *
130
+ * @param {CopyOptions} [options={}]
131
+ * Optional configuration object.
132
+ *
133
+ * @param {boolean} [options.debug=false]
134
+ * Enables internal debug logging.
135
+ *
136
+ * @param {number} [options.retries=1]
137
+ * Number of additional retry attempts
138
+ * after the initial Clipboard API attempt.
139
+ *
140
+ * @param {number} [options.timeout=2000]
141
+ * Timeout duration (in milliseconds)
142
+ * for each Clipboard API attempt.
143
+ *
144
+ * ---
145
+ * @returns {Promise<CopyResult>}
146
+ * A promise resolving to a
147
+ * ***{@link CopyResult | `CopyResult`}*** object containing:
148
+ * - `status` ➔ `"success"` or `"error"`.
149
+ * - `success` ➔ Indicates whether the operation succeeded.
150
+ * - `method` ➔ Copy mechanism used
151
+ * (`"clipboard"`, `"fallback"`, or `"manual"`).
152
+ * - `reason` ➔ Optional failure or fallback reason.
153
+ * - `error` ➔ Optional thrown error object.
154
+ * - `attempts` ➔ Total number of attempts performed.
155
+ * - `duration` ➔ Execution duration in milliseconds.
156
+ * - `timestamp` ➔ Unix timestamp of execution.
157
+ *
158
+ * ---
159
+ * @remarks
160
+ * - The Clipboard API requires a secure context
161
+ * (`HTTPS` or `localhost`).
162
+ * - Some browsers or mobile environments may restrict
163
+ * clipboard access without direct user interaction.
164
+ * - Clipboard operations may fail due to browser permission
165
+ * policies or missing user interaction.
166
+ * - Manual selection mode is only triggered when all
167
+ * programmatic copy strategies fail.
168
+ * - In server-side environments,
169
+ * the utility returns `"no-browser"`
170
+ * without attempting DOM access.
171
+ *
172
+ * ---
173
+ * @example
174
+ * ```ts
175
+ * const result = await copyText("Hello world");
176
+ *
177
+ * if (result.success) {
178
+ * console.log(`Copied using ${result.method}`);
179
+ * } else {
180
+ * console.error(result.reason);
181
+ * }
182
+ * ```
183
+ *
184
+ * ---
185
+ * @example
186
+ * ```ts
187
+ * await copyText("Debug mode", {
188
+ * debug: true,
189
+ * retries: 2
190
+ * });
191
+ * ```
192
+ */
193
+ declare function copyText(text: string, options?: CopyOptions): Promise<CopyResult>;
12
194
  /** ----------------------------------------------------------------------
13
195
  * * ***Utility: `findDuplicates`.***
14
- * ----------------------------------------------------------------------
196
+ * -----------------------------------------------------------------------
15
197
  * **Finds duplicate values in an array by deep equality comparison.**
198
+ *
199
+ * ---
16
200
  * - **Behavior:**
17
- * - Uses ***`isEqual` utility function*** to compare elements
18
- * (handles objects, arrays, dates, NaN, etc.).
19
- * - Returns a new array containing only the *first occurrences* of duplicated values.
20
- * - Does **not mutate** the original array.
21
- * - Throws ***{@link TypeError | `TypeError`}*** if input is not an array.
201
+ * - Uses ***`isEqual` utility function*** to compare elements
202
+ * (handles objects, arrays, dates, NaN, etc.).
203
+ * - Returns a new array containing only the *first occurrences* of duplicated values.
204
+ * - Does **not mutate** the original array.
205
+ * - Throws ***{@link TypeError | `TypeError`}*** if input is not an array.
206
+ *
207
+ * ---
22
208
  * @template T Type of elements in the input array.
209
+ *
210
+ * ---
23
211
  * @param {T[]} values - The array to check for duplicates.
212
+ *
213
+ * ---
214
+ * @throws **{@link TypeError | `TypeError`}** if the provided `values` argument is not an array.
215
+ *
216
+ * ---
24
217
  * @returns {T[]} An array of the duplicate values found in the input,
25
218
  * preserving order of their first duplicate appearance.
26
- * @throws **{@link TypeError | `TypeError`}** if the provided `values` argument is not an array.
219
+ *
220
+ * ---
27
221
  * @example
28
222
  * findDuplicates([1, 2, 2, 3, 4, 4]);
29
223
  * // ➔ [2, 4]
@@ -39,62 +233,90 @@ import { NumberRangeUnion } from "@rzl-zone/ts-types-plus";
39
233
  * // ➔ []
40
234
  */
41
235
  declare const findDuplicates: <T>(values: T[]) => T[];
42
- /** --------------------------------
236
+ /** -------------------------------------------------------------------------------
43
237
  * * ***Utility: `omitKeys`.***
44
- * --------------------------------
238
+ * --------------------------------------------------------------------------------
45
239
  * **This function creates a shallow copy of the given object omitting the
46
240
  * specified keys.**
241
+ *
242
+ * ---
47
243
  * - **Behavior:**
48
- * - It will return a new object without mutating the original.
49
- * - It also validates that ***`keysToOmit`*** does not contain duplicate keys.
50
- * - **ℹ️ Internally:**
51
- * - It uses ***`isEqual`*** to check for duplicates in
52
- * the ***`keysToOmit`*** array.
244
+ * - It will return a new object without mutating the original.
245
+ * - It also validates that ***`keysToOmit`*** does not contain duplicate keys.
246
+ *
247
+ * ---
248
+ * - **Internally:**
249
+ * - It uses ***`isEqual`*** to check for duplicates in
250
+ * the ***`keysToOmit`*** array.
251
+ *
252
+ * ---
53
253
  * @template I The type of the input object.
54
254
  * @template K The keys to omit from the object.
255
+ *
256
+ * ---
55
257
  * @param {I} object - The source object to omit keys from.
56
258
  * @param {K[]} keysToOmit - An array of keys to exclude from the returned object.
57
- * @returns {Omit<I, K>} A new object without the specified keys.
259
+ *
260
+ * ---
58
261
  * @throws **{@link TypeError | `TypeError`}** if `keysToOmit` is not an array.
59
262
  * @throws **{@link Error | `Error`}** if duplicate keys are found in `keysToOmit`.
263
+ *
264
+ * ---
265
+ * @returns {Omit<I, K>} A new object without the specified keys.
266
+ *
267
+ * ---
60
268
  * @example
61
269
  * omitKeys({ a: 1, b: 2, c: 3 }, ["b", "c"]);
62
- * //➔ { a: 1 }
270
+ * // { a: 1 }
63
271
  * omitKeys({ name: "John", age: 30 }, ["age"]);
64
- * //➔ { name: "John" }
272
+ * // { name: "John" }
65
273
  * omitKeys({ a: 1, b: 2 }, []);
66
- * //➔ { a: 1, b: 2 } (no changes)
274
+ * // { a: 1, b: 2 } (no changes)
67
275
  */
68
276
  declare const omitKeys: <I extends Record<string, unknown>, K extends keyof I>(object: I, keysToOmit: K[]) => Omit<I, K>;
69
277
  type IndexArray = NumberRangeUnion<0, 30>;
70
278
  type DotPath<T, Prev extends string = ""> = T extends Array<infer U> ? DotPath<U, `${Prev}${Prev extends "" ? "" : "."}${IndexArray}`> : T extends object ? { [K in keyof T & string]: `${Prev}${Prev extends "" ? "" : "."}${K}` | DotPath<T[K], `${Prev}${Prev extends "" ? "" : "."}${K}`> }[keyof T & string] : never;
71
279
  /** ------------------------------------------------------
72
280
  * * ***Utility: `omitKeysDeep`.***
73
- * ------------------------------------------------------
281
+ * -------------------------------------------------------
74
282
  * **Recursively omits properties from an object using dot notation paths.**
283
+ *
284
+ * ---
75
285
  * - **Behavior:**
76
- * - Removes resulting empty objects (`{}`) and arrays (`[]`), cascading upwards
77
- * to remove empty parents until root if needed.
78
- * - **⚠️ Be careful:**
79
- * - If after omission an object or array becomes empty, it will be removed entirely
80
- * including all the way up to the root if necessary, resulting in `{}`.
81
- * - **ℹ️ Note:**
82
- * - For array indices, TypeScript autocomplete only suggests `0`–`30`
83
- * (to prevent editor lag on large unions).
84
- * However, higher indices are still fully supported at runtime — you can
85
- * manually type `"arr.99.key"` and it will work the same.
86
- * @template I - Type of the input object
286
+ * - Removes resulting empty objects (`{}`) and arrays (`[]`), cascading upwards
287
+ * to remove empty parents until root if needed.
288
+ * ---
289
+ * - **Be careful:**
290
+ * - If after omission an object or array becomes empty, it will be removed entirely
291
+ * including all the way up to the root if necessary, resulting in `{}`.
292
+ * ---
293
+ * - **Note:**
294
+ * - For array indices, TypeScript autocomplete only suggests `0`–`30`
295
+ * (to prevent editor lag on large unions).
296
+ * However, higher indices are still fully supported at runtime — you can
297
+ * manually type `"arr.99.key"` and it will work the same.
298
+ *
299
+ * ---
300
+ * @template I - Type of the input object.
301
+ *
302
+ * ---
87
303
  * @param {I} object
88
304
  * The object to process, should be a plain nested object or array structure.
89
305
  * @param {DotPath<I>[]} keysToOmit
90
306
  * An array of string paths in dot notation indicating the properties to remove, paths
91
307
  * can include numeric indices to target array elements, e.g. `"arr.0.x"` to
92
308
  * remove `x` from the first object inside the `arr` array.
309
+ *
310
+ * ---
311
+ * @throws **{@link TypeError | `TypeError`}** if `keysToOmit` is not an array.
312
+ * @throws **{@link Error | `Error`}** if `keysToOmit` contains duplicate paths.
313
+ *
314
+ * ---
93
315
  * @returns {Partial<I>}
94
316
  * A new deeply cloned object with the specified keys omitted, with resulting
95
317
  * empty objects or arrays fully removed (even if it collapses to `{}`).
96
- * @throws **{@link TypeError | `TypeError`}** if `keysToOmit` is not an array.
97
- * @throws **{@link Error | `Error`}** if `keysToOmit` contains duplicate paths.
318
+ *
319
+ * ---
98
320
  * @example
99
321
  * omitKeysDeep({ arr: [{ a: 1 }] }, ["arr.0.a"]);
100
322
  * // ➔ {} (array becomes empty and removed)
@@ -136,4 +358,4 @@ type DotPath<T, Prev extends string = ""> = T extends Array<infer U> ? DotPath<U
136
358
  * // ➔ { mixed: { a: [1, 2, 3] } }
137
359
  */
138
360
  declare const omitKeysDeep: <I extends Record<string, unknown>>(object: I, keysToOmit: DotPath<I>[]) => Partial<I>;
139
- export { findDuplicates, omitKeys, omitKeysDeep };
361
+ export { copyText, findDuplicates, omitKeys, omitKeysDeep };