@rzl-zone/utils-js 3.1.2-beta.0 → 3.2.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 (210) hide show
  1. package/README.md +59 -32
  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-3VA554KW.js +1 -0
  12. package/dist/chunk-5757UBXJ.cjs +1 -0
  13. package/dist/chunk-5IGC6PBH.js +1 -0
  14. package/dist/chunk-5KJFVIQT.cjs +1 -0
  15. package/dist/chunk-6JFCSH7J.js +1 -0
  16. package/dist/chunk-6JFZL7YE.cjs +1 -0
  17. package/dist/chunk-7ODAAXX5.cjs +1 -0
  18. package/dist/chunk-BAV5T2E3.cjs +1 -0
  19. package/dist/chunk-CAH33WOQ.cjs +1 -0
  20. package/dist/chunk-CKTLUNWX.js +1 -0
  21. package/dist/chunk-CMW2TBOQ.js +1 -0
  22. package/dist/chunk-D3ENH7H6.cjs +1 -0
  23. package/dist/chunk-DEZZUYE2.js +1 -0
  24. package/dist/chunk-DVMHRLKP.cjs +1 -0
  25. package/dist/chunk-DWF2R5GD.cjs +1 -0
  26. package/dist/chunk-E55EQK2U.cjs +1 -0
  27. package/dist/chunk-E74U6CYP.cjs +1 -0
  28. package/dist/chunk-EL6A35UR.cjs +1 -0
  29. package/dist/chunk-F6IPNNSJ.cjs +1 -0
  30. package/dist/chunk-FJZGG54N.cjs +1 -0
  31. package/dist/chunk-FWCKOJZM.js +1 -0
  32. package/dist/chunk-FWHNWL2P.cjs +1 -0
  33. package/dist/chunk-GGEADHZO.js +1 -0
  34. package/dist/chunk-GQR4R5WY.js +1 -0
  35. package/dist/chunk-H66AC7GK.cjs +1 -0
  36. package/dist/chunk-HQWOFR56.cjs +1 -0
  37. package/dist/chunk-HYRQMTRH.cjs +1 -0
  38. package/dist/chunk-IRFL4MAX.js +1 -0
  39. package/dist/chunk-IVL7CKVH.cjs +1 -0
  40. package/dist/chunk-IZPBKKPO.js +1 -0
  41. package/dist/chunk-JBQMXC5I.cjs +1 -0
  42. package/dist/chunk-JEQEF5WD.js +1 -0
  43. package/dist/chunk-JMJQCN74.js +1 -0
  44. package/dist/chunk-JYQTCICM.js +1 -0
  45. package/dist/chunk-KHO2SBNA.cjs +1 -0
  46. package/dist/chunk-KVAL5PAG.cjs +1 -0
  47. package/dist/chunk-L5RDAVVH.js +1 -0
  48. package/dist/chunk-LS6U7FAY.cjs +1 -0
  49. package/dist/chunk-NBZWMBO6.js +1 -0
  50. package/dist/chunk-NRF6LWBC.cjs +1 -0
  51. package/dist/chunk-OI5XKNZO.js +1 -0
  52. package/dist/chunk-ONZFBJVW.js +1 -0
  53. package/dist/chunk-OYTYSY7G.js +1 -0
  54. package/dist/chunk-PET42Z7W.js +1 -0
  55. package/dist/chunk-PZQ6I4JJ.cjs +1 -0
  56. package/dist/chunk-QBKAEVYG.js +1 -0
  57. package/dist/chunk-QNKGP5DY.js +1 -0
  58. package/dist/chunk-RIPKY4RU.js +1 -0
  59. package/dist/chunk-RZW35UN5.cjs +1 -0
  60. package/dist/chunk-SBFNXGTJ.js +1 -0
  61. package/dist/chunk-SBKGWRS5.js +1 -0
  62. package/dist/chunk-SIM77PU4.js +1 -0
  63. package/dist/chunk-T2T7K3KR.js +1 -0
  64. package/dist/chunk-T7PU2V7X.cjs +1 -0
  65. package/dist/chunk-UDA26MCU.cjs +1 -0
  66. package/dist/chunk-V45XJKHW.cjs +1 -0
  67. package/dist/chunk-VJDDGRIK.cjs +1 -0
  68. package/dist/chunk-W2WNBUDE.js +1 -0
  69. package/dist/chunk-WVSPXFTY.js +1 -0
  70. package/dist/chunk-XABCB3Y7.cjs +1 -0
  71. package/dist/chunk-XEDXFSGI.js +1 -0
  72. package/dist/chunk-YKPSRP5G.js +1 -0
  73. package/dist/chunk-YLA3DURS.cjs +1 -0
  74. package/dist/chunk-YWHHVDT4.js +1 -0
  75. package/dist/chunk-ZETAZZLD.cjs +1 -0
  76. package/dist/conversions/index.cjs +1 -1
  77. package/dist/conversions/index.d.ts +515 -321
  78. package/dist/conversions/index.js +1 -1
  79. package/dist/events/index.cjs +1 -1
  80. package/dist/events/index.d.ts +25 -20
  81. package/dist/events/index.js +1 -1
  82. package/dist/{extends-Bk_SBGdT.d.ts → extends-DtdRjDyU.d.ts} +63 -87
  83. package/dist/formatters/index.cjs +1 -0
  84. package/dist/formatters/index.d.ts +2106 -0
  85. package/dist/formatters/index.js +1 -0
  86. package/dist/generators/index.cjs +1 -0
  87. package/dist/{generator → generators}/index.d.ts +57 -59
  88. package/dist/generators/index.js +1 -0
  89. package/dist/{if-CvT4R7Kh.d.ts → if-ChM35c_q.d.ts} +6 -5
  90. package/dist/{is-array--YjXV-Wx.d.ts → is-array-BJeHxPM3.d.ts} +287 -542
  91. package/dist/{isPlainObject-BVhBAPHX.d.ts → isPlainObject-DGJkcFYw.d.ts} +6 -6
  92. package/dist/{never-BfayMBF9.d.ts → never-D89PbPh5.d.ts} +10 -19
  93. package/dist/next/index.cjs +1 -8
  94. package/dist/next/index.d.ts +15 -12
  95. package/dist/next/index.js +1 -8
  96. package/dist/next/server/index.cjs +1 -2
  97. package/dist/next/server/index.d.ts +1 -1
  98. package/dist/next/server/index.js +1 -2
  99. package/dist/{nils-DMz3kU7M.d.ts → nils-CO8zLHSB.d.ts} +39 -65
  100. package/dist/operations/index.cjs +1 -1
  101. package/dist/operations/index.d.ts +4 -4
  102. package/dist/operations/index.js +1 -1
  103. package/dist/or-C6qzKt2I.d.ts +82 -0
  104. package/dist/override-CL2olHE5.d.ts +59 -0
  105. package/dist/parsers/index.cjs +1 -1
  106. package/dist/parsers/index.js +1 -1
  107. package/dist/pick-BSMX6Xe2.d.ts +15 -0
  108. package/dist/predicates/index.cjs +1 -1
  109. package/dist/predicates/index.d.ts +425 -106
  110. package/dist/predicates/index.js +1 -1
  111. package/dist/prettify-3o8_Kw6b.d.ts +564 -0
  112. package/dist/promises/index.cjs +1 -0
  113. package/dist/promises/index.d.ts +107 -0
  114. package/dist/promises/index.js +1 -0
  115. package/dist/promises-LU7K00H0.d.ts +72 -0
  116. package/dist/rzl-utils.global.js +1 -4
  117. package/dist/{string-XA-til3C.d.ts → string-B1jlOnws.d.ts} +82 -121
  118. package/dist/strings/index.cjs +1 -1
  119. package/dist/strings/index.d.ts +209 -210
  120. package/dist/strings/index.js +1 -1
  121. package/dist/tailwind/index.cjs +1 -0
  122. package/dist/tailwind/index.d.ts +571 -0
  123. package/dist/tailwind/index.js +1 -0
  124. package/dist/types/index.d.ts +899 -1181
  125. package/dist/urls/index.cjs +1 -1
  126. package/dist/urls/index.d.ts +113 -108
  127. package/dist/urls/index.js +1 -1
  128. package/package.json +45 -47
  129. package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +0 -26
  130. package/dist/chunk-26W3VZIK.cjs +0 -1
  131. package/dist/chunk-2KRCHXFG.cjs +0 -2
  132. package/dist/chunk-33ZLH266.js +0 -1
  133. package/dist/chunk-4L4EJTNZ.js +0 -1
  134. package/dist/chunk-56QBKKRE.js +0 -1
  135. package/dist/chunk-5Q37AP7P.js +0 -1
  136. package/dist/chunk-5SZUSNGZ.js +0 -1
  137. package/dist/chunk-7CHFAMS2.js +0 -1
  138. package/dist/chunk-7MMJZ6HS.js +0 -1
  139. package/dist/chunk-7TC6DE3J.cjs +0 -1
  140. package/dist/chunk-7VX33E3V.js +0 -1
  141. package/dist/chunk-7YWAQOA4.cjs +0 -1
  142. package/dist/chunk-BEZPD44N.cjs +0 -1
  143. package/dist/chunk-BI263OHW.js +0 -1
  144. package/dist/chunk-CII6WWLO.cjs +0 -1
  145. package/dist/chunk-D5TYPCWU.cjs +0 -1
  146. package/dist/chunk-EEQY5QUG.js +0 -1
  147. package/dist/chunk-ELDDNERR.js +0 -1
  148. package/dist/chunk-ESJYBIYH.js +0 -1
  149. package/dist/chunk-EWYPSKKM.js +0 -1
  150. package/dist/chunk-EXCOQLWX.cjs +0 -1
  151. package/dist/chunk-FIEZKTAZ.cjs +0 -1
  152. package/dist/chunk-FWQVTMYA.cjs +0 -1
  153. package/dist/chunk-G4EWCRKS.js +0 -1
  154. package/dist/chunk-G5LXIEFO.js +0 -0
  155. package/dist/chunk-G7R5XZRM.cjs +0 -1
  156. package/dist/chunk-GGEV7LXX.cjs +0 -1
  157. package/dist/chunk-HJOZOENU.cjs +0 -1
  158. package/dist/chunk-IRDZVLNZ.cjs +0 -1
  159. package/dist/chunk-IW73G523.cjs +0 -1
  160. package/dist/chunk-IY5OZAB3.cjs +0 -1
  161. package/dist/chunk-J4NCYYGS.js +0 -1
  162. package/dist/chunk-J7JAZAJD.js +0 -1
  163. package/dist/chunk-JYNSO7ZY.js +0 -1
  164. package/dist/chunk-K3UVKYEU.js +0 -1
  165. package/dist/chunk-LQ76EDZG.js +0 -1
  166. package/dist/chunk-MMSYCIJ2.cjs +0 -1
  167. package/dist/chunk-MROH35V3.cjs +0 -1
  168. package/dist/chunk-NJSAV73S.js +0 -1
  169. package/dist/chunk-NNM7QCNB.js +0 -1
  170. package/dist/chunk-NR44SNYE.js +0 -1
  171. package/dist/chunk-NXMTWY77.js +0 -1
  172. package/dist/chunk-OZCQZO2V.cjs +0 -4
  173. package/dist/chunk-PUQXRLZH.cjs +0 -1
  174. package/dist/chunk-Q3NTKN5I.cjs +0 -1
  175. package/dist/chunk-QDNSC57Z.js +0 -4
  176. package/dist/chunk-QGXTL5ZH.js +0 -2
  177. package/dist/chunk-QSQDP7L2.cjs +0 -1
  178. package/dist/chunk-RV2VULM7.cjs +0 -1
  179. package/dist/chunk-S5M33A4O.js +0 -1
  180. package/dist/chunk-SGTHOQQ2.js +0 -1
  181. package/dist/chunk-SL3RQOWA.js +0 -1
  182. package/dist/chunk-SW6HYEW7.cjs +0 -1
  183. package/dist/chunk-SYJC7UAW.js +0 -1
  184. package/dist/chunk-SZPWZZYG.cjs +0 -1
  185. package/dist/chunk-UA4B7JBO.cjs +0 -1
  186. package/dist/chunk-UQDJF5RR.cjs +0 -1
  187. package/dist/chunk-UTQUYABU.cjs +0 -1
  188. package/dist/chunk-VPW3DRV5.js +0 -1
  189. package/dist/chunk-W32WALNU.js +0 -1
  190. package/dist/chunk-XGZ6K753.cjs +0 -1
  191. package/dist/chunk-YFTR64N5.cjs +0 -1
  192. package/dist/chunk-ZFDS7W6B.cjs +0 -1
  193. package/dist/chunk-ZQOLZE6Z.cjs +0 -1
  194. package/dist/env/index.cjs +0 -1
  195. package/dist/env/index.d.ts +0 -16
  196. package/dist/env/index.js +0 -1
  197. package/dist/formatting/index.cjs +0 -1
  198. package/dist/formatting/index.d.ts +0 -950
  199. package/dist/formatting/index.js +0 -1
  200. package/dist/generator/index.cjs +0 -1
  201. package/dist/generator/index.js +0 -1
  202. package/dist/omit-VvmIsZmX.d.ts +0 -28
  203. package/dist/prettify-C4xLcYOP.d.ts +0 -353
  204. package/dist/promise/index.cjs +0 -1
  205. package/dist/promise/index.d.ts +0 -31
  206. package/dist/promise/index.js +0 -1
  207. package/dist/stylings/index.cjs +0 -1
  208. package/dist/stylings/index.d.ts +0 -41
  209. package/dist/stylings/index.js +0 -1
  210. package/dist/type-data-DDs-u2kq.d.ts +0 -261
