@rzl-zone/utils-js 3.1.0-beta.2 → 3.1.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 (195) hide show
  1. package/README.md +56 -27
  2. package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +23 -23
  3. package/dist/any-BmdI8UbK.d.ts +56 -56
  4. package/dist/arrays-normalize-recursive-CnjYJ9xg.d.ts +66 -66
  5. package/dist/assertions/index.cjs +1 -1
  6. package/dist/assertions/index.d.ts +396 -396
  7. package/dist/assertions/index.js +1 -1
  8. package/dist/chunk-26XIKDJI.cjs +1 -0
  9. package/dist/chunk-2NWHDDM5.js +1 -0
  10. package/dist/chunk-2UIRWYE3.js +1 -0
  11. package/dist/chunk-3KBHD3BS.cjs +1 -0
  12. package/dist/chunk-4HD2O5A4.js +1 -0
  13. package/dist/chunk-5C2SMIGX.cjs +1 -0
  14. package/dist/chunk-5I2B5DOG.js +1 -0
  15. package/dist/chunk-6HQDHIOD.js +1 -0
  16. package/dist/chunk-735HJXBT.cjs +1 -0
  17. package/dist/chunk-7BXIZM57.cjs +1 -0
  18. package/dist/chunk-7KJBDGEP.js +1 -0
  19. package/dist/chunk-7U44T63D.cjs +1 -0
  20. package/dist/chunk-AJ65QFV2.js +1 -0
  21. package/dist/chunk-APHDUCVQ.js +1 -0
  22. package/dist/chunk-BSVZRN7C.js +1 -0
  23. package/dist/chunk-C6JFHUR2.cjs +1 -0
  24. package/dist/chunk-CPLBRGST.js +1 -0
  25. package/dist/chunk-CTBRLEOG.js +1 -0
  26. package/dist/chunk-DUK2K4FB.js +1 -0
  27. package/dist/chunk-DVMHRLKP.cjs +1 -0
  28. package/dist/chunk-E63WVPZE.cjs +1 -0
  29. package/dist/chunk-EBMHQW7X.cjs +1 -0
  30. package/dist/chunk-EGNZCW4K.js +1 -0
  31. package/dist/chunk-FEKDB32T.js +1 -0
  32. package/dist/chunk-FIAAX3UE.js +1 -0
  33. package/dist/chunk-FUS3DVLB.cjs +1 -0
  34. package/dist/chunk-GGRMHIFJ.cjs +1 -0
  35. package/dist/chunk-HQ5GQTEE.js +1 -0
  36. package/dist/chunk-I5X5IN4H.js +1 -0
  37. package/dist/chunk-I7YGXQPI.cjs +1 -0
  38. package/dist/chunk-INUFZJLX.cjs +1 -0
  39. package/dist/chunk-IREHUBF7.js +1 -0
  40. package/dist/chunk-J2RGTPGK.cjs +1 -0
  41. package/dist/chunk-KHO2SBNA.cjs +1 -0
  42. package/dist/chunk-KXIXXSWX.cjs +1 -0
  43. package/dist/chunk-LBMEEJWA.js +1 -0
  44. package/dist/chunk-MC3LXMCQ.js +1 -0
  45. package/dist/chunk-MMSYCIJ2.cjs +1 -1
  46. package/dist/chunk-NU3N4WHD.cjs +1 -0
  47. package/dist/chunk-ODZQXH7E.cjs +1 -0
  48. package/dist/chunk-ONZFBJVW.js +1 -0
  49. package/dist/chunk-PXDRHFIE.js +1 -0
  50. package/dist/chunk-Q6NHYWVX.js +1 -0
  51. package/dist/chunk-QNKGP5DY.js +1 -0
  52. package/dist/chunk-S6Z6I2EG.cjs +1 -0
  53. package/dist/chunk-SMADKXZE.js +1 -0
  54. package/dist/chunk-TSLYDPBJ.js +1 -0
  55. package/dist/chunk-TVXADXCC.cjs +1 -0
  56. package/dist/chunk-UDA26MCU.cjs +1 -0
  57. package/dist/chunk-UET567YM.cjs +1 -0
  58. package/dist/chunk-VEYMQ3UA.js +1 -0
  59. package/dist/chunk-W2W3L2M5.js +1 -0
  60. package/dist/chunk-WBWTXKMC.cjs +1 -0
  61. package/dist/chunk-WVSPXFTY.js +1 -0
  62. package/dist/chunk-XC2PYCT4.cjs +1 -0
  63. package/dist/chunk-XIXA5KDF.cjs +1 -0
  64. package/dist/chunk-Y4O5KZF6.cjs +1 -0
  65. package/dist/chunk-YRM7IJLX.js +1 -0
  66. package/dist/chunk-YT3MSZKK.cjs +1 -0
  67. package/dist/chunk-YXHCULSO.cjs +1 -0
  68. package/dist/chunk-YZR5OGJA.cjs +1 -0
  69. package/dist/chunk-Z4DXK7A6.cjs +1 -0
  70. package/dist/chunk-ZXIWDFEQ.js +1 -0
  71. package/dist/conversions/index.cjs +1 -1
  72. package/dist/conversions/index.d.ts +1347 -1297
  73. package/dist/conversions/index.js +1 -1
  74. package/dist/env/index.cjs +1 -1
  75. package/dist/env/index.d.ts +14 -14
  76. package/dist/env/index.js +1 -1
  77. package/dist/events/index.cjs +1 -1
  78. package/dist/events/index.d.ts +109 -109
  79. package/dist/events/index.js +1 -1
  80. package/dist/extends-Bk_SBGdT.d.ts +330 -330
  81. package/dist/formatting/index.cjs +1 -1
  82. package/dist/formatting/index.d.ts +855 -855
  83. package/dist/formatting/index.js +1 -1
  84. package/dist/generator/index.cjs +1 -1
  85. package/dist/generator/index.d.ts +155 -155
  86. package/dist/generator/index.js +1 -1
  87. package/dist/if-CvT4R7Kh.d.ts +16 -16
  88. package/dist/is-array-Cymwrsmm.d.ts +1119 -0
  89. package/dist/isPlainObject-BVhBAPHX.d.ts +154 -154
  90. package/dist/never-BfayMBF9.d.ts +64 -64
  91. package/dist/next/index.cjs +1 -8
  92. package/dist/next/index.d.ts +183 -183
  93. package/dist/next/index.js +1 -8
  94. package/dist/next/server/index.cjs +1 -2
  95. package/dist/next/server/index.d.ts +25 -25
  96. package/dist/next/server/index.js +1 -2
  97. package/dist/nils-DMz3kU7M.d.ts +155 -155
  98. package/dist/omit-VvmIsZmX.d.ts +25 -25
  99. package/dist/operations/index.cjs +1 -1
  100. package/dist/operations/index.d.ts +120 -120
  101. package/dist/operations/index.js +1 -1
  102. package/dist/or-DyZCRvaU.d.ts +89 -0
  103. package/dist/parsers/index.cjs +1 -1
  104. package/dist/parsers/index.d.ts +34 -34
  105. package/dist/parsers/index.js +1 -1
  106. package/dist/predicates/index.cjs +1 -1
  107. package/dist/predicates/index.d.ts +1774 -1680
  108. package/dist/predicates/index.js +1 -1
  109. package/dist/prettify-C4xLcYOP.d.ts +328 -328
  110. package/dist/promise/index.cjs +1 -1
  111. package/dist/promise/index.d.ts +29 -29
  112. package/dist/promise/index.js +1 -1
  113. package/dist/rzl-utils.global.js +1 -4
  114. package/dist/string-XA-til3C.d.ts +318 -318
  115. package/dist/strings/index.cjs +1 -1
  116. package/dist/strings/index.d.ts +690 -690
  117. package/dist/strings/index.js +1 -1
  118. package/dist/tailwind/index.cjs +1 -0
  119. package/dist/tailwind/index.d.ts +565 -0
  120. package/dist/tailwind/index.js +1 -0
  121. package/dist/type-data-DDs-u2kq.d.ts +241 -241
  122. package/dist/types/index.d.ts +3266 -3266
  123. package/dist/urls/index.cjs +1 -1
  124. package/dist/urls/index.d.ts +373 -373
  125. package/dist/urls/index.js +1 -1
  126. package/package.json +24 -23
  127. package/dist/chunk-25G6B35W.js +0 -1
  128. package/dist/chunk-2AUUPGMN.js +0 -1
  129. package/dist/chunk-2JQQQ625.js +0 -1
  130. package/dist/chunk-445TAVT4.cjs +0 -1
  131. package/dist/chunk-467VEMJH.js +0 -1
  132. package/dist/chunk-56QBKKRE.js +0 -1
  133. package/dist/chunk-5SZUSNGZ.js +0 -1
  134. package/dist/chunk-6Q4I2RPC.cjs +0 -1
  135. package/dist/chunk-6SMJMZ7G.cjs +0 -1
  136. package/dist/chunk-7YWAQOA4.cjs +0 -1
  137. package/dist/chunk-BLCANGFS.js +0 -1
  138. package/dist/chunk-CK3BZGEU.js +0 -1
  139. package/dist/chunk-D43GV6EF.cjs +0 -1
  140. package/dist/chunk-DFSTVQFI.cjs +0 -1
  141. package/dist/chunk-DYRDBYPF.cjs +0 -1
  142. package/dist/chunk-ELDDNERR.js +0 -1
  143. package/dist/chunk-EXXLUO7L.cjs +0 -1
  144. package/dist/chunk-FIEZKTAZ.cjs +0 -1
  145. package/dist/chunk-G72VSVGO.js +0 -1
  146. package/dist/chunk-GAJTFCUA.js +0 -1
  147. package/dist/chunk-GOJNH55O.cjs +0 -1
  148. package/dist/chunk-HXST7RJB.js +0 -1
  149. package/dist/chunk-HXTACM3O.cjs +0 -1
  150. package/dist/chunk-IJTZWWRJ.cjs +0 -1
  151. package/dist/chunk-ISJ33O2J.cjs +0 -1
  152. package/dist/chunk-JISH2VGG.js +0 -1
  153. package/dist/chunk-JQZUWBIX.js +0 -1
  154. package/dist/chunk-K4PLGD7C.js +0 -1
  155. package/dist/chunk-KZQB7H4E.cjs +0 -1
  156. package/dist/chunk-LUVV5KSD.cjs +0 -2
  157. package/dist/chunk-LVUSFXQS.cjs +0 -1
  158. package/dist/chunk-ME5OV5HN.js +0 -1
  159. package/dist/chunk-MF5Y5K4N.cjs +0 -1
  160. package/dist/chunk-MJAW5RAK.js +0 -1
  161. package/dist/chunk-MWLEM7ED.js +0 -1
  162. package/dist/chunk-NNM7QCNB.js +0 -1
  163. package/dist/chunk-NSVLG7NY.js +0 -4
  164. package/dist/chunk-NUHOOAUN.cjs +0 -1
  165. package/dist/chunk-NUVGETPD.js +0 -2
  166. package/dist/chunk-O5VXBNUQ.cjs +0 -4
  167. package/dist/chunk-O7SJR4CY.cjs +0 -1
  168. package/dist/chunk-OX6RLS2F.cjs +0 -1
  169. package/dist/chunk-PFLNHD4B.cjs +0 -1
  170. package/dist/chunk-PSWITZK5.js +0 -1
  171. package/dist/chunk-PUQXRLZH.cjs +0 -1
  172. package/dist/chunk-PYUVKHUF.cjs +0 -1
  173. package/dist/chunk-REFMEB4A.js +0 -1
  174. package/dist/chunk-RHE3M2NJ.cjs +0 -1
  175. package/dist/chunk-RHIBYOFQ.js +0 -1
  176. package/dist/chunk-RV2VULM7.cjs +0 -1
  177. package/dist/chunk-S7GMG4TB.js +0 -1
  178. package/dist/chunk-SW6HYEW7.cjs +0 -1
  179. package/dist/chunk-SYJC7UAW.js +0 -1
  180. package/dist/chunk-TQMZ2LPI.js +0 -1
  181. package/dist/chunk-U4TZO7WV.js +0 -1
  182. package/dist/chunk-UUMKL74S.js +0 -1
  183. package/dist/chunk-VQLAPEL3.js +0 -1
  184. package/dist/chunk-VTR75UID.cjs +0 -1
  185. package/dist/chunk-XFCJDSB2.cjs +0 -1
  186. package/dist/chunk-XOYX4PLZ.cjs +0 -1
  187. package/dist/chunk-Z6FLCEN6.js +0 -1
  188. package/dist/chunk-ZO5364A6.cjs +0 -1
  189. package/dist/index.cjs +0 -1
  190. package/dist/index.d.ts +0 -1
  191. package/dist/index.js +0 -1
  192. package/dist/is-array--YjXV-Wx.d.ts +0 -1207
  193. package/dist/stylings/index.cjs +0 -1
  194. package/dist/stylings/index.d.ts +0 -41
  195. package/dist/stylings/index.js +0 -1
