@rzl-zone/utils-js 3.2.6-beta.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +82 -51
  2. package/dist/NumberRangeUnion-B6bhM2s7.d.ts +33 -0
  3. package/dist/{any-BmdI8UbK.d.ts → any-v4TsK9ES.d.ts} +25 -26
  4. package/dist/{arrays-normalize-recursive-CnjYJ9xg.d.ts → arrays-normalize-recursive-BqmVuFlD.d.ts} +20 -20
  5. package/dist/assertions/index.cjs +1 -1
  6. package/dist/assertions/index.d.ts +96 -70
  7. package/dist/assertions/index.js +1 -1
  8. package/dist/chunk-2CQX5CBG.js +1 -0
  9. package/dist/chunk-2IOOEY45.cjs +1 -0
  10. package/dist/chunk-3IBQ5MOM.js +1 -0
  11. package/dist/{chunk-OGPPP2S3.js → chunk-3VA554KW.js} +1 -1
  12. package/dist/{chunk-FV7SEBKD.cjs → chunk-5757UBXJ.cjs} +1 -1
  13. package/dist/{chunk-MTUBDVJ2.js → chunk-5IGC6PBH.js} +1 -1
  14. package/dist/{chunk-O7UT5AN3.cjs → chunk-5KJFVIQT.cjs} +1 -1
  15. package/dist/chunk-6JFCSH7J.js +1 -0
  16. package/dist/{chunk-VHAPTHEA.cjs → chunk-6JFZL7YE.cjs} +1 -1
  17. package/dist/chunk-7ODAAXX5.cjs +1 -0
  18. package/dist/{chunk-6C3ATUGM.cjs → chunk-CAH33WOQ.cjs} +1 -1
  19. package/dist/{chunk-ECRNH4FW.js → chunk-CKTLUNWX.js} +1 -1
  20. package/dist/chunk-CMW2TBOQ.js +1 -0
  21. package/dist/chunk-D3ENH7H6.cjs +1 -0
  22. package/dist/{chunk-3YCFMGRB.js → chunk-DEZZUYE2.js} +1 -1
  23. package/dist/chunk-DWF2R5GD.cjs +1 -0
  24. package/dist/chunk-E55EQK2U.cjs +1 -0
  25. package/dist/chunk-E74U6CYP.cjs +1 -0
  26. package/dist/{chunk-XC3QHAK2.cjs → chunk-EL6A35UR.cjs} +1 -1
  27. package/dist/chunk-F6IPNNSJ.cjs +1 -0
  28. package/dist/chunk-FJZGG54N.cjs +1 -0
  29. package/dist/chunk-FWCKOJZM.js +1 -0
  30. package/dist/{chunk-IMCLPT5V.cjs → chunk-FWHNWL2P.cjs} +1 -1
  31. package/dist/chunk-GGEADHZO.js +1 -0
  32. package/dist/{chunk-IRGE5W7L.js → chunk-GQR4R5WY.js} +1 -1
  33. package/dist/chunk-H66AC7GK.cjs +1 -0
  34. package/dist/{chunk-M47QIBXI.cjs → chunk-HQWOFR56.cjs} +1 -1
  35. package/dist/{chunk-VCFXNV3Q.cjs → chunk-HYRQMTRH.cjs} +1 -1
  36. package/dist/{chunk-EUANTHVN.js → chunk-IRFL4MAX.js} +1 -1
  37. package/dist/{chunk-GGWPB23G.cjs → chunk-IVL7CKVH.cjs} +1 -1
  38. package/dist/chunk-IZPBKKPO.js +1 -0
  39. package/dist/chunk-JBQMXC5I.cjs +1 -0
  40. package/dist/chunk-JEQEF5WD.js +1 -0
  41. package/dist/chunk-JMJQCN74.js +1 -0
  42. package/dist/chunk-JYQTCICM.js +1 -0
  43. package/dist/chunk-KVAL5PAG.cjs +1 -0
  44. package/dist/chunk-LS6U7FAY.cjs +1 -0
  45. package/dist/chunk-NBZWMBO6.js +1 -0
  46. package/dist/chunk-NRF6LWBC.cjs +1 -0
  47. package/dist/chunk-OI5XKNZO.js +1 -0
  48. package/dist/chunk-OYTYSY7G.js +1 -0
  49. package/dist/chunk-PET42Z7W.js +1 -0
  50. package/dist/chunk-PZQ6I4JJ.cjs +1 -0
  51. package/dist/chunk-QBKAEVYG.js +1 -0
  52. package/dist/{chunk-YV3K2EKJ.js → chunk-RIPKY4RU.js} +1 -1
  53. package/dist/chunk-RZW35UN5.cjs +1 -0
  54. package/dist/chunk-SBFNXGTJ.js +1 -0
  55. package/dist/{chunk-T4CIAKEK.js → chunk-SBKGWRS5.js} +1 -1
  56. package/dist/{chunk-5Z2G23WP.js → chunk-SIM77PU4.js} +1 -1
  57. package/dist/chunk-T2T7K3KR.js +1 -0
  58. package/dist/chunk-T7PU2V7X.cjs +1 -0
  59. package/dist/chunk-V45XJKHW.cjs +1 -0
  60. package/dist/chunk-W2WNBUDE.js +1 -0
  61. package/dist/chunk-XABCB3Y7.cjs +1 -0
  62. package/dist/chunk-XEDXFSGI.js +1 -0
  63. package/dist/chunk-YKPSRP5G.js +1 -0
  64. package/dist/chunk-YLA3DURS.cjs +1 -0
  65. package/dist/chunk-ZETAZZLD.cjs +1 -0
  66. package/dist/conversions/index.cjs +1 -1
  67. package/dist/conversions/index.d.ts +515 -321
  68. package/dist/conversions/index.js +1 -1
  69. package/dist/events/index.cjs +1 -1
  70. package/dist/events/index.d.ts +25 -20
  71. package/dist/events/index.js +1 -1
  72. package/dist/{extends-Bk_SBGdT.d.ts → extends-DtdRjDyU.d.ts} +63 -87
  73. package/dist/{formatting → formatters}/index.cjs +1 -1
  74. package/dist/formatters/index.d.ts +2106 -0
  75. package/dist/formatters/index.js +1 -0
  76. package/dist/generators/index.cjs +1 -0
  77. package/dist/{generator → generators}/index.d.ts +57 -59
  78. package/dist/generators/index.js +1 -0
  79. package/dist/{if-CvT4R7Kh.d.ts → if-ChM35c_q.d.ts} +6 -5
  80. package/dist/index.d.ts +14 -0
  81. package/dist/{is-array--YjXV-Wx.d.ts → is-array-BJeHxPM3.d.ts} +287 -542
  82. package/dist/{isPlainObject-BVhBAPHX.d.ts → isPlainObject-DGJkcFYw.d.ts} +6 -6
  83. package/dist/{never-BfayMBF9.d.ts → never-D89PbPh5.d.ts} +10 -19
  84. package/dist/next/index.cjs +1 -1
  85. package/dist/next/index.d.ts +15 -12
  86. package/dist/next/index.js +1 -1
  87. package/dist/next/server/index.cjs +1 -1
  88. package/dist/next/server/index.d.ts +1 -1
  89. package/dist/next/server/index.js +1 -1
  90. package/dist/{nils-DMz3kU7M.d.ts → nils-CO8zLHSB.d.ts} +39 -65
  91. package/dist/operations/index.cjs +1 -1
  92. package/dist/operations/index.d.ts +4 -4
  93. package/dist/operations/index.js +1 -1
  94. package/dist/or-C6qzKt2I.d.ts +82 -0
  95. package/dist/override-CL2olHE5.d.ts +59 -0
  96. package/dist/parsers/index.cjs +1 -1
  97. package/dist/parsers/index.js +1 -1
  98. package/dist/pick-BSMX6Xe2.d.ts +15 -0
  99. package/dist/predicates/index.cjs +1 -1
  100. package/dist/predicates/index.d.ts +425 -106
  101. package/dist/predicates/index.js +1 -1
  102. package/dist/prettify-3o8_Kw6b.d.ts +564 -0
  103. package/dist/promises/index.cjs +1 -0
  104. package/dist/promises/index.d.ts +107 -0
  105. package/dist/promises/index.js +1 -0
  106. package/dist/promises-LU7K00H0.d.ts +72 -0
  107. package/dist/rzl-utils.global.js +1 -1
  108. package/dist/{string-XA-til3C.d.ts → string-B1jlOnws.d.ts} +82 -121
  109. package/dist/strings/index.cjs +1 -1
  110. package/dist/strings/index.d.ts +209 -210
  111. package/dist/strings/index.js +1 -1
  112. package/dist/tailwind/index.cjs +1 -1
  113. package/dist/tailwind/index.d.ts +23 -17
  114. package/dist/tailwind/index.js +1 -1
  115. package/dist/types/index.d.ts +899 -1181
  116. package/dist/urls/index.cjs +1 -1
  117. package/dist/urls/index.d.ts +113 -108
  118. package/dist/urls/index.js +1 -1
  119. package/package.json +33 -40
  120. package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +0 -26
  121. package/dist/chunk-2HSNUPEO.cjs +0 -1
  122. package/dist/chunk-4Z75R3IT.cjs +0 -1
  123. package/dist/chunk-AJ25PWXX.cjs +0 -1
  124. package/dist/chunk-BHIBDDQF.js +0 -1
  125. package/dist/chunk-CE4JI2YB.js +0 -1
  126. package/dist/chunk-CMJ6UYWW.cjs +0 -1
  127. package/dist/chunk-D3VSHABU.cjs +0 -1
  128. package/dist/chunk-DG2GWBTS.cjs +0 -1
  129. package/dist/chunk-EKS4IZJR.cjs +0 -1
  130. package/dist/chunk-EOZKYR5S.cjs +0 -1
  131. package/dist/chunk-EW3I4O7X.js +0 -1
  132. package/dist/chunk-F3E77L46.js +0 -1
  133. package/dist/chunk-G5LXIEFO.js +0 -0
  134. package/dist/chunk-GVWGQNLF.js +0 -1
  135. package/dist/chunk-H3FXL4DU.cjs +0 -1
  136. package/dist/chunk-HHPDLSX2.cjs +0 -1
  137. package/dist/chunk-JARPXKBM.cjs +0 -1
  138. package/dist/chunk-JFJUPYDT.cjs +0 -1
  139. package/dist/chunk-JLP56WSM.js +0 -1
  140. package/dist/chunk-K3MV4AIN.cjs +0 -1
  141. package/dist/chunk-KOVO72OM.js +0 -1
  142. package/dist/chunk-LJ4M3VGE.js +0 -1
  143. package/dist/chunk-LJVGJLP4.js +0 -1
  144. package/dist/chunk-MISCBZJC.js +0 -1
  145. package/dist/chunk-MMSYCIJ2.cjs +0 -1
  146. package/dist/chunk-OLPKAX7F.cjs +0 -1
  147. package/dist/chunk-ORZFHBEY.js +0 -1
  148. package/dist/chunk-OWV2P376.js +0 -1
  149. package/dist/chunk-RV2WK5E6.js +0 -1
  150. package/dist/chunk-SBF43G3B.cjs +0 -1
  151. package/dist/chunk-X74TUJSE.cjs +0 -1
  152. package/dist/chunk-XLDAIZRK.js +0 -1
  153. package/dist/chunk-XZJ7C4N6.js +0 -1
  154. package/dist/chunk-ZHV5ZYVN.cjs +0 -1
  155. package/dist/chunk-ZL7J6GTP.js +0 -1
  156. package/dist/chunk-ZTCLKKMB.js +0 -1
  157. package/dist/env/index.cjs +0 -1
  158. package/dist/env/index.d.ts +0 -16
  159. package/dist/env/index.js +0 -1
  160. package/dist/formatting/index.d.ts +0 -950
  161. package/dist/formatting/index.js +0 -1
  162. package/dist/generator/index.cjs +0 -1
  163. package/dist/generator/index.js +0 -1
  164. package/dist/omit-VvmIsZmX.d.ts +0 -28
  165. package/dist/prettify-C4xLcYOP.d.ts +0 -353
  166. package/dist/promise/index.cjs +0 -1
  167. package/dist/promise/index.d.ts +0 -31
  168. package/dist/promise/index.js +0 -1
  169. package/dist/type-data-DDs-u2kq.d.ts +0 -261
  170. /package/dist/{chunk-5C2SMIGX.cjs → chunk-BAV5T2E3.cjs} +0 -0
  171. /package/dist/{chunk-MC3LXMCQ.js → chunk-L5RDAVVH.js} +0 -0
  172. /package/dist/{chunk-J2RGTPGK.cjs → chunk-VJDDGRIK.cjs} +0 -0
  173. /package/dist/{chunk-FIAAX3UE.js → chunk-YWHHVDT4.js} +0 -0