@@ -1,113 +1,21 @@
1
- import{I as IfExtends,E as Extends,N as Not,a as NotExtends}from'./extends-Bk_SBGdT.js';import{I as If}from'./if-CvT4R7Kh.js';import{T as Trim,I as IfNot}from'./string-XA-til3C.js';import{I as IsNever}from'./never-BfayMBF9.js';import{I as IsAny}from'./any-BmdI8UbK.js';import{P as Prettify}from'./prettify-C4xLcYOP.js';
1
+ import{O as OrArr,A as And,a as AndArr}from'./or-C6qzKt2I.js';import{E as Extends,N as Not,I as IfExtends,a as NotExtends}from'./extends-DtdRjDyU.js';import{I as If}from'./if-ChM35c_q.js';import{T as Trim,I as IfNot}from'./string-B1jlOnws.js';import{I as IsNever}from'./never-D89PbPh5.js';import{I as IsAny}from'./any-v4TsK9ES.js';import{P as Prettify}from'./prettify-3o8_Kw6b.js';
2
2
  /** -------------------------------------------------------
3
- * * ***And.***
3
+ * * ***Utility Type: `IsStringLiteral`.***
4
4
  * -------------------------------------------------------
5
- * Performs a **logical AND** operation between two boolean types.
6
- * - Returns `true` if **both** conditions extend `true`.
7
- * - Returns `false` otherwise.
8
- *
9
- * @template Condition1 - The first condition.
10
- * @template Condition2 - The second condition.
11
- * @example
12
- * ```ts
13
- * type Case1 = And<true, true>;
14
- * // ➔ true
15
- * type Case2 = And<false, true>;
16
- * // ➔ false
17
- * type Case3 = And<true, false>;
18
- * // ➔ false
19
- * type Case4 = And<false, false>;
20
- * // ➔ false
21
- * ```
22
- */
23
- type And<Condition1,Condition2>=IfExtends<Condition1,true,Extends<Condition2,true>>;
24
- /** -------------------------------------------------------
25
- * * ***AndArr.***
26
- * -------------------------------------------------------
27
- * Performs a **logical AND** operation across all elements in an array of boolean types.
28
- * - Returns `true` if **all elements** extend `true`.
29
- * - Returns `false` if **any element** is not `true`.
30
- *
31
- * @template Conditions - A readonly array of boolean conditions.
32
- * @example
33
- * ```ts
34
- * type Case1 = AndArr<[true, true, true]>;
35
- * // ➔ true
36
- * type Case2 = AndArr<[true, true, false]>;
37
- * // ➔ false
38
- * type Case3 = AndArr<[false, false, false]>;
39
- * // ➔ false
40
- * type Case4 = AndArr<[]>;
41
- * // ➔ true (vacuous truth)
42
- * ```
43
- */
44
- type AndArr<Conditions extends readonly unknown[]>=Extends<Conditions[number],true>;
45
- /** -------------------------------------------------------
46
- * * ***IsStringLiteral.***
47
- * -------------------------------------------------------
48
- * Returns a boolean whether the passed argument is literal string
49
- *
5
+ * **Returns a boolean whether the passed argument is literal string.**
50
6
  * @template T - The type value to check.
51
7
  * @example
52
8
  * type Case1 = IsStringLiteral<'a'>; // ➔ true
53
9
  * type Case2 = IsStringLiteral<1>; // ➔ false
54
10
  * type Case3 = IsStringLiteral<string>; // ➔ false
55
11
  */
56
- type IsStringLiteral<T>=If<Extends<T,string>,Extends<string,T>extends true?false:true,false>;
12
+ type IsStringLiteral<T>=If<Extends<T,string>,Extends<string,T>extends true?false:true>;
57
13
  /** -------------------------------------------------------
58
- * * ***Or.***
14
+ * * ***Utility Type: `Push`.***
59
15
  * -------------------------------------------------------
60
- *
61
- * Computes the logical OR of two type-level boolean conditions.
62
- *
63
- * @template Condition1 - First boolean condition.
64
- * @template Condition2 - Second boolean condition.
65
- *
66
- * @example
67
- * ```ts
68
- * type Case1 = Or<true, true>; // true
69
- * type Case2 = Or<false, true>; // true
70
- * type Case3 = Or<false, false>; // false
71
- * type Case4 = Or<true, false>; // true
72
- * ```
73
- *
74
- * @remarks
75
- * - Uses {@link IfExtends} to determine if either condition is `true`.
76
- * - Returns `true` if at least one of the two conditions is `true`.
77
- * - Returns `false` only if both are `false`.
78
- */
79
- type Or<Condition1,Condition2>=IfExtends<Condition1,true,true,IfExtends<Condition2,true>>;
80
- /** -------------------------------------------------------
81
- * * ***OrArr.***
82
- * -------------------------------------------------------
83
- *
84
- * Computes the logical OR of all elements inside a tuple or array of boolean types.
85
- *
86
- * @template Conditions - An array of boolean type elements.
87
- *
88
- * @example
89
- * ```ts
90
- * type Case1 = OrArr<[true, true, true]>; // true
91
- * type Case2 = OrArr<[true, true, false]>; // true
92
- * type Case3 = OrArr<[false, false, false]>; // false
93
- * type Case4 = OrArr<[]>; // false
94
- * ```
95
- *
96
- * @remarks
97
- * - Uses TypeScript's indexed access types and conditional type inference.
98
- * - Returns `true` if at least one element in the array is `true`.
99
- * - Returns `false` if all elements are `false` or array is empty.
100
- */
101
- type OrArr<Conditions extends readonly unknown[]>=true extends Conditions[number]?true:false;
102
- /** -------------------------------------------------------
103
- * * ***Push.***
104
- * -------------------------------------------------------
105
- *
106
- * Appends a type `U` to the end of a tuple or readonly array type `T`.
107
- *
108
- * @template T - The tuple or readonly array type to append to.
16
+ * **Appends a type `U` to the end of a tuple or readonly array type `T`.**
17
+ * @template T - The tuple or readonly array type to append U.
109
18
  * @template U - The type of the element to push.
110
- *
111
19
  * @example
112
20
  * ```ts
113
21
  * type Case1 = Push<[1, 2, 3, 4], 5>;
@@ -119,16 +27,14 @@ type OrArr<Conditions extends readonly unknown[]>=true extends Conditions[number
119
27
  */
120
28
  type Push<T extends readonly unknown[],U>=[...T,U];type _Repeat<T extends string,Count extends number,Result extends string="",Iteration extends unknown[]=[]>=Iteration["length"] extends Count?Result:_Repeat<T,Count,`${T}${Result}`,Push<Iteration,unknown>>;
121
29
  /** -------------------------------------------------------
122
- * * ***Repeat.***
30
+ * * ***Utility Type: `Repeat`.***
123
31
  * -------------------------------------------------------
124
- *
125
- * Repeats a string literal type `T` a specified number of times `Count`.
126
- * - Supports a range of `[0, 999]` due to TypeScript recursion limits.
127
- * - If `Count > 999`, it is automatically error `Type instantiation is excessively deep and possibly infinite.ts(2589)`.
128
- *
32
+ * **Repeats a string literal type `T` a specified number of times `Count`.**
33
+ * - **Behavior:**
34
+ * - Supports a range of `[0, 999]` due to TypeScript recursion limits.
35
+ * - If `Count > 999`, it is automatically to `any` because error `Type instantiation is excessively deep and possibly infinite.ts(2589)`.
129
36
  * @template T - The string literal to repeat.
130
37
  * @template Count - Number of times to repeat.
131
- *
132
38
  * @example
133
39
  * ```ts
134
40
  * type Case0 = Repeat<'x', 0>; // ➔ ''
@@ -143,48 +49,36 @@ type Push<T extends readonly unknown[],U>=[...T,U];type _Repeat<T extends string
143
49
  */
144
50
  type Repeat<T extends string,Count extends number>=_Repeat<T,Count>;
145
51
  /** -------------------------------------------------------
146
- * * ***OddDigit.***
52
+ * * ***Utility Type: `OddDigit`.***
147
53
  * -------------------------------------------------------
148
- *
149
- * A union of string literal digits considered ***odd***.
150
- *
54
+ * **A union of string literal digits considered ***odd***.**
151
55
  * - Includes: `"1" | "3" | "5" | "7" | "9"`.
152
- *
153
56
  * @example
154
- *
155
57
  * ```ts
156
58
  * type A = OddDigit; // ➔ "1" | "3" | "5" | "7" | "9"
157
59
  * ```
158
60
  */