package/README.md CHANGED
@@ -6,18 +6,34 @@
6
6
  🚀 <strong>Rzl Utility JavaScript</strong> 🚀<br/>
7
7
  A lightweight, modern TypeScript utility library for Node.js & browser (via bundlers like Webpack/Vite).<br/>
8
8
  Provides reusable helpers to simplify your JavaScript / TypeScript projects.<br/>
9
- <strong>Built with ❤️ by <a href="https://github.com/rzl-app">@rzl-app</a>.</strong>
9
+ <strong>Built with ❤️ by <a href="https://github.com/rzl-app" target="_blank" rel="nofollow noreferrer noopener">@rzl-app</a>.</strong>
10
10
  </p>
11
11
 
12
12
  <div align="center">
13
13
 
14
- [![Latest Version on NPM](https://img.shields.io/npm/v/@rzl-zone/utils-js?color=blue&style=flat-rounded)](https://npmjs.com/package/@rzl-zone/utils-js)
15
- [![downloads](https://img.shields.io/npm/dt/@rzl-zone/utils-js?style=flat-rounded)](https://npmjs.com/package/@rzl-zone/utils-js)
16
- [![Node.js](https://img.shields.io/badge/node-%3E%3D16.0.0%20%7C%20%3E%3D18.17.0-blue.svg?logo=node.js&style=flat-rounded)](https://nodejs.org/en/)
17
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/rzl-zone/utils-js/blob/main/CONTRIBUTING.md)
18
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/rzl-zone/utils-js/blob/main/LICENSE.md)
19
- [![GitHub](https://img.shields.io/badge/GitHub-rzl--zone%2Futils--js-181717?logo=github)](https://github.com/rzl-zone/utils-js)
20
- [![Repo on GitHub](https://img.shields.io/badge/Repo-on%20GitHub-181717?logo=github&style=flat-rounded)](https://github.com/rzl-app)
14
+ <p>
15
+ <a href="https://npmjs.com/package/@rzl-zone/utils-js" target="_blank" rel="nofollow noreferrer noopener">
16
+ <img src="https://img.shields.io/npm/v/@rzl-zone/utils-js?color=blue&style=flat-rounded" alt="Latest Version on NPM" data-canonical-src="https://img.shields.io/npm/v/@rzl-zone/utils-js?color=blue&amp;style=flat-rounded">
17
+ </a>
18
+ <a href="https://npmjs.com/package/@rzl-zone/utils-js" target="_blank" rel="nofollow noreferrer noopener">
19
+ <img src="https://img.shields.io/npm/dt/@rzl-zone/utils-js?style=flat-rounded" alt="Downloads">
20
+ </a>
21
+ <a href="https://nodejs.org/en/" target="_blank" rel="nofollow noreferrer noopener">
22
+ <img src="https://img.shields.io/badge/node-≥16.0.0%20%7C%20≥18.17.0-blue.svg?logo=node.js&style=flat-rounded" alt="Node.js">
23
+ </a>
24
+ <a href="https://github.com/rzl-zone/utils-js/blob/main/CONTRIBUTING.md" target="_blank" rel="nofollow noreferrer noopener">
25
+ <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome">
26
+ </a>
27
+ <a href="https://github.com/rzl-zone/utils-js/blob/main/LICENSE.md" target="_blank" rel="nofollow noreferrer noopener">
28
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license">
29
+ </a>
30
+ <a href="https://github.com/rzl-zone/utils-js" target="_blank" rel="nofollow noreferrer noopener">
31
+ <img src="https://img.shields.io/badge/GitHub-rzl--zone%2Futils--js-181717?logo=github" alt="GitHub">
32
+ </a>
33
+ <a href="https://github.com/rzl-app" target="_blank" rel="nofollow noreferrer noopener">
34
+ <img src="https://img.shields.io/badge/Repo-on%20GitHub-181717?logo=github&style=flat-rounded" alt="Repo on GitHub">
35
+ </a>
36
+ </p>
21
37
 
22
38
  </div>
23
39
 
@@ -34,7 +50,7 @@ Provides reusable helpers to simplify your JavaScript / TypeScript projects.<br/
34
50
  - ❤️ [Sponsor](#sponsor-this-package)
35
51
  - 📜 [Changelog](#changelog)
36
52
  - 🤝 [Contributing](#contributing)
37
- - 🛡 [Security](#security)
53
+ - 🔒 [Security](#security)
38
54
  - 🙌 [Credits](#credits)
39
55
  - 📄 [License](#license)
40
56
 
@@ -42,12 +58,14 @@ Provides reusable helpers to simplify your JavaScript / TypeScript projects.<br/
42
58
 
43
59
  <h2 id="requirements">💻 Requirements</h2>
44
60
 
45
- - **Node.js >= 16.0.0 or >=18.17.0**
46
- This package leverages modern JavaScript & TypeScript features that require Node.js version 16.0.0 if not using nextjs and 18.17.0 or higher for nextjs.
61
+ - **Node.js `≥16.0.0` or `≥18.17.0`**
62
+ This package leverages modern JavaScript & TypeScript features that require Node.js version 16.0.0 if not using Next.js, and for Next.js it must follow the official minimum Node.js version requirement depending on the version you use.
63
+ - 🔗 See official Next.js documentation:
64
+ <a href="https://nextjs.org/docs/getting-started/installation#system-requirements" target="_blank" rel="nofollow noreferrer noopener">NextJS Installation Requirements</a>
47
65
 
48
66
  - Works with:
49
67
  - ✅ Node.js (16.0.0+) - Without NextJS
50
- - ✅ Node.js (18.17.0+) - With NextJS
68
+ - ✅ Node.js (18.17.0, or higher depending on NextJS version) - With NextJS
51
69
  - ✅ Modern browsers (via bundlers like Webpack / Vite)
52
70
 
53
71
  ---
@@ -109,19 +127,30 @@ This package also provides utilities specially built for Next.js environments, n
109
127
 
110
128
  <h2 id="detailed-features">💎 Detailed Features</h2>
111
129
 
112
- ### Full documentation coming soon.
113
- #### For now, explore the examples or dive into the source — all utilities are documented via **JSDoc** and typed properly.
130
+ ### Full documentation <a href="https://docs-rzl-utils-js.vercel.app" target="_blank" rel="nofollow noreferrer noopener">Rzl UtilsJS</a> is **currently under construction** 🏗️.
131
+ #### For now, explore the examples or dive into the source — all utilities are documented via **TSDoc** and typed properly.
114
132
 
115
133
  ```ts
116
- import { | } from "@rzl-zone/utils-js";
117
- import { | } from "@rzl-zone/utils-js\types";
118
- import { | } from "@rzl-zone/utils-js\next";
119
- import { | } from "@rzl-zone/utils-js\next\server";
120
-
121
- // Just place your cursor right inside { } like the pipe ("|") above then
122
- // ctrl + space, there are many functions or types and then hover to each
123
- // function is complete with how to use it because I have added jsDoc.
134
+ import { | } from "@rzl-zone/utils-js/assertions";
135
+ import { | } from "@rzl-zone/utils-js/conversions";
136
+ import { | } from "@rzl-zone/utils-js/env";
137
+ import { | } from "@rzl-zone/utils-js/events";
138
+ import { | } from "@rzl-zone/utils-js/formatting";
139
+ import { | } from "@rzl-zone/utils-js/generator";
140
+ import { | } from "@rzl-zone/utils-js/generator";
141
+ import { | } from "@rzl-zone/utils-js/next";
142
+ import { | } from "@rzl-zone/utils-js/next/server";
143
+ import { | } from "@rzl-zone/utils-js/operations";
144
+ import { | } from "@rzl-zone/utils-js/parsers";
145
+ import { | } from "@rzl-zone/utils-js/predicates";
146
+ import { | } from "@rzl-zone/utils-js/promise";
147
+ import { | } from "@rzl-zone/utils-js/strings";
148
+ import { | } from "@rzl-zone/utils-js/stylings";
149
+ import { | } from "@rzl-zone/utils-js/urls";
150
+
151
+ import type { | } from "@rzl-zone/utils-js/types";
124
152
  ```
153
+ #### Just place your cursor right inside `{ }` or from after import from `"@rzl-zone/utils-js/"` like the pipe ("|") above then ctrl + space, there are many functions or types and then hover to each function is complete with how to use it because I have added tsDoc.
125
154
 
126
155
  <!-- - <h4 id="detailed-features--assertions">
127
156
  Assertions -
@@ -148,18 +177,18 @@ This package also provides utilities specially built for Next.js environments, n
148
177
 
149
178
  <h2 id="usage">🔥 Usage</h2>
150
179
 
151
- #### Easy to use, just import on your code base.
180
+ ### Easy to use, just import on your code base.
152
181
 
153
- ##### Example Function Import:
182
+ #### Example Function Import:
154
183
 
155
184
  ```ts
156
- import { isServer } from "@rzl-zone/utils-js";
185
+ import { isServer } from "@rzl-zone/utils-js/env";
157
186
 
158
187
  console.log(isServer());
159
188
  // true if running on Node.js, false if browser
160
189
  ```
161
190
 
162
- ##### Example TypeScript Helper Import:
191
+ #### Example Types Helper Import:
163
192
 
164
193
  ```ts
165
194
  import type { OmitStrict } from "@rzl-zone/utils-js/types";
@@ -189,7 +218,7 @@ See [CONTRIBUTING](CONTRIBUTING.md).
189
218
 
190
219
  ---
191
220
 
192
- <h2 id="security">🛡 Security</h2>
221
+ <h2 id="security">🔒 Security</h2>
193
222
 
194
223
  Please report issues to [rizalvindwiky1998@gmail.com](mailto:rizalvindwiky1998@gmail.com).
195
224
 
@@ -1,26 +1,26 @@
1
1
  type Enumerate<N extends number,Acc extends number[]=[]>=Acc["length"] extends N?Acc[number]:Enumerate<N,[...Acc,Acc["length"]]>;
2
2
  /** --------------------------------------------------
3
- * * ***Generate a union type of numbers from `From` to `To` using enumeration.***
4
- * --------------------------------------------------
5
- *
6
- * @template From - Starting number of the range (inclusive).
7
- * @template To - Ending number of the range (inclusive).
8
- *
9
- * @description
10
- * Produces a **numeric union type** from `From` to `To` (inclusive),
11
- * using a simpler approach based on `Enumerate<N>` helper type.
12
- *
13
- * - ✅ Straightforward & easy to reason about.
14
- * - ⚠️ Still limited by TypeScript recursion depth (safe up to `999`).
15
- * - ⚙️ Best used for **smaller ranges** or when readability matters.
16
- *
17
- * @example
18
- * ```ts
19
- * type RangeX = NumberRangeUnion<3, 6>;
20
- * // ^? 3 | 4 | 5 | 6
21
- *
22
- * type RangeY = NumberRangeUnion<0, 2>;
23
- * // ^? 0 | 1 | 2
24
- * ```
25
- */
3
+ * * ***Generate a union type of numbers from `From` to `To` using enumeration.***
4
+ * --------------------------------------------------
5
+ *
6
+ * @template From - Starting number of the range (inclusive).
7
+ * @template To - Ending number of the range (inclusive).
8
+ *
9
+ * @description
10
+ * Produces a **numeric union type** from `From` to `To` (inclusive),
11
+ * using a simpler approach based on `Enumerate<N>` helper type.
12
+ *
13
+ * - ✅ Straightforward & easy to reason about.
14
+ * - ⚠️ Still limited by TypeScript recursion depth (safe up to `999`).
15
+ * - ⚙️ Best used for **smaller ranges** or when readability matters.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * type RangeX = NumberRangeUnion<3, 6>;
20
+ * // ^? 3 | 4 | 5 | 6
21
+ *
22
+ * type RangeY = NumberRangeUnion<0, 2>;
23
+ * // ^? 0 | 1 | 2
24
+ * ```
25
+ */
26
26
  type NumberRangeUnion<From extends number,To extends number>=From extends To?From:Exclude<Enumerate<To>,Enumerate<From>>extends never?never:Exclude<Enumerate<To>,Enumerate<From>>|To;export type{NumberRangeUnion as N};
@@ -1,67 +1,67 @@
1
1
  import{I as If}from'./if-CvT4R7Kh.js';
2
2
  /** -------------------------------------------------------
3
- * * ***IsAny.***
4
- * -------------------------------------------------------
5
- * A type-level utility that checks whether a type is ***`any`***.
6
- * - Returns `true` if `T` is `any`.
7
- * - Returns `false` otherwise.
8
- *
9
- * @template T - The type to evaluate.
10
- * @example
11
- * ```ts
12
- * type A = IsAny<any>; // ➔ true
13
- * type B = IsAny<string>; // ➔ false
14
- * type C = IsAny<unknown>; // ➔ false
15
- * type D = IsAny<never>; // ➔ false
16
- * ```
17
- */
3
+ * * ***IsAny.***
4
+ * -------------------------------------------------------
5
+ * A type-level utility that checks whether a type is ***`any`***.
6
+ * - Returns `true` if `T` is `any`.
7
+ * - Returns `false` otherwise.
8
+ *
9
+ * @template T - The type to evaluate.
10
+ * @example
11
+ * ```ts
12
+ * type A = IsAny<any>; // ➔ true
13
+ * type B = IsAny<string>; // ➔ false
14
+ * type C = IsAny<unknown>; // ➔ false
15
+ * type D = IsAny<never>; // ➔ false
16
+ * ```
17
+ */
18
18
  type IsAny<T>=0 extends 1 & T?true:false;
19
19
  /** -------------------------------------------------------
20
- * * ***IfAny.***
21
- * -------------------------------------------------------
22
- *
23
- * A type-level conditional utility that returns one type if ***`T` is `any`***,
24
- * and another type otherwise.
25
- * - Defaults to `true` when `T` is `any`.
26
- * - Defaults to `false` otherwise.
27
- *
28
- * @template T - The type to check.
29
- * @template IfTrue - The type to return if `T` is `any`. *(default: `true`)*
30
- * @template IfFalse - The type to return if `T` is not `any`. *(default: `false`)*
31
- *
32
- * @example
33
- * ```ts
34
- * type A = IfAny<any, string, number>;
35
- * // ➔ string
36
- * type B = IfAny<string, string, number>;
37
- * // ➔ number
38
- * ```
39
- */
20
+ * * ***IfAny.***
21
+ * -------------------------------------------------------
22
+ *
23
+ * A type-level conditional utility that returns one type if ***`T` is `any`***,
24
+ * and another type otherwise.
25
+ * - Defaults to `true` when `T` is `any`.
26
+ * - Defaults to `false` otherwise.
27
+ *
28
+ * @template T - The type to check.
29
+ * @template IfTrue - The type to return if `T` is `any`. *(default: `true`)*
30
+ * @template IfFalse - The type to return if `T` is not `any`. *(default: `false`)*
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * type A = IfAny<any, string, number>;
35
+ * // ➔ string
36
+ * type B = IfAny<string, string, number>;
37
+ * // ➔ number
38
+ * ```
39
+ */
40
40
  type IfAny<T,IfTrue=true,IfFalse=false>=If<IsAny<T>,IfTrue,IfFalse>;
41
41
  /** Configuration options for a type-level utility `AnifyProperties`. */
42
42
  type AnifyPropertiesOptions={
43
43
  /** If `makeOptional: true`, all properties become optional, otherwise, all properties are required and typed as `any`, defaultValue: `false`.
44
- *
45
- * @default false
46
- */
44
+ *
45
+ * @default false
46
+ */
47
47
  makeOptional:boolean;};
48
48
  /** -------------------------------------------------------
49
- * * ***AnifyProperties.***
50
- * -------------------------------------------------------
51
- *
52
- * A type-level utility that transforms all properties of an object into ***`any`***.
53
- * - If `makeOptional: true`, all properties become optional.
54
- * - Otherwise, all properties are required and typed as `any`.
55
- *
56
- * @template T - The object type to transform.
57
- * @template Options - Configuration options. Defaults to `{ makeOptional: false }`.
58
- * @example
59
- * ```ts
60
- * type A = AnifyProperties<{a: string; b: number}>;
61
- * // ➔ { a: any; b: any }
62
- *
63
- * type B = AnifyProperties<{a: string; b: number}, { makeOptional: true }>;
64
- * // ➔ { a?: any; b?: any }
65
- * ```
66
- */
49
+ * * ***AnifyProperties.***
50
+ * -------------------------------------------------------
51
+ *
52
+ * A type-level utility that transforms all properties of an object into ***`any`***.
53
+ * - If `makeOptional: true`, all properties become optional.
54
+ * - Otherwise, all properties are required and typed as `any`.
55
+ *
56
+ * @template T - The object type to transform.
57
+ * @template Options - Configuration options. Defaults to `{ makeOptional: false }`.
58
+ * @example
59
+ * ```ts
60
+ * type A = AnifyProperties<{a: string; b: number}>;
61
+ * // ➔ { a: any; b: any }
62
+ *
63
+ * type B = AnifyProperties<{a: string; b: number}, { makeOptional: true }>;
64
+ * // ➔ { a?: any; b?: any }
65
+ * ```
66
+ */
67
67
  type AnifyProperties<T extends object,Options extends AnifyPropertiesOptions={makeOptional:false;}>={[K in keyof T]:any;}extends infer Result?If<Options["makeOptional"],Partial<Result>,Result>:never;export type{AnifyProperties as A,IsAny as I,AnifyPropertiesOptions as a,IfAny as b};
@@ -1,72 +1,72 @@
1
1
  /** -------------------------------------------------------
2
- * * ***FixNeverArrayRecursive.***
3
- * -------------------------------------------------------
4
- * A type-level utility that **recursively transforms arrays of type `never[]` into empty arrays**.
5
- * - Preserves `readonly` modifiers.
6
- * - Applies recursively for nested arrays.
7
- * - Leaves other types unchanged.
8
- *
9
- * @template T - The input type to recursively fix.
10
- * @example
11
- * ```ts
12
- * type A = FixNeverArrayRecursive<never[]>;
13
- * // ➔ []
14
- * type B = FixNeverArrayRecursive<readonly never[]>;
15
- * // ➔ readonly []
16
- * type C = FixNeverArrayRecursive<string[]>;
17
- * // ➔ string[]
18
- * type D = FixNeverArrayRecursive<(never | string)[]>;
19
- * // ➔ (never | string)[]
20
- * type E = FixNeverArrayRecursive<(never[])[]>;
21
- * // ➔ [][]
22
- * ```
23
- */
2
+ * * ***FixNeverArrayRecursive.***
3
+ * -------------------------------------------------------
4
+ * A type-level utility that **recursively transforms arrays of type `never[]` into empty arrays**.
5
+ * - Preserves `readonly` modifiers.
6
+ * - Applies recursively for nested arrays.
7
+ * - Leaves other types unchanged.
8
+ *
9
+ * @template T - The input type to recursively fix.
10
+ * @example
11
+ * ```ts
12
+ * type A = FixNeverArrayRecursive<never[]>;
13
+ * // ➔ []
14
+ * type B = FixNeverArrayRecursive<readonly never[]>;
15
+ * // ➔ readonly []
16
+ * type C = FixNeverArrayRecursive<string[]>;
17
+ * // ➔ string[]
18
+ * type D = FixNeverArrayRecursive<(never | string)[]>;
19
+ * // ➔ (never | string)[]
20
+ * type E = FixNeverArrayRecursive<(never[])[]>;
21
+ * // ➔ [][]
22
+ * ```
23
+ */
24
24
  type FixNeverArrayRecursive<T>=T extends readonly never[]?T extends never[]?[]:readonly []:T extends(infer U)[]?FixNeverArrayRecursive<U>[]:T extends readonly(infer U)[]?readonly FixNeverArrayRecursive<U>[]:T;
25
25
  /** -------------------------------------------------------
26
- * * ***NormalizeEmptyArraysRecursive.***
27
- * -------------------------------------------------------
28
- * A type-level utility that **recursively normalizes empty array types** by converting arrays whose element type is `never`, `null`, or `undefined` into empty tuple types (`[]`).
29
- * - Preserves `readonly` modifiers.
30
- * - Recurses into nested arrays.
31
- * - Leaves other array types unchanged.
32
- *
33
- * @template T - The input type to normalize.
34
- * @example
35
- * ```ts
36
- * type A = NormalizeEmptyArraysRecursive<never[]>;
37
- * // ➔ []
38
- * type B = NormalizeEmptyArraysRecursive<readonly never[]>;
39
- * // ➔ readonly []
40
- * type C = NormalizeEmptyArraysRecursive<null[]>;
41
- * // ➔ []
42
- * type D = NormalizeEmptyArraysRecursive<(null[] | string[])[]>;
43
- * // ➔ ([] | string[])[]
44
- * type E = NormalizeEmptyArraysRecursive<string[]>;
45
- * // ➔ string[]
46
- * ```
47
- */
26
+ * * ***NormalizeEmptyArraysRecursive.***
27
+ * -------------------------------------------------------
28
+ * A type-level utility that **recursively normalizes empty array types** by converting arrays whose element type is `never`, `null`, or `undefined` into empty tuple types (`[]`).
29
+ * - Preserves `readonly` modifiers.
30
+ * - Recurses into nested arrays.
31
+ * - Leaves other array types unchanged.
32
+ *
33
+ * @template T - The input type to normalize.
34
+ * @example
35
+ * ```ts
36
+ * type A = NormalizeEmptyArraysRecursive<never[]>;
37
+ * // ➔ []
38
+ * type B = NormalizeEmptyArraysRecursive<readonly never[]>;
39
+ * // ➔ readonly []
40
+ * type C = NormalizeEmptyArraysRecursive<null[]>;
41
+ * // ➔ []
42
+ * type D = NormalizeEmptyArraysRecursive<(null[] | string[])[]>;
43
+ * // ➔ ([] | string[])[]
44
+ * type E = NormalizeEmptyArraysRecursive<string[]>;
45
+ * // ➔ string[]
46
+ * ```
47
+ */
48
48
  type NormalizeEmptyArraysRecursive<T>=T extends readonly(infer U)[]?U extends never|null|undefined?T extends readonly unknown[]?T extends(infer E)[]?[]:readonly []:never:T extends(infer E)[]?NormalizeEmptyArraysRecursive<U>[]:readonly NormalizeEmptyArraysRecursive<U>[]:T;
49
49
  /** -------------------------------------------------------
50
- * * ***RemoveEmptyArrayElements.***
51
- * -------------------------------------------------------
52
- * A type-level utility that **recursively removes empty array elements (`[]`) from a tuple type**.
53
- * - If `T` is a tuple, checks the first element:
54
- * - If `Head` is an empty array type (`[]`), it is removed.
55
- * - Otherwise, `Head` is preserved.
56
- * - Repeats recursively on the rest of the tuple.
57
- * - Leaves non-tuple types unchanged.
58
- *
59
- * @template T - The tuple type to process.
60
- * @example
61
- * ```ts
62
- * type A = RemoveEmptyArrayElements<[[], 1, [], 2]>;
63
- * // ➔ [1, 2]
64
- * type B = RemoveEmptyArrayElements<[]>;
65
- * // ➔ []
66
- * type C = RemoveEmptyArrayElements<[[], [], []]>;
67
- * // ➔ []
68
- * type D = RemoveEmptyArrayElements<[1, 2, 3]>;
69
- * // ➔ [1, 2, 3]
70
- * ```
71
- */
50
+ * * ***RemoveEmptyArrayElements.***
51
+ * -------------------------------------------------------
52
+ * A type-level utility that **recursively removes empty array elements (`[]`) from a tuple type**.
53
+ * - If `T` is a tuple, checks the first element:
54
+ * - If `Head` is an empty array type (`[]`), it is removed.
55
+ * - Otherwise, `Head` is preserved.
56
+ * - Repeats recursively on the rest of the tuple.
57
+ * - Leaves non-tuple types unchanged.
58
+ *
59
+ * @template T - The tuple type to process.
60
+ * @example
61
+ * ```ts
62
+ * type A = RemoveEmptyArrayElements<[[], 1, [], 2]>;
63
+ * // ➔ [1, 2]
64
+ * type B = RemoveEmptyArrayElements<[]>;
65
+ * // ➔ []
66
+ * type C = RemoveEmptyArrayElements<[[], [], []]>;
67
+ * // ➔ []
68
+ * type D = RemoveEmptyArrayElements<[1, 2, 3]>;
69
+ * // ➔ [1, 2, 3]
70
+ * ```
71
+ */
72
72
  type RemoveEmptyArrayElements<T>=T extends [infer Head,...infer Tail]?Head extends []?RemoveEmptyArrayElements<Tail>:[Head,...RemoveEmptyArrayElements<Tail>]:T extends []?[]:T;export type{FixNeverArrayRecursive as F,NormalizeEmptyArraysRecursive as N,RemoveEmptyArrayElements as R};
@@ -1 +1 @@
1
- 'use strict';var chunkDFSTVQFI_cjs=require('../chunk-DFSTVQFI.cjs'),chunkISJ33O2J_cjs=require('../chunk-ISJ33O2J.cjs'),chunkDYRDBYPF_cjs=require('../chunk-DYRDBYPF.cjs');require('../chunk-7YWAQOA4.cjs');var chunkLVUSFXQS_cjs=require('../chunk-LVUSFXQS.cjs');Object.defineProperty(exports,"assertIsBigInt",{enumerable:true,get:function(){return chunkDFSTVQFI_cjs.a}});Object.defineProperty(exports,"assertIsNumber",{enumerable:true,get:function(){return chunkDFSTVQFI_cjs.b}});Object.defineProperty(exports,"assertIsArray",{enumerable:true,get:function(){return chunkISJ33O2J_cjs.a}});Object.defineProperty(exports,"assertIsString",{enumerable:true,get:function(){return chunkDYRDBYPF_cjs.a}});Object.defineProperty(exports,"assertIsBoolean",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.G}});Object.defineProperty(exports,"assertIsPlainObject",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.j}});
1
+ "use strict";var e=require("../chunk-UET567YM.cjs"),r=require("../chunk-YT3MSZKK.cjs"),t=require("../chunk-Y4O5KZF6.cjs");require("../chunk-UDA26MCU.cjs");var s=require("../chunk-INUFZJLX.cjs");Object.defineProperty(exports,"assertIsBigInt",{enumerable:!0,get:function(){return e.assertIsBigInt}}),Object.defineProperty(exports,"assertIsNumber",{enumerable:!0,get:function(){return e.assertIsNumber}}),Object.defineProperty(exports,"assertIsArray",{enumerable:!0,get:function(){return r.assertIsArray}}),Object.defineProperty(exports,"assertIsString",{enumerable:!0,get:function(){return t.assertIsString}}),Object.defineProperty(exports,"assertIsBoolean",{enumerable:!0,get:function(){return s.assertIsBoolean}}),Object.defineProperty(exports,"assertIsPlainObject",{enumerable:!0,get:function(){return s.assertIsPlainObject}});