@@ -0,0 +1 @@
1
+ export{CustomPromise,delay}from"../chunk-QBKAEVYG.js";import"../chunk-WVSPXFTY.js";import"../chunk-PET42Z7W.js";import"../chunk-QNKGP5DY.js";import"../chunk-CMW2TBOQ.js";
@@ -0,0 +1,72 @@
1
+ /** --------------------------------------------------
2
+ * * ***Utility Type: `Awaitable`.***
3
+ * --------------------------------------------------
4
+ * **Represents a type that can be awaited:**
5
+ * - Either a plain value `T` or a `PromiseLike<T>`.
6
+ * @template T - The inner value type.
7
+ * @example
8
+ * ```ts
9
+ * async function wrap<T>(v: Awaitable<T>): Promise<T> {
10
+ * return await v;
11
+ * }
12
+ *
13
+ * const a = wrap(42); // Promise<number>
14
+ * const b = wrap(Promise.resolve("hi")); // Promise<string>
15
+ * ```
16
+ */
17
+ type Awaitable<T>=T|PromiseLike<T>;interface CustomPromiseLike<OnSuccess,OnError>{
18
+ /**
19
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
20
+ * @param onfulfilled The callback to execute when the Promise is resolved.
21
+ * @param onrejected The callback to execute when the Promise is rejected.
22
+ * @returns A Promise for the completion of which ever callback is executed.
23
+ */
24
+ then<TResult1=OnSuccess,TResult2=never>(onfulfilled?:((value:OnSuccess)=>TResult1|PromiseLike<TResult1>)|null|undefined,onrejected?:((reason:OnError)=>TResult2|PromiseLike<TResult2>)|null|undefined):CustomPromiseType<TResult1|TResult2,OnError>;
25
+ /**
26
+ * Attaches a callback for only the rejection of the Promise.
27
+ * @param onrejected The callback to execute when the Promise is rejected.
28
+ * @returns A Promise for the completion of the callback.
29
+ */
30
+ catch<TResult=never>(onrejected?:((reason:OnError)=>TResult|PromiseLike<TResult>)|null|undefined):CustomPromiseType<OnSuccess|TResult,OnError>;
31
+ /**
32
+ * Registers a callback to be invoked **exactly once** when the
33
+ * promise settles, with access to both the resolved value and
34
+ * the rejection reason.
35
+ *
36
+ * If the promise is already settled when `finish` is called,
37
+ * the callback executes immediately on the same tick.
38
+ *
39
+ * @param cb Callback receiving the final `(value, error)`.
40
+ * @returns `this` for fluent chaining.
41
+ */
42
+ finish(cb:(value:OnSuccess|undefined,error:OnError|undefined)=>void):CustomPromiseType<OnSuccess,OnError>;}
43
+ /** --------------------------------------------------
44
+ * * ***Utility Type: `CustomPromiseType`.***
45
+ * --------------------------------------------------
46
+ * **Extends the native `Promise` type to provide explicit typing
47
+ * for both the resolved (`onSuccess`) and rejected (`onError`) values,
48
+ * plus an optional `finish` hook.**
49
+ * - **Behavior:**
50
+ * - ✅ **Strongly types** `success`, `error`, and `finish` handlers.
51
+ * - ⚙️ `finish` runs exactly once after the promise settles (similar to `finish`).
52
+ * @template OnSuccess - The type of the fulfilled value.
53
+ * @template OnError - The type of the rejection reason, defaults to `unknown`.
54
+ * @example
55
+ * ```ts
56
+ * import type { CustomPromiseType } from "@rzl-zone/types";
57
+ * import { CustomsPromise } from "@rzl-zone/promises";
58
+ *
59
+ * const fetchUser = (): CustomPromiseType<User, ApiError> =>
60
+ * CustomsPromise<User, ApiError>((resolve, reject) => {
61
+ * apiCall().then(resolve).catch(reject);
62
+ * });
63
+ *
64
+ * fetchUser()
65
+ * .then(user => console.log(user))
66
+ * .catch(err => console.error(err))
67
+ * .finish((result, error) => {
68
+ * console.log("always runs", { result, error });
69
+ * });
70
+ * ```
71
+ */
72
+ type CustomPromiseType<OnSuccess,OnError=unknown>=CustomPromiseLike<OnSuccess,OnError>;export type{Awaitable as A,CustomPromiseType as C};