159
61
  type OddDigit="1"|"3"|"5"|"7"|"9";
160
62
  /** -------------------------------------------------------
161
- * * ***EvenDigit.***
63
+ * * ***Utility Type: `EvenDigit`.***
162
64
  * -------------------------------------------------------
163
- *
164
- * A union of string literal digits considered ***even***.
165
- *
65
+ * **A union of string literal digits considered ***even***.**
166
66
  * - Includes: `"0" | "2" | "4" | "6" | "8"`.
167
- *
168
67
  * @example
169
- *
170
68
  * ```ts
171
69
  * type A = EvenDigit; // ➔ "0" | "2" | "4" | "6" | "8"
172
70
  * ```
173
71
  */
174
72
  type EvenDigit="0"|"2"|"4"|"6"|"8";
175
73
  /** -------------------------------------------------------
176
- * * ***Integer.***
74
+ * * ***Utility Type: `Integer`.***
177
75
  * -------------------------------------------------------
178
- *
179
- * A type-level utility that validates if `T` is an ***integer***.
180
- *
181
- * - Returns `T` if it is an integer.
182
- * - Returns `never` if `T` is a ***float*** (decimal).
183
- *
76
+ * **A type-level utility that validates if `T` is an ***integer***.**
77
+ * - **Behavior:**
78
+ * - Returns `T` if it is an integer.
79
+ * - Returns `never` if `T` is a ***float*** (decimal).
184
80
  * @template T - A number type to validate.
185
- *
186
81
  * @example
187
- *
188
82
  * ```ts
189
83
  * type A = Integer<42>; // ➔ 42
190
84
  * type B = Integer<-10>; // ➔ -10
@@ -193,51 +87,39 @@ type EvenDigit="0"|"2"|"4"|"6"|"8";
193
87
  */
194
88
  type Integer<T extends number>=`${T}`extends`${string}.${string}`?never:T;
195
89
  /** -------------------------------------------------------
196
- * * ***Float.***
90
+ * * ***Utility Type: `Float`.***
197
91
  * -------------------------------------------------------
198
- *
199
- * A type-level utility that validates if `T` is a ***float***.
200
- *
201
- * - Returns `T` if it is a float.
202
- * - Returns `never` if `T` is an ***integer***.
203
- *
92
+ * **A type-level utility that validates if `T` is a ***float***.**
93
+ * - **Behavior:**
94
+ * - Returns `T` if it is a float.
95
+ * - Returns `never` if `T` is an ***integer***.
204
96
  * @template T - A number type to validate.
205
- *
206
97
  * @example
207
- *
208
98
  * ```ts
209
- * type A = Float<3.14>; // ➔ 3.14
210
- * type B = Float<42>; // ➔ never
99
+ * type A = Float<3.14>; // ➔ 3.14
100
+ * type B = Float<42>; // ➔ never
211
101
  * ```
212
102
  */
213
103
  type Float<T extends number>=If<IsNever<Integer<T>>,T,never>;
214
104
  /** -------------------------------------------------------
215
- * * ***Negative.***
105
+ * * ***Utility Type: `Negative`.***
216
106
  * -------------------------------------------------------
217
- *
218
- * Extracts `T` if it is ***negative***, otherwise `never`.
219
- *
107
+ * **Extracts `T` if it is ***negative***, otherwise `never`.**
220
108
  * @template T - A number type to check.
221
- *
222
109
  * @example
223
- *
224
110
  * ```ts
225
- * type A = Negative<-10>; // ➔ -10
226
- * type B = Negative<5>; // ➔ never
227
- * type C = Negative<0>; // ➔ never
111
+ * type A = Negative<-10>; // ➔ -10
112
+ * type B = Negative<5>; // ➔ never
113
+ * type C = Negative<0>; // ➔ never
228
114
  * ```
229
115
  */
230
116
  type Negative<T extends number>=`${T}`extends`-${string}`?T:never;
231
117
  /** -------------------------------------------------------
232
- * * ***Positive.***
118
+ * * ***Utility Type: `Positive`.***
233
119
  * -------------------------------------------------------
234
- *
235
- * Extracts `T` if it is ***positive*** (or zero), otherwise `never`.
236
- *
120
+ * **Extracts `T` if it is ***positive*** (or zero), otherwise `never`.**
237
121
  * @template T - A number type to check.
238
- *
239
122
  * @example
240
- *
241
123
  * ```ts
242
124
  * type A = Positive<10>; // ➔ 10
243
125
  * type B = Positive<0>; // ➔ 0
@@ -246,15 +128,11 @@ type Negative<T extends number>=`${T}`extends`-${string}`?T:never;
246
128
  */
247
129
  type Positive<T extends number>=If<IsNever<Negative<T>>,T,never>;
248
130
  /** -------------------------------------------------------
249
- * * ***PositiveInteger.***
131
+ * * ***Utility Type: `PositiveInteger`.***
250
132
  * -------------------------------------------------------
251
- *
252
- * Restricts `T` to ***positive integers*** only.
253
- *
133
+ * **Restricts `T` to ***positive integers*** only.**
254
134
  * @template T - A number type.
255
- *
256
135
  * @example
257
- *
258
136
  * ```ts
259
137
  * type A = PositiveInteger<42>; // ➔ 42
260
138
  * type B = PositiveInteger<0>; // ➔ 0
@@ -264,15 +142,11 @@ type Positive<T extends number>=If<IsNever<Negative<T>>,T,never>;
264
142
  */
265
143
  type PositiveInteger<T extends number>=Positive<Integer<T>>;
266
144
  /** -------------------------------------------------------
267
- * * ***NegativeInteger.***
145
+ * * ***Utility Type: `NegativeInteger`.***
268
146
  * -------------------------------------------------------
269
- *
270
- * Restricts `T` to ***negative integers*** only.
271
- *
147
+ * **Restricts `T` to ***negative integers*** only.**
272
148
  * @template T - A number type.
273
- *
274
149
  * @example
275
- *
276
150
  * ```ts
277
151
  * type A = NegativeInteger<-42>; // ➔ -42
278
152
  * type B = NegativeInteger<5>; // ➔ never
@@ -281,15 +155,11 @@ type PositiveInteger<T extends number>=Positive<Integer<T>>;
281
155
  */
282
156
  type NegativeInteger<T extends number>=Negative<Integer<T>>;
283
157
  /** -------------------------------------------------------
284
- * * ***PositiveFloat.***
158
+ * * ***Utility Type: `PositiveFloat`.***
285
159
  * -------------------------------------------------------
286
- *
287
- * Restricts `T` to ***positive floats*** only.
288
- *
160
+ * **Restricts `T` to ***positive floats*** only.**
289
161
  * @template T - A number type.
290
- *
291
162
  * @example
292
- *
293
163
  * ```ts
294
164
  * type A = PositiveFloat<3.14>; // ➔ 3.14
295
165
  * type B = PositiveFloat<-2.5>; // ➔ never
@@ -298,15 +168,11 @@ type NegativeInteger<T extends number>=Negative<Integer<T>>;
298
168
  */
299
169
  type PositiveFloat<T extends number>=Positive<Float<T>>;
300
170
  /** -------------------------------------------------------
301
- * * ***NegativeFloat.***
171
+ * * ***Utility Type: `NegativeFloat`.***
302
172
  * -------------------------------------------------------
303
- *
304
- * Restricts `T` to ***negative floats*** only.
305
- *
173
+ * **Restricts `T` to ***negative floats*** only.**
306
174
  * @template T - A number type.
307
- *
308
175
  * @example
309
- *
310
176
  * ```ts
311
177
  * type A = NegativeFloat<-3.14>; // ➔ -3.14
312
178
  * type B = NegativeFloat<2.5>; // ➔ never
@@ -315,15 +181,11 @@ type PositiveFloat<T extends number>=Positive<Float<T>>;
315
181
  */
316
182
  type NegativeFloat<T extends number>=Negative<Float<T>>;
317
183
  /** -------------------------------------------------------
318
- * * ***Even.***
184
+ * * ***Utility Type: `Even`.***
319
185
  * -------------------------------------------------------
320
- *
321
- * A type-level utility that extracts `T` if it is an ***even integer***.
322
- *
186
+ * **A type-level utility that extracts `T` if it is an ***even integer***.**
323
187
  * @template T - A number type to check.
324
- *
325
188
  * @example
326
- *
327
189
  * ```ts
328
190
  * type A = Even<0>; // ➔ 0
329
191
  * type B = Even<4>; // ➔ 4
@@ -335,33 +197,26 @@ type NegativeFloat<T extends number>=Negative<Float<T>>;
335
197
  */
336
198
  type Even<T extends number>=IfNot<IsNever<Integer<T>>,`${T}`extends`${string}${EvenDigit}`?T:never,never>;
337
199
  /** -------------------------------------------------------
338
- * * ***Odd.***
200
+ * * ***Utility Type: `Odd`.***
339
201
  * -------------------------------------------------------
340
- *
341
- * A type-level utility that extracts `T` if it is an ***odd integer***.
342
- *
202
+ * **A type-level utility that extracts `T` if it is an ***odd integer***.**
343
203
  * @template T - A number type to check.
344
- *
345
204
  * @example
346
- *
347
205
  * ```ts
348
- * type A = Odd<0>; // ➔ never
349
- * type B = Odd<5>; // ➔ 5
350
- * type C = Odd<4>; // ➔ never
351
- * type D = Odd<23>; // ➔ 23
352
- * type E = Odd<26>; // ➔ never
353
- * type F = Odd<4.2>; // ➔ never
206
+ * type A = Odd<0>; // ➔ never
207
+ * type B = Odd<5>; // ➔ 5
208
+ * type C = Odd<4>; // ➔ never
209
+ * type D = Odd<23>; // ➔ 23
210
+ * type E = Odd<26>; // ➔ never
211
+ * type F = Odd<4.2>; // ➔ never
354
212
  * ```
355
213
  */
356
214
  type Odd<T extends number>=IfNot<IsNever<Integer<T>>,If<IsNever<Even<T>>,T,never>,never>;
357
215
  /** -------------------------------------------------------
358
- * * ***IsInteger.***
216
+ * * ***Utility Type: `IsInteger`.***
359
217
  * -------------------------------------------------------
360
- *
361
- * Whether `T` is an ***integer***.
362
- *
218
+ * **Whether `T` is an ***integer***.**
363
219
  * @example
364
- *
365
220
  * ```ts
366
221
  * type A = IsInteger<-2>; // ➔ true
367
222
  * type B = IsInteger<0>; // ➔ true
@@ -371,13 +226,10 @@ type Odd<T extends number>=IfNot<IsNever<Integer<T>>,If<IsNever<Even<T>>,T,never
371
226
  */
372
227
  type IsInteger<T extends number>=Not<IsNever<Integer<T>>>;
373
228
  /** -------------------------------------------------------
374
- * * ***IsFloat.***
229
+ * * ***Utility Type: `IsFloat`.***
375
230
  * -------------------------------------------------------
376
- *
377
- * Whether `T` is a ***float***.
378
- *
231
+ * **Whether `T` is a ***float***.**
379
232
  * @example
380
- *
381
233
  * ```ts
382
234
  * type A = IsFloat<3.14>; // ➔ true
383
235
  * type B = IsFloat<-3.14>; // ➔ true
@@ -388,13 +240,10 @@ type IsInteger<T extends number>=Not<IsNever<Integer<T>>>;
388
240
  */
389
241
  type IsFloat<T extends number>=Not<IsNever<Float<T>>>;
390
242
  /** -------------------------------------------------------
391
- * * ***IsEven.***
243
+ * * ***Utility Type: `IsEven`.***
392
244
  * -------------------------------------------------------
393
- *
394
- * Whether `T` is ***even***.
395
- *
245
+ * **Whether `T` is ***even***.**
396
246
  * @example
397
- *
398
247
  * ```ts
399
248
  * type A = IsEven<0>; // ➔ true
400
249
  * type B = IsEven<4>; // ➔ true
@@ -406,13 +255,10 @@ type IsFloat<T extends number>=Not<IsNever<Float<T>>>;
406
255
  */
407
256
  type IsEven<T extends number>=If<IsInteger<T>,`${T}`extends`${string}${EvenDigit}`?true:false>;
408
257
  /** -------------------------------------------------------
409
- * * ***IsOdd.***
258
+ * * ***Utility Type: `IsOdd`.***
410
259
  * -------------------------------------------------------
411
- *
412
- * Whether `T` is ***odd***.
413
- *
260
+ * **Whether `T` is ***odd***.**
414
261
  * @example
415
- *
416
262
  * ```ts
417
263
  * type A = IsEven<0>; // ➔ false
418
264
  * type B = IsEven<4>; // ➔ false
@@ -424,47 +270,38 @@ type IsEven<T extends number>=If<IsInteger<T>,`${T}`extends`${string}${EvenDigit
424
270
  */
425
271
  type IsOdd<T extends number>=If<IsInteger<T>,Not<IsEven<T>>>;
426
272
  /** -------------------------------------------------------
427
- * * ***IsPositive.***
273
+ * * ***Utility Type: `IsPositive`.***
428
274
  * -------------------------------------------------------
429
- *
430
- * Whether `T` is ***positive***.
431
- *
275
+ * **Whether `T` is ***positive***.**
432
276
  * @example
433
- *
434
277
  * ```ts
435
- * type A = IsPositive<10>; // ➔ true
436
- * type B = IsPositive<0>; // ➔ true
437
- * type C = IsPositive<-5>; // ➔ false
438
- * type D = IsPositive<3.5>; // ➔ true
439
- * type E = IsPositive<-3.5>; // ➔ false
278
+ * type A = IsPositive<10>; // ➔ true
279
+ * type B = IsPositive<0>; // ➔ true
280
+ * type C = IsPositive<-5>; // ➔ false
281
+ * type D = IsPositive<3.5>; // ➔ true
282
+ * type E = IsPositive<-3.5>; // ➔ false
440
283
  * ```
441
284
  */
442
285
  type IsPositive<T extends number>=Not<IsNever<Positive<T>>>;
443
286
  /** -------------------------------------------------------
444
- * * ***IsNegative.***
287
+ * * ***Utility Type: `IsNegative`.***
445
288
  * -------------------------------------------------------
446
- *
447
- * Whether `T` is ***negative***.
448
- *
289
+ * **Whether `T` is ***negative***.**
449
290
  * @example
450
- *
451
291
  * ```ts
452
- * type A = IsNegative<-10>; // ➔ true
453
- * type B = IsNegative<5>; // ➔ false
454
- * type C = IsNegative<0>; // ➔ false
455
- * type D = IsPositive<3.5>; // ➔ false
456
- * type E = IsPositive<-3.5>; // ➔ true
292
+ * type A = IsNegative<-10>; // ➔ true
293
+ * type B = IsNegative<5>; // ➔ false
294
+ * type C = IsNegative<0>; // ➔ false
295
+ * type D = IsPositive<3.5>; // ➔ false
296
+ * type E = IsPositive<-3.5>; // ➔ true
457
297
  * ```
458
298
  */
459
299
  type IsNegative<T extends number>=Not<IsNever<Negative<T>>>;
460
300
  /** -------------------------------------------------------
461
- * * ***IsPositiveInteger.***
301
+ * * ***Utility Type: `IsPositiveInteger`.***
462
302
  * -------------------------------------------------------
463
- *
464
- * Whether `T` is a ***positive integer***.
465
- *
303
+ * **Whether `T` is a ***positive integer***.**
466
304
  * @example
467
- *
468
305
  * ```ts
469
306
  * type A = IsPositiveInteger<42>; // ➔ true
470
307
  * type B = IsPositiveInteger<0>; // ➔ true
@@ -474,13 +311,10 @@ type IsNegative<T extends number>=Not<IsNever<Negative<T>>>;
474
311
  */
475
312
  type IsPositiveInteger<T extends number>=Not<IsNever<PositiveInteger<T>>>;
476
313
  /** -------------------------------------------------------
477
- * * ***IsNegativeInteger.***
314
+ * * ***Utility Type: `IsNegativeInteger`.***
478
315
  * -------------------------------------------------------
479
- *
480
- * Whether `T` is a ***negative integer***.
481
- *
316
+ * **Whether `T` is a ***negative integer***.**
482
317
  * @example
483
- *
484
318
  * ```ts
485
319
  * type A = IsNegativeInteger<-42>; // ➔ true
486
320
  * type B = IsNegativeInteger<5>; // ➔ false
@@ -489,13 +323,10 @@ type IsPositiveInteger<T extends number>=Not<IsNever<PositiveInteger<T>>>;
489
323
  */
490
324
  type IsNegativeInteger<T extends number>=Not<IsNever<NegativeInteger<T>>>;
491
325
  /** -------------------------------------------------------
492
- * * ***IsPositiveFloat.***
326
+ * * ***Utility Type: `IsPositiveFloat`.***
493
327
  * -------------------------------------------------------
494
- *
495
- * Whether `T` is a ***positive float***.
496
- *
328
+ * **Whether `T` is a ***positive float***.**
497
329
  * @example
498
- *
499
330
  * ```ts
500
331
  * type A = IsPositiveFloat<3.14>; // ➔ true
501
332
  * type B = IsPositiveFloat<-2.5>; // ➔ false
@@ -504,13 +335,10 @@ type IsNegativeInteger<T extends number>=Not<IsNever<NegativeInteger<T>>>;
504
335
  */
505
336
  type IsPositiveFloat<T extends number>=Not<IsNever<PositiveFloat<T>>>;
506
337
  /** -------------------------------------------------------
507
- * * ***IsNegativeFloat.***
338
+ * * ***Utility Type: `IsNegativeFloat`.***
508
339
  * -------------------------------------------------------
509
- *
510
- * Whether `T` is a ***negative float***.
511
- *
340
+ * **Whether `T` is a ***negative float***.**
512
341
  * @example
513
- *
514
342
  * ```ts
515
343
  * type A = IsNegativeFloat<-3.14>; // ➔ true
516
344
  * type B = IsNegativeFloat<2.5>; // ➔ false
@@ -519,228 +347,187 @@ type IsPositiveFloat<T extends number>=Not<IsNever<PositiveFloat<T>>>;
519
347
  */
520
348
  type IsNegativeFloat<T extends number>=Not<IsNever<NegativeFloat<T>>>;
521
349
  /** -------------------------------------------------------
522
- * * ***IfInteger.***
350
+ * * ***Utility Type: `IfInteger`.***
523
351
  * -------------------------------------------------------
524
- *
525
- * Conditional: `If` branch if `T` is an ***integer***.
526
- *
352
+ * **Conditional: `If` branch if `T` is an ***integer***.**
527
353
  * @example
528
- *
529
354
  * ```ts
530
- * type A = IfInteger<42>; // ➔ true
531
- * type B = IfInteger<3.14>; // ➔ false
532
- * type C = IfInteger<42, "yes", "no">; // ➔ "yes"
533
- * type D = IfInteger<3.14, "yes", "no">; // ➔ "no"
355
+ * type A = IfInteger<42>; // ➔ true
356
+ * type B = IfInteger<3.14>; // ➔ false
357
+ * type C = IfInteger<42, "yes", "no">; // ➔ "yes"
358
+ * type D = IfInteger<3.14, "yes", "no">; // ➔ "no"
534
359
  * ```
535
360
  */
536
361
  type IfInteger<T extends number,IfTrue=true,IfFalse=false>=If<IsInteger<T>,IfTrue,IfFalse>;
537
362
  /** -------------------------------------------------------
538
- * * ***IfFloat.***
363
+ * * ***Utility Type: `IfFloat`.***
539
364
  * -------------------------------------------------------
540
- *
541
- * Conditional: selects one of two branches depending on whether `T` is a ***float***.
542
- *
365
+ * **Conditional: selects one of two branches depending on whether `T` is a ***float***.**
543
366
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
544
- *
545
367
  * @template T - A number type.
546
- * @template IfTrue - The branch type if condition is met. (default: `true`)
547
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
548
- *
368
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
369
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
549
370
  * @example
550
- *
551
371
  * ```ts
552
- * type A = IfFloat<3.14>; // ➔ true
553
- * type B = IfFloat<42>; // ➔ false
554
- * type C = IfFloat<3.14, "yes", "no">; // ➔ "yes"
555
- * type D = IfFloat<42, "yes", "no">; // ➔ "no"
372
+ * type A = IfFloat<3.14>; // ➔ true
373
+ * type B = IfFloat<42>; // ➔ false
374
+ * type C = IfFloat<3.14, "yes", "no">; // ➔ "yes"
375
+ * type D = IfFloat<42, "yes", "no">; // ➔ "no"
556
376
  * ```
557
377
  */
558
378
  type IfFloat<T extends number,IfTrue=true,IfFalse=false>=If<IsFloat<T>,IfTrue,IfFalse>;
559
379
  /** -------------------------------------------------------
560
- * * ***IfEven.***
380
+ * * ***Utility Type: `IfEven`.***
561
381
  * -------------------------------------------------------
562
- *
563
- * Conditional: selects one of two branches depending on whether `T` is ***even***.
564
- *
382
+ * **Conditional: selects one of two branches depending on whether `T` is ***even***.**
565
383
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
566
- *
567
384
  * @template T - A number type.
568
- * @template IfTrue - The branch type if condition is met. (default: `true`)
569
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
570
- *
385
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
386
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
571
387
  * @example
572
- *
573
388
  * ```ts
574
- * type A = IfEven<4>; // ➔ true
575
- * type B = IfEven<5>; // ➔ false
576
- * type C = IfEven<4, "even", "odd">; // ➔ "even"
577
- * type D = IfEven<5, "even", "odd">; // ➔ "odd"
389
+ * type A = IfEven<4>; // ➔ true
390
+ * type B = IfEven<5>; // ➔ false
391
+ * type C = IfEven<4, "even", "odd">; // ➔ "even"
392
+ * type D = IfEven<5, "even", "odd">; // ➔ "odd"
578
393
  * ```
579
394
  */
580
395
  type IfEven<T extends number,IfTrue=true,IfFalse=false>=If<IsEven<T>,IfTrue,IfFalse>;
581
396
  /** -------------------------------------------------------
582
- * * ***IfOdd.***
397
+ * * ***Utility Type: `IfOdd`.***
583
398
  * -------------------------------------------------------
584
- *
585
- * Conditional: selects one of two branches depending on whether `T` is ***odd***.
586
- *
399
+ * **Conditional: selects one of two branches depending on whether `T` is ***odd***.**
587
400
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
588
- *
589
401
  * @template T - A number type.
590
- * @template IfTrue - The branch type if condition is met. (default: `true`)
591
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
592
- *
402
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
403
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
593
404
  * @example
594
- *
595
405
  * ```ts
596
- * type A = IfOdd<5>; // ➔ true
597
- * type B = IfOdd<4>; // ➔ false
598
- * type C = IfOdd<5, "odd", "even">; // ➔ "odd"
599
- * type D = IfOdd<4, "odd", "even">; // ➔ "even"
406
+ * type A = IfOdd<5>; // ➔ true
407
+ * type B = IfOdd<4>; // ➔ false
408
+ * type C = IfOdd<5, "odd", "even">; // ➔ "odd"
409
+ * type D = IfOdd<4, "odd", "even">; // ➔ "even"
600
410
  * ```
601
411
  */
602
412
  type IfOdd<T extends number,IfTrue=true,IfFalse=false>=If<IsOdd<T>,IfTrue,IfFalse>;
603
413
  /** -------------------------------------------------------
604
- * * ***IfPositive.***
414
+ * * ***Utility Type: `IfPositive`.***
605
415
  * -------------------------------------------------------
606
- *
607
- * Conditional: selects one of two branches depending on whether `T` is ***positive***.
608
- *
416
+ * **Conditional: selects one of two branches depending on whether `T` is ***positive***.**
609
417
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
610
- *
611
418
  * @template T - A number type.
612
- * @template IfTrue - The branch type if condition is met. (default: `true`)
613
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
614
- *
419
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
420
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
615
421
  * @example
616
- *
617
422
  * ```ts
618
- * type A = IfPositive<10>; // ➔ true
619
- * type B = IfPositive<-5>; // ➔ false
620
- * type C = IfPositive<10, "yes", "no">; // ➔ "yes"
621
- * type D = IfPositive<-5, "yes", "no">; // ➔ "no"
423
+ * type A = IfPositive<10>; // ➔ true
424
+ * type B = IfPositive<-5>; // ➔ false
425
+ * type C = IfPositive<10, "yes", "no">; // ➔ "yes"
426
+ * type D = IfPositive<-5, "yes", "no">; // ➔ "no"
622
427
  * ```
623
428
  */
624
429
  type IfPositive<T extends number,IfTrue=true,IfFalse=false>=If<IsPositive<T>,IfTrue,IfFalse>;
625
430
  /** -------------------------------------------------------
626
- * * ***IfNegative.***
431
+ * * ***Utility Type: `IfNegative`.***
627
432
  * -------------------------------------------------------
628
- *
629
- * Conditional: selects one of two branches depending on whether `T` is ***negative***.
630
- *
433
+ * **Conditional: selects one of two branches depending on whether `T` is ***negative***.**
631
434
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
632
- *
633
435
  * @template T - A number type.
634
- * @template IfTrue - The branch type if condition is met. (default: `true`)
635
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
636
- *
436
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
437
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
637
438
  * @example
638
- *
639
439
  * ```ts
640
- * type A = IfNegative<-10>; // ➔ true
641
- * type B = IfNegative<5>; // ➔ false
642
- * type C = IfNegative<-10, "yes", "no">; // ➔ "yes"
643
- * type D = IfNegative<5, "yes", "no">; // ➔ "no"
440
+ * type A = IfNegative<-10>; // ➔ true
441
+ * type B = IfNegative<5>; // ➔ false
442
+ * type C = IfNegative<-10, "yes", "no">; // ➔ "yes"
443
+ * type D = IfNegative<5, "yes", "no">; // ➔ "no"
644
444
  * ```
645
445
  */
646
446
  type IfNegative<T extends number,IfTrue=true,IfFalse=false>=If<IsNegative<T>,IfTrue,IfFalse>;
647
447
  /** -------------------------------------------------------
648
- * * ***IfPositiveInteger.***
448
+ * * ***Utility Type: `IfPositiveInteger`.***
649
449
  * -------------------------------------------------------
650
- *
651
- * Conditional: selects one of two branches depending on whether `T` is a ***positive integer***.
652
- *
450
+ * **Conditional: selects one of two branches depending on whether `T` is a ***positive integer***.**
653
451
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
654
- *
655
452
  * @template T - A number type.
656
- * @template IfTrue - The branch type if condition is met. (default: `true`)
657
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
658
- *
453
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
454
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
659
455
  * @example
660
- *
661
456
  * ```ts
662
- * type A = IfPositiveInteger<42>; // ➔ true
663
- * type B = IfPositiveInteger<-5>; // ➔ false
664
- * type C = IfPositiveInteger<42, "yes", "no">; // ➔ "yes"
665
- * type D = IfPositiveInteger<-5, "yes", "no">; // ➔ "no"
457
+ * type A = IfPositiveInteger<42>; // ➔ true
458
+ * type B = IfPositiveInteger<-5>; // ➔ false
459
+ * type C = IfPositiveInteger<42, "yes", "no">; // ➔ "yes"
460
+ * type D = IfPositiveInteger<-5, "yes", "no">; // ➔ "no"
666
461
  * ```
667
462
  */
668
463
  type IfPositiveInteger<T extends number,IfTrue=true,IfFalse=false>=If<IsPositiveInteger<T>,IfTrue,IfFalse>;
669
464
  /** -------------------------------------------------------
670
- * * ***IfNegativeInteger.***
465
+ * * ***Utility Type: `IfNegativeInteger`.***
671
466
  * -------------------------------------------------------
672
- *
673
- * Conditional: selects one of two branches depending on whether `T` is a ***negative integer***.
674
- *
467
+ * **Conditional: selects one of two branches depending on whether `T` is a ***negative integer***.**
675
468
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
676
- *
677
469
  * @template T - A number type.
678
- * @template IfTrue - The branch type if condition is met. (default: `true`)
679
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
680
- *
470
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
471
+ * @template IfFalse - The branch type if condition is not met, (default: `false`) .
681
472
  * @example
682
- *
683
473
  * ```ts
684
- * type A = IfNegativeInteger<-42>; // ➔ true
685
- * type B = IfNegativeInteger<5>; // ➔ false
686
- * type C = IfNegativeInteger<-42, "yes", "no">; // ➔ "yes"
687
- * type D = IfNegativeInteger<5, "yes", "no">; // ➔ "no"
474
+ * type A = IfNegativeInteger<-42>; // ➔ true
475
+ * type B = IfNegativeInteger<5>; // ➔ false
476
+ * type C = IfNegativeInteger<-42, "yes", "no">; // ➔ "yes"
477
+ * type D = IfNegativeInteger<5, "yes", "no">; // ➔ "no"
688
478
  * ```
689
479
  */
690
480
  type IfNegativeInteger<T extends number,IfTrue=true,IfFalse=false>=If<IsNegativeInteger<T>,IfTrue,IfFalse>;
691
481
  /** -------------------------------------------------------
692
- * * ***IfPositiveFloat.***
482
+ * * ***Utility Type: `IfPositiveFloat`.***
693
483
  * -------------------------------------------------------
694
- *
695
- * Conditional: selects one of two branches depending on whether `T` is a ***positive float***.
696
- *
484
+ * **Conditional: selects one of two branches depending on whether `T` is a ***positive float***.**
697
485
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
698
- *
699
486
  * @template T - A number type.
700
- * @template IfTrue - The branch type if condition is met. (default: `true`)
701
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
702
- *
487
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
488
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
703
489
  * @example
704
- *
705
490
  * ```ts
706
- * type A = IfPositiveFloat<3.14>; // ➔ true
707
- * type B = IfPositiveFloat<-2.5>; // ➔ false
708
- * type C = IfPositiveFloat<3.14, "yes", "no">; // ➔ "yes"
709
- * type D = IfPositiveFloat<-2.5, "yes", "no">; // ➔ "no"
491
+ * type A = IfPositiveFloat<3.14>; // ➔ true
492
+ * type B = IfPositiveFloat<-2.5>; // ➔ false
493
+ * type C = IfPositiveFloat<3.14, "yes", "no">; // ➔ "yes"
494
+ * type D = IfPositiveFloat<-2.5, "yes", "no">; // ➔ "no"
710
495
  * ```
711
496
  */
712
497
  type IfPositiveFloat<T extends number,IfTrue=true,IfFalse=false>=If<IsPositiveFloat<T>,IfTrue,IfFalse>;
713
498
  /** -------------------------------------------------------
714
- * * ***IfNegativeFloat.***
499
+ * * ***Utility Type: `IfNegativeFloat`.***
715
500
  * -------------------------------------------------------
716
- * Conditional: selects one of two branches depending on whether `T` is a ***negative float***.
501
+ * **Conditional: selects one of two branches depending on whether `T` is a ***negative float***.**
717
502
  * - Defaults: `IfTrue = true`, `IfFalse = false`.
718
- *
719
503
  * @template T - A number type.
720
- * @template IfTrue - The branch type if condition is met. (default: `true`)
721
- * @template IfFalse - The branch type if condition is not met. (default: `false`)
504
+ * @template IfTrue - The branch type if condition is met, (default: `true`).
505
+ * @template IfFalse - The branch type if condition is not met, (default: `false`).
722
506
  * @example
723
507
  * ```ts
724
- * type A = IfNegativeFloat<-3.14>; // ➔ true
725
- * type B = IfNegativeFloat<2.5>; // ➔ false
726
- * type C = IfNegativeFloat<-3.14, "yes", "no">; // ➔ "yes"
727
- * type D = IfNegativeFloat<2.5, "yes", "no">; // ➔ "no"
508
+ * type A = IfNegativeFloat<-3.14>; // ➔ true
509
+ * type B = IfNegativeFloat<2.5>; // ➔ false
510
+ * type C = IfNegativeFloat<-3.14, "yes", "no">; // ➔ "yes"
511
+ * type D = IfNegativeFloat<2.5, "yes", "no">; // ➔ "no"
728
512
  * ```
729
513
  */
730
514
  type IfNegativeFloat<T extends number,IfTrue=true,IfFalse=false>=If<IsNegativeFloat<T>,IfTrue,IfFalse>;
731
515
  /** -------------------------------------------------------
732
- * * ***ParseNumber.***
516
+ * * ***Utility Type: `ParseNumber`.***
733
517
  * --------------------------------------------------------
734
- * Converts a string or property key literal into a ***number literal***.
735
- * - Supports decimal numbers only.
736
- * - Automatically trims whitespace.
737
- * - Returns the number literal if valid.
738
- * - Supports scientific notation strings (e.g., `"2e-3"`, `"-5e2"`, `"2E-3"`, `"-5E2"`).
739
- * - **Note:** TypeScript cannot represent very small (<1e-6) or very large (>1e15)
740
- * numbers as literal types. In such cases, scientific notation strings return `0`.
741
- * - Returns `0` for strings representing hexadecimal (`0x...`), octal (`0o...`), or binary (`0b...`) if they are string literals.
518
+ * **Converts a string or property key literal into a ***number literal***.**
519
+ * - **Behavior:**
520
+ * - Supports decimal numbers only.
521
+ * - Automatically trims whitespace.
522
+ * - Returns the number literal if valid.
523
+ * - Supports scientific notation strings (e.g., `"2e-3"`, `"-5e2"`, `"2E-3"`, `"-5E2"`).
524
+ * - **Note:**
525
+ * - TypeScript cannot represent very small (`< 1e-6`) or very large (`> 1e15`)
526
+ * numbers as literal types:
527
+ * - In such cases, scientific notation strings return `0`.
528
+ * - Returns `0` for strings representing hexadecimal (`0x...`), octal (`0o...`), or
529
+ * binary (`0b...`) if they are string literals.
742
530
  * - Returns `never` for non-numeric strings or unsupported formats.
743
- *
744
531
  * @template T - A string, number, or symbol (property key).
745
532
  * @example
746
533
  * ```ts
@@ -805,93 +592,79 @@ type IfNegativeFloat<T extends number,IfTrue=true,IfFalse=false>=If<IsNegativeFl
805
592
  */
806
593
  type ParseNumber<T extends PropertyKey|bigint>=T extends bigint?T:If<number extends T?false:true,IfExtends<OrArr<[ Extends<`-0`,Trim<Extract<T,PropertyKey>>>,Extends<-0,T>,Extends<T,`${"-" | ""}${"0"}.`>]>,true,0,T extends`${"-" | ""}0${"x" | "b" | "o"}${number}`?0:Trim<Extract<T,PropertyKey>>extends`${infer NumT extends number | string}`?T extends`${infer N extends number}.`?N:NumT extends string?ParseScientificNumber<NumT>:NumT:Trim<Extract<T,PropertyKey>>extends number?T:never>,never>;
807
594
  /** -------------------------------------------------------
808
- * * ***IsScientificNumber.***
809
- * -------------------------------------------------------
810
- *
811
- * Checks if a string literal `T` represents a **scientific number**.
812
- *
813
- * A scientific number is defined as a number in the form of:
814
- * - Optional negative sign (`-`)
815
- * - Mantissa (digits, can be integer or decimal)
816
- * - Exponent indicated by `e` or `E`
817
- * - Exponent value (digits, optional negative sign)
818
- *
819
- * **Important:** TypeScript cannot detect numeric literals in scientific notation
820
- * at type-level because number literals are normalized to decimals.
821
- * Only string literals like `"2.5E3"` or `"-1e-5"` can be detected.
822
- *
595
+ * * ***Utility Type: `IsScientificNumber`.***
596
+ * -------------------------------------------------------
597
+ * **Checks if a string literal `T` represents a **scientific number**.**
598
+ * - **A scientific number is defined as a number in the form of:**
599
+ * - Optional negative sign (`-`).
600
+ * - Mantissa (digits, can be integer or decimal).
601
+ * - Exponent indicated by `e` or `E`.
602
+ * - Exponent value (digits, optional negative sign).
603
+ * - **Important:**
604
+ * - TypeScript cannot detect numeric literals in scientific notation
605
+ * at type-level because number literals are normalized to decimals:
606
+ * - Only string literals like `"2.5E3"` or `"-1e-5"` can be detected.
823
607
  * @template T - A string literal to check.
824
- *
825
608
  * @example
826
609
  * ```ts
827
- * type A = IsScientificNumber<"1e5">; // true
828
- * type B = IsScientificNumber<"-1e-5">; // true
829
- * type C = IsScientificNumber<"2.5E3">; // true
830
- * type D = IsScientificNumber<"42">; // false
831
- * type E = IsScientificNumber<"-0.42">; // false
832
- * type F = IsScientificNumber<string>; // false
610
+ * type A = IsScientificNumber<"1e5">; // true
611
+ * type B = IsScientificNumber<"-1e-5">; // true
612
+ * type C = IsScientificNumber<"2.5E3">; // true
613
+ * type D = IsScientificNumber<"42">; // false
614
+ * type E = IsScientificNumber<"-0.42">; // false
615
+ * type F = IsScientificNumber<string>; // false
833
616
  * ```
834
- *
835
617
  * @remarks
836
- * - Uses template literal types and conditional type {@link Extends}.
618
+ * - Uses template literal types and conditional type {@link Extends | **`Extends`**}.
837
619
  * - Returns `true` if `T` is scientific number string literal, otherwise `false`.
838
620
  * - Returns `boolean` if `T` is generic `string`.
839
621
  */
840
622
  type IsScientificNumber<T extends string>=Extends<T,`${"-" | ""}${number}${"e" | "E"}${number}`>;
841
- /**
842
- * Helper for {@link ParseScientificNumber}
843
- */
623
+ /** * ***Helper for {@link ParseScientificNumber | **`ParseScientificNumber`**}.*** */
844
624
  type BuildTuple<L extends number,T extends unknown[]=[]>=T["length"] extends L?T:BuildTuple<L,[...T,unknown]>;
845
- /**
846
- * Helper for {@link ParseScientificNumber}
847
- */
625
+ /** * ***Helper for {@link ParseScientificNumber | **`ParseScientificNumber`**}.*** */
848
626
  type _DecrementParseScientific<N extends number>=BuildTuple<N>extends [ infer _,...infer Rest]?Rest["length"]:never;
849
627
  /** -------------------------------------------------------
850
- * * ***ParseScientificNumber***
628
+ * * ***Utility Type: `ParseScientificNumber`.***
851
629
  * -------------------------------------------------------
852
- *
853
- * Converts a numeric string in scientific notation (e.g., `"2e-3"`, `"-5e2"`)
854
- * into a literal number type.
855
- *
856
- * **Important:** TypeScript cannot represent very small or very large numbers
857
- * as literal types. In such cases, this utility will return `0`.
858
- *
630
+ * **Converts a numeric string in scientific notation (e.g., `"2e-3"`, `"-5e2"`)
631
+ * into a literal number type.**
632
+ * - **Important:**
633
+ * - TypeScript cannot represent very small or very large numbers
634
+ * as literal types:
635
+ * - In such cases, this utility will return `0`.
859
636
  * @template T - A numeric string to parse. Can be in:
860
- * - Positive or negative scientific notation (e.g., `"1e3"`, `"-2e-2"`)
861
- * - Regular number literal (e.g., `"42"`, `"-5"`)
862
- *
637
+ * - Positive or negative scientific notation (e.g., `"1e3"`, `"-2e-2"`).
638
+ * - Regular number literal (e.g., `"42"`, `"-5"`).
863
639
  * @example
864
640
  * ```ts
865
- * type A1 = ParseScientificNumber<"2e-3">; // 0.002
866
- * type A2 = ParseScientificNumber<"-2e-3">; // -0.002
867
- * type A3 = ParseScientificNumber<"5e2">; // 500
868
- * type A4 = ParseScientificNumber<"-5e2">; // -500
869
- * type A5 = ParseScientificNumber<"2e-7">; // 0 (TypeScript cannot represent literal)
870
- * type A6 = ParseScientificNumber<"5e21">; // 0 (TypeScript cannot represent literal)
871
- * type A7 = ParseScientificNumber<"42">; // 42
872
- * type A8 = ParseScientificNumber<"-42">; // -42
641
+ * type A1 = ParseScientificNumber<"2e-3">; // 0.002
642
+ * type A2 = ParseScientificNumber<"-2e-3">; // -0.002
643
+ * type A3 = ParseScientificNumber<"5e2">; // 500
644
+ * type A4 = ParseScientificNumber<"-5e2">; // -500
645
+ * type A5 = ParseScientificNumber<"2e-7">; // 0 (TypeScript cannot represent literal)
646
+ * type A6 = ParseScientificNumber<"5e21">; // 0 (TypeScript cannot represent literal)
647
+ * type A7 = ParseScientificNumber<"42">; // 42
648
+ * type A8 = ParseScientificNumber<"-42">; // -42
873
649
  * ```
874
- *
875
650
  * @remarks
876
651
  * - Uses type-level string manipulation to handle scientific notation.
877
- * - Negative exponents are adjusted with {@link _DecrementParseScientific} and {@link Repeat}.
652
+ * - Negative exponents are adjusted with {@link _DecrementParseScientific | **`_DecrementParseScientific`**} and
653
+ * {@link Repeat | **`Repeat`**}.
878
654
  * - Returns `0` if TypeScript cannot infer the exact numeric literal.
879
655
  */
880
656
  type ParseScientificNumber<T extends string>=T extends`-${infer Mantissa}${"e" | "E"}-${infer Exp extends number}`?`-${"0."}${Repeat<"0", _DecrementParseScientific<Exp>>}${Mantissa}`extends`${infer N extends number}`?number extends N?0:N:never:T extends`${infer Mantissa}${"e" | "E"}-${infer Exp extends number}`?`0.${Repeat<"0", _DecrementParseScientific<Exp>>}${Mantissa}`extends`${infer N extends number}`?number extends N?0:N:never:T extends`-${infer Mantissa}${"e" | "E"}${infer Exp extends number}`?`-${Mantissa}${Repeat<"0", Exp>}`extends`${infer N extends number}`?number extends N?0:N:never:T extends`${infer Mantissa}${"e" | "E"}${infer Exp extends number}`?`${Mantissa}${Repeat<"0", Exp>}`extends`${infer N extends number}`?number extends N?0:N:never:T extends`${infer N extends number}`?number extends N?0:N:never;
881
657
  /** -------------------------------------------------------
882
- * * ***Abs.***
658
+ * * ***Utility Type: `Abs`.***
883
659
  * -------------------------------------------------------
884
- *
885
- * Computes the ***absolute value*** of `T`.
886
- *
887
- * - Accepts `number` literals or numeric `string` literals.
888
- * - Returns the ***absolute value*** as a `number`.
889
- * - If `T` is not a valid number (e.g., hex, binary, octal, or non-numeric string), the result is `never`.
890
- *
660
+ * **Computes the ***absolute value*** of `T`.**
661
+ * - **Behavior:**
662
+ * - Accepts `number` literals or numeric `string` literals.
663
+ * - Returns the ***absolute value*** as a `number`.
664
+ * - If `T` is not a valid number, ***`like`***:
665
+ * - `hex`, `binary`, `octal`, or `non-numeric string` will return `never`.
891
666
  * @template T - A number type or string literal representing a number.
892
- *
893
667
  * @example
894
- *
895
668
  * ```ts
896
669
  * type A = Abs<-42>; // ➔ 42
897
670
  * type B = Abs<10>; // ➔ 10
@@ -909,19 +682,16 @@ type ParseScientificNumber<T extends string>=T extends`-${infer Mantissa}${"e" |
909
682
  */
910
683
  type Abs<T extends PropertyKey|bigint>=`${Exclude<T, symbol>}`extends`-${infer PositiveT extends number}`?ParseNumber<PositiveT>:ParseNumber<T>;
911
684
  /** -------------------------------------------------------
912
- * * ***Negate.***
685
+ * * ***Utility Type: `Negate`.***
913
686
  * -------------------------------------------------------
914
- *
915
- * Produces the ***negated value*** of `T` (multiplies by `-1`).
916
- *
917
- * - Only supports valid **number literals** or **numeric-strings**.
918
- * - Invalid numeric-strings (e.g. `"1a"`, `"abc"`, hex, binary, octal)
919
- * or non-numeric types (e.g. `string`, `number`, `symbol`) will return `0`.
920
- *
687
+ * **Produces the ***negated value*** of `T` (multiplies by `-1`).**
688
+ * - **Behavior:**
689
+ * - Only supports valid **number literals** or **numeric-strings**.
690
+ * - Invalid numeric-strings (***like***: `"1a"`, `"abc"`, `hex`, `binary`, `octal`)
691
+ * or `non-numeric` types, ***`like`***:
692
+ * - `string`, `number`, `symbol` will return `0`.
921
693
  * @template T - A number type or numeric-string.
922
- *
923
694
  * @example
924
- *
925
695
  * ```ts
926
696
  * type A = Negate<5>; // ➔ -5
927
697
  * type B = Negate<-10>; // ➔ -10
@@ -942,56 +712,54 @@ type Abs<T extends PropertyKey|bigint>=`${Exclude<T, symbol>}`extends`-${infer P
942
712
  */
943
713
  type Negate<T extends PropertyKey>=ParseNumber<`-${Abs<ParseNumber<T>>}`>;
944
714
  /** -------------------------------------------------------
945
- * * ***Split***
715
+ * * ***Utility Type: `Split`***
946
716
  * -------------------------------------------------------
947
- *
948
- * A type-level utility that mimics `String.prototype.split()`.
717
+ * **A type-level utility that mimics `String.prototype.split()`.**
718
+ * @description
949
719
  * Splits a string literal `Str` into a tuple of substrings,
950
720
  * using `Del` as the delimiter.
951
- *
952
- * - If `Del` is the empty string `""`, the result is a tuple of characters.
953
- * - If `Del` is not found in `Str`, the result is a tuple with the original string.
954
- * - Works only with string literals. If `Str` is just `string`, the result is `string[]`.
955
- *
721
+ * - **Behavior:**
722
+ * - If `Del` is the empty string `""`, the result is a tuple of characters.
723
+ * - If `Del` is not found in `Str`, the result is a tuple with the original string.
724
+ * - Works only with string literals. If `Str` is just `string`, the result is `string[]`.
956
725
  * @template Str - The input string literal to be split.
957
726
  * @template Del - The delimiter used to split the string.
958
727
  * Defaults to `""` (character-level split).
959
- *
960
- * #### Constraints
728
+ * @constraints
961
729
  * - `Str` must be a string literal to get precise results.
962
730
  * - `Del` can be a string or number (numbers are converted to strings).
963
- *
964
- * #### Examples
731
+ * @example
965
732
  * ```ts
966
733
  * // ✅ Split into characters
967
- * type A = Split<"abc">; // ["a", "b", "c"]
734
+ * type A = Split<"abc">; // ["a", "b", "c"]
968
735
  *
969
736
  * // ✅ Split by a comma
970
- * type B = Split<"a,b,c", ",">; // ["a", "b", "c"]
737
+ * type B = Split<"a,b,c", ",">; // ["a", "b", "c"]
971
738
  *
972
739
  * // ✅ Split by multi-char delimiter
973
- * type C = Split<"2025-08-22", "-">; // ["2025", "08", "22"]
740
+ * type C = Split<"2025-08-22", "-">; // ["2025", "08", "22"]
974
741
  *
975
- * // ✅ Delimiter not found returns whole string
976
- * type D = Split<"hello", "|">; // ["hello"]
742
+ * // ✅ Delimiter not found returns whole string
743
+ * type D = Split<"hello", "|">; // ["hello"]
977
744
  *
978
745
  * // ⚠️ Non-literal string
979
- * type E = Split<string, ",">; // string[]
746
+ * type E = Split<string, ",">; // string[]
980
747
  * ```
981
748
  */
982
- type Split<Str extends string,Del extends string|number="">=string extends Str?string[]:""extends Str?[]:Str extends`${infer T}${Del}${infer U}`?[T,...Split<U,Del>]:[Str];type _CharAt<I extends string,N extends number|`${number}`,_S extends string[]=Split<I,"">>=IfExtends<And<Extends<IsPositive<ParseNumber<N>>,true>,Extends<And<Extends<N,keyof _S>,Extends<IsStringLiteral<I>,true>>,true>>,true,_S[Extract<N,keyof _S>],undefined>;
749
+ type Split<Str extends string,Del extends string|number="">=string extends Str?string[]:""extends Str?[]:Str extends`${infer T}${Del}${infer U}`?[T,...Split<U,Del>]:[Str];
750
+ /** @private ***types for {@link CharAt}.*** */
751
+ type _CharAt<I extends string,N extends number|`${number}`,_S extends string[]=Split<I,"">>=IfExtends<And<Extends<IsPositive<ParseNumber<N>>,true>,Extends<And<Extends<N,keyof _S>,Extends<IsStringLiteral<I>,true>>,true>>,true,_S[Extract<N,keyof _S>],undefined>;
983
752
  /** -------------------------------------------------------
984
- * * ***CharAt.***
753
+ * * ***Utility Type: `CharAt`.***
985
754
  * -------------------------------------------------------
986
- * A type-level utility that extracts the character at a given index `N`
987
- * from a string literal type `I`.
988
- * - If the index is out of range, the result is `undefined`.
989
- * - If `I` is not a literal string (just `string`), the result is `undefined`.
990
- * - Only **positive indices** are supported (`0` and above`).
991
- *
755
+ * **A type-level utility that extracts the character at a given index `N`
756
+ * from a string literal type `I`.**
757
+ * - **Behavior:**
758
+ * - If the index is out of range, the result is `undefined`.
759
+ * - If `I` is not a literal string (just `string`), the result is `undefined`.
760
+ * - Only **positive indices** are supported (`0` and above`).
992
761
  * @template I - The input string literal to extract the character from.
993
762
  * @template N - The zero-based index of the character to retrieve.
994
- * Can be a `number` or a stringified number (e.g. `2` or "2").
995
763
  * @example
996
764
  * ```ts
997
765
  * // ✅ Basic usage
@@ -999,7 +767,7 @@ type Split<Str extends string,Del extends string|number="">=string extends Str?s
999
767
  * type B = CharAt<"hello", 1>; // ➔ "e"
1000
768
  * type C = CharAt<"hello", 4>; // ➔ "o"
1001
769
  *
1002
- * // Index out of range undefined
770
+ * // ⚠️ Index out of range undefined
1003
771
  * type D = CharAt<"hello", 5>; // ➔ undefined
1004
772
  * type E = CharAt<"abc", 99>; // ➔ undefined
1005
773
  *
@@ -1009,7 +777,7 @@ type Split<Str extends string,Del extends string|number="">=string extends Str?s
1009
777
  * type H = CharAt<"testing", "6">; // ➔ "g"
1010
778
  * type I = CharAt<"testing", "7">; // ➔ undefined
1011
779
  *
1012
- * // ⚠️ Non-literal strings undefined
780
+ * // ⚠️ Non-literal strings undefined
1013
781
  * type J = CharAt<string, 2>; // ➔ undefined
1014
782
  *
1015
783
  * // ⚠️ Negative indices are not supported
@@ -1018,12 +786,10 @@ type Split<Str extends string,Del extends string|number="">=string extends Str?s
1018
786
  */
1019
787
  type CharAt<I extends string,N extends number|`${number}`>=_CharAt<I,N>;
1020
788
  /** -------------------------------------------------------
1021
- * * ***IsUnknown.***
789
+ * * ***Utility Type: `IsUnknown`.***
1022
790
  * -------------------------------------------------------
1023
- * Returns a boolean indicating whether the given type `T` is `unknown`.
1024
- *
791
+ * **Returns a boolean indicating whether the given type `T` is `unknown`.**
1025
792
  * @template T - The type to check.
1026
- *
1027
793
  * @example
1028
794
  * ```ts
1029
795
  * type TrueResult = IsUnknown<unknown>; // ➔ true
@@ -1033,14 +799,13 @@ type CharAt<I extends string,N extends number|`${number}`>=_CharAt<I,N>;
1033
799
  */
1034
800
  type IsUnknown<T>=IsAny<T>extends true?false:[unknown] extends [T]?true:false;
1035
801
  /** -------------------------------------------------------
1036
- * * ***IfUnknown.***
802
+ * * ***Utility Type: `IfUnknown`.***
1037
803
  * -------------------------------------------------------
1038
- * Conditional type: returns `IfTrue` if `T` is `unknown`, otherwise returns `IfFalse`.
1039
- *
804
+ * - **Conditional type:**
805
+ * - Returns `IfTrue` if `T` is `unknown`, otherwise returns `IfFalse`.
1040
806
  * @template T - The type to check.
1041
807
  * @template IfTrue - The type returned if `T` is `unknown` (default: `true`).
1042
808
  * @template IfFalse - The type returned if `T` is not `unknown` (default: `false`).
1043
- *
1044
809
  * @example
1045
810
  * ```ts
1046
811
  * type Result1 = IfUnknown<unknown, "foo", "bar">; // ➔ "foo"
@@ -1048,11 +813,9 @@ type IsUnknown<T>=IsAny<T>extends true?false:[unknown] extends [T]?true:false;
1048
813
  * ```
1049
814
  */
1050
815
  type IfUnknown<T,IfTrue=true,IfFalse=false>=If<IsUnknown<T>,IfTrue,IfFalse>;
1051
- /** -------------------------------------------------------
1052
- * * ***UnknownifyPropertiesOptions.***
1053
- * -------------------------------------------------------
1054
- * Options for `UnknownifyProperties`.
1055
- *
816
+ /** ---------------------------------------------------------------------------
817
+ * * ***Type Options for {@link UnknownifyProperties | `UnknownifyProperties`}.***
818
+ * ---------------------------------------------------------------------------
1056
819
  * @property makeOptional - If `true`, all properties become optional.
1057
820
  */
1058
821
  type UnknownifyPropertiesOptions={
@@ -1065,43 +828,33 @@ type UnknownifyPropertiesOptions={
1065
828
  * @example
1066
829
  * ```ts
1067
830
  * type A = { a: string; b: number };
1068
- *
1069
831
  * type B = UnknownifyProperties<A, { makeOptional: true }>;
1070
832
  * // ➔ { a?: unknown; b?: unknown }
1071
833
  * ```
1072
834
  */
1073
835
  makeOptional:boolean;};
1074
836
  /** -------------------------------------------------------
1075
- * * ***UnknownifyProperties.***
837
+ * * ***Utility Type: `UnknownifyProperties`.***
1076
838
  * -------------------------------------------------------
1077
- * Transforms all properties of an object type `T` to `unknown`.
1078
- * Optionally, makes all properties optional based on `Options`.
1079
- *
839
+ * **Transforms all properties of an object type `T` to `unknown`.**
840
+ * @description Optionally, makes all properties optional based on `Options`.
1080
841
  * @template T - The object type to transform.
1081
842
  * @template Options - Configuration options (default: `{ makeOptional: false }`).
1082
843
  *
1083
844
  * @example
1084
845
  * ```ts
1085
846
  * type A = { a: string; b: number };
1086
- *
1087
847
  * type Result1 = UnknownifyProperties<A>;
1088
848
  * // ➔ { a: unknown; b: unknown }
1089
- *
1090
849
  * type Result2 = UnknownifyProperties<A, { makeOptional: true }>;
1091
850
  * // ➔ { a?: unknown; b?: unknown }
1092
851
  * ```
1093
852
  */
1094
853
  type UnknownifyProperties<T extends object,Options extends UnknownifyPropertiesOptions={makeOptional:false;}>={[K in keyof T]:unknown;}extends infer Result?If<Options["makeOptional"],Partial<Result>,Result>:never;
1095
- /** -------------------------------------------------------
1096
- * * ***MutableOptions***
1097
- * -------------------------------------------------------
1098
- *
1099
- * Configuration options for the ***{@link Mutable}*** type utilities.
1100
- *
1101
- * @property recursive - Whether to make nested objects mutable recursively.
1102
- * - If `true`, all nested objects will also have their `readonly` removed.
1103
- * - Default: `false`.
1104
- *
854
+ /** ---------------------------------------------------------------------------
855
+ * * ***Options for {@link Mutable | `Mutable`}.***
856
+ * ---------------------------------------------------------------------------
857
+ * **Configuration options for the ***{@link Mutable | **`Mutable`**}*** type utilities.**
1105
858
  * @example
1106
859
  * ```ts
1107
860
  * type Opt1 = MutableOptions;
@@ -1109,71 +862,65 @@ type UnknownifyProperties<T extends object,Options extends UnknownifyPropertiesO
1109
862
  * ```
1110
863
  */
1111
864
  type MutableOptions={
1112
- /** Whether to make nested objects mutable recursively.
865
+ /** * ***Whether to make nested objects mutable recursively.***
1113
866
  *
1114
- * - If `true`, all nested objects will also have their `readonly` removed.
1115
- * - Default value: `false`.
867
+ * - **Behavior:**
868
+ * - If `true`, all nested objects will also have their `readonly` removed.
869
+ * - Default value: `false`.
1116
870
  *
1117
871
  * @default false
1118
872
  */
1119
873
  recursive:boolean;};
1120
874
  /** -------------------------------------------------------
1121
- * * ***Mutable.***
875
+ * * ***Utility Type: `Mutable`.***
1122
876
  * -------------------------------------------------------
1123
- * Removes `readonly` from all properties of the passed type `T`.
877
+ * **Removes `readonly` from all properties of the passed type `T`.**
1124
878
  * - If `Options["recursive"]` is `true`, nested objects are also made mutable.
1125
- *
1126
879
  * @template T - The type to make mutable.
1127
880
  * @template Options - Configuration options. Default: `{ recursive: false }`.
1128
881
  * @example
1129
882
  * ```ts
1130
883
  * type Case1 = Mutable<{ readonly a: { readonly b: string } }>;
1131
884
  * // ➔ { a: { b: string } } (non-recursive by default)
1132
- *
1133
885
  * type Case2 = Mutable<{ readonly a: { readonly b: string } }, { recursive: true }>;
1134
886
  * // ➔ { a: { b: string } } (nested properties also mutable)
1135
887
  * ```
1136
888
  */
1137
889
  type Mutable<T,Options extends MutableOptions={recursive:false;}>=Prettify<{-readonly [K in keyof T]:And<Options["recursive"],Extends<T[K],object>>extends true?Mutable<T[K],Options>:T[K];}>;
1138
890
  /** -------------------------------------------------------
1139
- * * ***MutableOnly.***
891
+ * * ***Utility Type: `MutableOnly`.***
1140
892
  * -------------------------------------------------------
1141
- * Removes `readonly` only from the specified keys `K` of type `T`.
1142
- *
893
+ * **Removes `readonly` only from the specified keys `K` of type `T`.**
1143
894
  * @template T - The type to modify.
1144
895
  * @template K - Keys to make mutable.
1145
896
  * @example
1146
897
  * ```ts
1147
898
  * type Case1 = MutableOnly<{ readonly a: string; readonly b: string }, "a">;
1148
899
  * // ➔ { a: string; readonly b: string }
1149
- *
1150
900
  * type Case2 = MutableOnly<{ readonly a: string; readonly b: string }, "a" | "b">;
1151
901
  * // ➔ { a: string; b: string }
1152
902
  * ```
1153
903
  */
1154
904
  type MutableOnly<T,K extends keyof T>=Prettify<Pick<T,Exclude<keyof T,K>>&{-readonly [P in K]:T[P];}>;
1155
905
  /** -------------------------------------------------------
1156
- * * ***MutableExcept.***
906
+ * * ***Utility Type: `MutableExcept`.***
1157
907
  * -------------------------------------------------------
1158
- * Removes `readonly` from all properties of `T` **except** the specified keys `K`.
1159
- *
908
+ * **Removes `readonly` from all properties of `T` **except** the specified keys `K`.**
1160
909
  * @template T - The type to modify.
1161
910
  * @template K - Keys to keep as readonly.
1162
911
  * @example
1163
912
  * ```ts
1164
913
  * type Case1 = MutableExcept<{ readonly a: string; readonly b: string }, "b">;
1165
914
  * // ➔ { a: string; readonly b: string }
1166
- *
1167
915
  * type Case2 = MutableExcept<{ a: string; readonly b: string }, "a">;
1168
916
  * // ➔ { a: string; b: string } (all except "a" made mutable)
1169
917
  * ```
1170
918
  */
1171
919
  type MutableExcept<T,K extends keyof T>=Prettify<Pick<T,K>&{-readonly [P in Exclude<keyof T,K>]:T[P];}>;
1172
920
  /** -------------------------------------------------------
1173
- * * ***IsArray.***
921
+ * * ***Utility Type: `IsArray`.***
1174
922
  * -------------------------------------------------------
1175
- * Returns a boolean whether the passed argument is an array.
1176
- *
923
+ * **Returns a boolean whether the passed argument is an array.**
1177
924
  * @example
1178
925
  * type Case1 = IsArray<[]>;
1179
926
  * // ➔ true
@@ -1182,10 +929,9 @@ type MutableExcept<T,K extends keyof T>=Prettify<Pick<T,K>&{-readonly [P in Excl
1182
929
  */
1183
930
  type IsArray<T>=AndArr<[ Not<IsAny<T>>,Not<IsNever<T>>,Extends<T,readonly unknown[]>]>;
1184
931
  /** -------------------------------------------------------
1185
- * * ***IsMutableArray.***
932
+ * * ***Utility Type: `IsMutableArray`.***
1186
933
  * -------------------------------------------------------
1187
- * Returns a boolean whether the passed argument is a mutable array.
1188
- *
934
+ * **Returns a boolean whether the passed argument is a mutable array.**
1189
935
  * @example
1190
936
  * type Case1 = IsMutableArray<[]>;
1191
937
  * // ➔ true
@@ -1194,14 +940,13 @@ type IsArray<T>=AndArr<[ Not<IsAny<T>>,Not<IsNever<T>>,Extends<T,readonly unknow
1194
940
  */
1195
941
  type IsMutableArray<T>=And<IsArray<T>,NotExtends<Readonly<T>,T>>;
1196
942
  /** -------------------------------------------------------
1197
- * * ***IsReadonlyArray.***
943
+ * * ***Utility Type: `IsReadonlyArray`.***
1198
944
  * -------------------------------------------------------
1199
- * Returns a boolean whether the passed argument is a read-only array.
1200
- *
945
+ * **Returns a boolean whether the passed argument is a read-only array.**
1201
946
  * @example
1202
947
  * type Case1 = IsReadonlyArray<readonly []>;
1203
948
  * // ➔ true
1204
949
  * type Case2 = IsReadonlyArray<[]>;
1205
950
  * // ➔ false
1206
951
  */
1207
- type IsReadonlyArray<T>=And<IsArray<T>,NotExtends<T,Mutable<T>>>;export type{PositiveInteger as $,And as A,IfPositiveFloat as B,CharAt as C,IfPositiveInteger as D,Even as E,Float as F,Integer as G,IsNegativeFloat as H,IsStringLiteral as I,IsOdd as J,IsPositiveFloat as K,IsPositiveInteger as L,Mutable as M,Negate as N,Or as O,ParseNumber as P,IsScientificNumber as Q,Repeat as R,Split as S,Negative as T,NegativeFloat as U,NegativeInteger as V,Odd as W,OddDigit as X,ParseScientificNumber as Y,Positive as Z,PositiveFloat as _,IsNegative as a,IfUnknown as a0,UnknownifyProperties as a1,UnknownifyPropertiesOptions as a2,Abs as b,IsFloat as c,IsUnknown as d,IsNegativeInteger as e,OrArr as f,AndArr as g,IsInteger as h,Push as i,IfNegative as j,IsPositive as k,IsEven as l,IsReadonlyArray as m,IfPositive as n,IsArray as o,IsMutableArray as p,MutableExcept as q,MutableOnly as r,MutableOptions as s,EvenDigit as t,IfEven as u,IfFloat as v,IfInteger as w,IfNegativeFloat as x,IfNegativeInteger as y,IfOdd as z};
952
+ type IsReadonlyArray<T>=And<IsArray<T>,NotExtends<T,Mutable<T>>>;export type{Abs as A,IsNegativeFloat as B,CharAt as C,IsOdd as D,Even as E,Float as F,IsPositiveFloat as G,IsPositiveInteger as H,IsStringLiteral as I,IsScientificNumber as J,Negative as K,NegativeFloat as L,Mutable as M,Negate as N,NegativeInteger as O,ParseNumber as P,Odd as Q,Repeat as R,Split as S,OddDigit as T,ParseScientificNumber as U,Positive as V,PositiveFloat as W,PositiveInteger as X,IfUnknown as Y,UnknownifyProperties as Z,UnknownifyPropertiesOptions as _,IsNegative as a,IsFloat as b,IsUnknown as c,IsNegativeInteger as d,IsInteger as e,Push as f,IfNegative as g,IsPositive as h,IsEven as i,IsReadonlyArray as j,IfPositive as k,IsArray as l,IsMutableArray as m,MutableExcept as n,MutableOnly as o,MutableOptions as p,EvenDigit as q,IfEven as r,IfFloat as s,IfInteger as t,IfNegativeFloat as u,IfNegativeInteger as v,IfOdd as w,IfPositiveFloat as x,IfPositiveInteger as y,Integer as z};