ts-data-forge 5.1.0 → 6.0.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 (230) hide show
  1. package/README.md +46 -44
  2. package/dist/array/impl/array-utils-modification.d.mts.map +1 -1
  3. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  4. package/dist/array/impl/array-utils-reducing-value.d.mts +8 -8
  5. package/dist/array/impl/array-utils-search.d.mts +4 -4
  6. package/dist/array/impl/array-utils-set-op.d.mts +7 -7
  7. package/dist/array/impl/array-utils-set-op.mjs +7 -7
  8. package/dist/array/impl/array-utils-size.d.mts +2 -2
  9. package/dist/array/impl/array-utils-size.mjs +2 -2
  10. package/dist/array/impl/array-utils-slicing.d.mts +2 -2
  11. package/dist/array/impl/array-utils-slicing.mjs +2 -2
  12. package/dist/array/impl/array-utils-validation.d.mts +18 -18
  13. package/dist/array/impl/array-utils-validation.mjs +14 -14
  14. package/dist/collections/imap.d.mts +15 -15
  15. package/dist/collections/imap.mjs +3 -3
  16. package/dist/collections/iset-mapped.d.mts +19 -19
  17. package/dist/collections/iset-mapped.mjs +2 -2
  18. package/dist/collections/iset.d.mts +19 -19
  19. package/dist/collections/iset.mjs +2 -2
  20. package/dist/collections/queue.d.mts +25 -25
  21. package/dist/collections/queue.mjs +5 -5
  22. package/dist/collections/stack.d.mts +25 -25
  23. package/dist/collections/stack.mjs +5 -5
  24. package/dist/functional/match.d.mts +1 -1
  25. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +2 -2
  26. package/dist/functional/optional/impl/optional-is-none.d.mts +1 -1
  27. package/dist/functional/optional/impl/optional-is-none.mjs +1 -1
  28. package/dist/functional/optional/impl/optional-is-optional.d.mts +2 -2
  29. package/dist/functional/optional/impl/optional-is-optional.mjs +2 -2
  30. package/dist/functional/optional/impl/optional-is-some.d.mts +1 -1
  31. package/dist/functional/optional/impl/optional-is-some.mjs +1 -1
  32. package/dist/functional/optional/impl/optional-none.d.mts +2 -2
  33. package/dist/functional/optional/impl/optional-none.mjs +2 -2
  34. package/dist/functional/optional/impl/optional-some.d.mts +2 -2
  35. package/dist/functional/optional/impl/optional-some.mjs +2 -2
  36. package/dist/functional/optional/impl/optional-to-nullable.d.mts +2 -2
  37. package/dist/functional/optional/impl/optional-to-nullable.mjs +2 -2
  38. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +4 -4
  39. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +1 -1
  40. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +1 -1
  41. package/dist/functional/optional/impl/optional-unwrap.d.mts +2 -2
  42. package/dist/functional/optional/impl/optional-zip.d.mts +1 -1
  43. package/dist/functional/optional/impl/optional-zip.mjs +1 -1
  44. package/dist/functional/pipe.d.mts +2 -2
  45. package/dist/functional/result/impl/result-err.d.mts +1 -1
  46. package/dist/functional/result/impl/result-err.mjs +1 -1
  47. package/dist/functional/result/impl/result-expect-to-be.d.mts +2 -2
  48. package/dist/functional/result/impl/result-from-promise.d.mts +1 -1
  49. package/dist/functional/result/impl/result-from-promise.mjs +1 -1
  50. package/dist/functional/result/impl/result-from-throwable.d.mts +1 -1
  51. package/dist/functional/result/impl/result-from-throwable.mjs +1 -1
  52. package/dist/functional/result/impl/result-is-err.d.mts +2 -2
  53. package/dist/functional/result/impl/result-is-err.mjs +2 -2
  54. package/dist/functional/result/impl/result-is-ok.d.mts +2 -2
  55. package/dist/functional/result/impl/result-is-ok.mjs +2 -2
  56. package/dist/functional/result/impl/result-is-result.d.mts +3 -3
  57. package/dist/functional/result/impl/result-is-result.mjs +3 -3
  58. package/dist/functional/result/impl/result-ok.d.mts +1 -1
  59. package/dist/functional/result/impl/result-ok.mjs +1 -1
  60. package/dist/functional/result/impl/result-unwrap-err-or.d.mts +4 -4
  61. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +1 -1
  62. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +1 -1
  63. package/dist/functional/result/impl/result-unwrap-err.d.mts +2 -2
  64. package/dist/functional/result/impl/result-unwrap-err.mjs +2 -2
  65. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +4 -4
  66. package/dist/functional/result/impl/result-unwrap-ok.d.mts +2 -2
  67. package/dist/functional/result/impl/result-unwrap-throw.d.mts +1 -1
  68. package/dist/functional/result/impl/result-unwrap-throw.mjs +1 -1
  69. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +1 -1
  70. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +1 -1
  71. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +1 -1
  72. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +1 -1
  73. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +1 -1
  74. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +1 -1
  75. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +3 -3
  76. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +3 -3
  77. package/dist/globals.d.mts +2 -1
  78. package/dist/guard/has-key.d.mts +6 -3
  79. package/dist/guard/has-key.d.mts.map +1 -1
  80. package/dist/guard/has-key.mjs +2 -2
  81. package/dist/guard/is-record.d.mts.map +1 -1
  82. package/dist/guard/is-record.mjs +1 -1
  83. package/dist/guard/is-record.mjs.map +1 -1
  84. package/dist/guard/key-is-in.d.mts +2 -2
  85. package/dist/guard/key-is-in.mjs +2 -2
  86. package/dist/json/json.d.mts +21 -21
  87. package/dist/json/json.mjs +21 -21
  88. package/dist/number/branded-types/int.d.mts +19 -19
  89. package/dist/number/branded-types/int.mjs +19 -19
  90. package/dist/number/branded-types/positive-int.d.mts +20 -20
  91. package/dist/number/branded-types/positive-int.mjs +20 -20
  92. package/dist/number/branded-types/positive-safe-int.d.mts +26 -26
  93. package/dist/number/branded-types/positive-safe-int.mjs +26 -26
  94. package/dist/number/branded-types/safe-int.d.mts +27 -27
  95. package/dist/number/branded-types/safe-int.mjs +27 -27
  96. package/dist/number/branded-types/uint.d.mts +19 -19
  97. package/dist/number/branded-types/uint.mjs +19 -19
  98. package/dist/number/num.d.mts +20 -20
  99. package/dist/number/num.mjs +16 -16
  100. package/dist/number/refined-number-utils.d.mts +11 -11
  101. package/dist/number/refined-number-utils.d.mts.map +1 -1
  102. package/dist/number/refined-number-utils.mjs +11 -11
  103. package/dist/object/object.d.mts +3 -3
  104. package/dist/object/object.d.mts.map +1 -1
  105. package/dist/object/object.mjs +3 -3
  106. package/dist/object/object.mjs.map +1 -1
  107. package/dist/others/tuple.d.mts +3 -3
  108. package/dist/others/tuple.mjs +3 -3
  109. package/dist/promise/promise.d.mts +4 -4
  110. package/dist/promise/promise.mjs +4 -4
  111. package/package.json +15 -13
  112. package/src/array/impl/array-utils-creation.test.mts +1 -1
  113. package/src/array/impl/array-utils-element-access.test.mts +16 -16
  114. package/src/array/impl/array-utils-modification.mts +38 -19
  115. package/src/array/impl/array-utils-reducing-value.mts +8 -8
  116. package/src/array/impl/array-utils-reducing-value.test.mts +23 -31
  117. package/src/array/impl/array-utils-search.mts +4 -4
  118. package/src/array/impl/array-utils-search.test.mts +10 -10
  119. package/src/array/impl/array-utils-set-op.mts +7 -7
  120. package/src/array/impl/array-utils-set-op.test.mts +13 -13
  121. package/src/array/impl/array-utils-size.mts +2 -2
  122. package/src/array/impl/array-utils-slicing.mts +2 -2
  123. package/src/array/impl/array-utils-transformation.test.mts +2 -2
  124. package/src/array/impl/array-utils-validation.mts +18 -18
  125. package/src/array/impl/array-utils-validation.test.mts +80 -78
  126. package/src/array/impl/array.test.mts +6 -6
  127. package/src/collections/imap-mapped.test.mts +16 -18
  128. package/src/collections/imap.mts +15 -15
  129. package/src/collections/imap.test.mts +31 -31
  130. package/src/collections/iset-mapped.mts +19 -19
  131. package/src/collections/iset-mapped.test.mts +52 -52
  132. package/src/collections/iset.mts +19 -19
  133. package/src/collections/iset.test.mts +130 -130
  134. package/src/collections/queue.mts +25 -25
  135. package/src/collections/queue.test.mts +33 -35
  136. package/src/collections/stack.mts +25 -25
  137. package/src/collections/stack.test.mts +15 -15
  138. package/src/functional/match.mts +1 -1
  139. package/src/functional/optional/impl/optional-expect-to-be.mts +2 -2
  140. package/src/functional/optional/impl/optional-is-none.mts +1 -1
  141. package/src/functional/optional/impl/optional-is-optional.mts +2 -2
  142. package/src/functional/optional/impl/optional-is-some.mts +1 -1
  143. package/src/functional/optional/impl/optional-none.mts +2 -2
  144. package/src/functional/optional/impl/optional-some.mts +2 -2
  145. package/src/functional/optional/impl/optional-to-nullable.mts +2 -2
  146. package/src/functional/optional/impl/optional-unwrap-or.mts +4 -4
  147. package/src/functional/optional/impl/optional-unwrap-throw.mts +1 -1
  148. package/src/functional/optional/impl/optional-unwrap.mts +2 -2
  149. package/src/functional/optional/impl/optional-zip.mts +1 -1
  150. package/src/functional/optional.test.mts +53 -54
  151. package/src/functional/pipe.mts +2 -2
  152. package/src/functional/pipe.test.mts +4 -4
  153. package/src/functional/result/impl/result-err.mts +1 -1
  154. package/src/functional/result/impl/result-expect-to-be.mts +2 -2
  155. package/src/functional/result/impl/result-from-promise.mts +1 -1
  156. package/src/functional/result/impl/result-from-throwable.mts +1 -1
  157. package/src/functional/result/impl/result-is-err.mts +2 -2
  158. package/src/functional/result/impl/result-is-ok.mts +2 -2
  159. package/src/functional/result/impl/result-is-result.mts +3 -3
  160. package/src/functional/result/impl/result-ok.mts +1 -1
  161. package/src/functional/result/impl/result-unwrap-err-or.mts +4 -4
  162. package/src/functional/result/impl/result-unwrap-err-throw.mts +1 -1
  163. package/src/functional/result/impl/result-unwrap-err.mts +2 -2
  164. package/src/functional/result/impl/result-unwrap-ok-or.mts +4 -4
  165. package/src/functional/result/impl/result-unwrap-ok.mts +2 -2
  166. package/src/functional/result/impl/result-unwrap-throw.mts +1 -1
  167. package/src/functional/result.test.mts +94 -152
  168. package/src/functional/ternary-result/impl/ternary-result-err.mts +1 -1
  169. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +1 -1
  170. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +1 -1
  171. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +3 -3
  172. package/src/functional/ternary-result.test.mts +8 -8
  173. package/src/globals.d.mts +2 -1
  174. package/src/guard/has-key.mts +8 -5
  175. package/src/guard/has-key.test.mts +0 -5
  176. package/src/guard/is-error.test.mts +143 -0
  177. package/src/guard/is-non-empty-string.test.mts +24 -24
  178. package/src/guard/is-non-null-object.test.mts +26 -26
  179. package/src/guard/is-primitive.test.mts +28 -28
  180. package/src/guard/is-record.mts +1 -2
  181. package/src/guard/is-record.test.mts +57 -67
  182. package/src/guard/is-type.test.mts +151 -155
  183. package/src/guard/key-is-in.mts +2 -2
  184. package/src/guard/key-is-in.test.mts +2 -2
  185. package/src/json/json.mts +21 -21
  186. package/src/json/json.test.mts +135 -174
  187. package/src/number/branded-types/finite-number.test.mts +13 -11
  188. package/src/number/branded-types/int.mts +19 -19
  189. package/src/number/branded-types/int.test.mts +14 -14
  190. package/src/number/branded-types/int16.test.mts +16 -16
  191. package/src/number/branded-types/int32.test.mts +16 -16
  192. package/src/number/branded-types/non-negative-finite-number.test.mts +12 -12
  193. package/src/number/branded-types/non-negative-int16.test.mts +16 -16
  194. package/src/number/branded-types/non-negative-int32.test.mts +16 -16
  195. package/src/number/branded-types/non-zero-finite-number.test.mts +14 -14
  196. package/src/number/branded-types/non-zero-int.test.mts +19 -19
  197. package/src/number/branded-types/non-zero-int16.test.mts +16 -16
  198. package/src/number/branded-types/non-zero-int32.test.mts +16 -16
  199. package/src/number/branded-types/non-zero-safe-int.test.mts +23 -23
  200. package/src/number/branded-types/non-zero-uint16.test.mts +16 -16
  201. package/src/number/branded-types/non-zero-uint32.test.mts +16 -16
  202. package/src/number/branded-types/positive-finite-number.test.mts +14 -14
  203. package/src/number/branded-types/positive-int.mts +20 -20
  204. package/src/number/branded-types/positive-int.test.mts +17 -17
  205. package/src/number/branded-types/positive-int16.test.mts +15 -15
  206. package/src/number/branded-types/positive-int32.test.mts +15 -15
  207. package/src/number/branded-types/positive-safe-int.mts +26 -26
  208. package/src/number/branded-types/positive-safe-int.test.mts +19 -19
  209. package/src/number/branded-types/positive-uint16.test.mts +16 -16
  210. package/src/number/branded-types/positive-uint32.test.mts +16 -16
  211. package/src/number/branded-types/safe-int.mts +27 -27
  212. package/src/number/branded-types/safe-int.test.mts +18 -18
  213. package/src/number/branded-types/safe-uint.test.mts +17 -17
  214. package/src/number/branded-types/uint.mts +19 -19
  215. package/src/number/branded-types/uint.test.mts +15 -15
  216. package/src/number/branded-types/uint16.test.mts +15 -15
  217. package/src/number/branded-types/uint32.test.mts +15 -15
  218. package/src/number/enum/int8.test.mts +1 -1
  219. package/src/number/enum/uint8.test.mts +1 -1
  220. package/src/number/num.mts +20 -20
  221. package/src/number/num.test.mts +26 -26
  222. package/src/number/refined-number-utils.mts +13 -13
  223. package/src/object/object.mts +4 -3
  224. package/src/object/object.test.mts +6 -6
  225. package/src/others/cast-mutable.test.mts +1 -1
  226. package/src/others/cast-readonly.test.mts +4 -4
  227. package/src/others/if-then.test.mts +24 -24
  228. package/src/others/tuple.mts +3 -3
  229. package/src/promise/promise.mts +4 -4
  230. package/src/promise/promise.test.mts +7 -13
@@ -15,13 +15,13 @@ const { MAX_VALUE, MIN_VALUE, add, castType, clamp, div, is, max: max_, min: min
15
15
  * @example
16
16
  *
17
17
  * ```ts
18
- * assert.ok(isPositiveSafeInt(1));
18
+ * assert.isTrue(isPositiveSafeInt(1));
19
19
  *
20
- * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
20
+ * assert.isTrue(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
21
21
  *
22
- * assert.notOk(isPositiveSafeInt(0));
22
+ * assert.isFalse(isPositiveSafeInt(0));
23
23
  *
24
- * assert.ok(PositiveSafeInt.is(42));
24
+ * assert.isTrue(PositiveSafeInt.is(42));
25
25
  * ```
26
26
  *
27
27
  * @param value The value to check.
@@ -36,9 +36,9 @@ const isPositiveSafeInt = is;
36
36
  * ```ts
37
37
  * const branded = asPositiveSafeInt(128);
38
38
  *
39
- * assert(branded === 128);
39
+ * assert.isTrue(branded === 128);
40
40
  *
41
- * assert.ok(PositiveSafeInt.is(branded));
41
+ * assert.isTrue(PositiveSafeInt.is(branded));
42
42
  * ```
43
43
  *
44
44
  * @param value The value to cast.
@@ -62,13 +62,13 @@ const PositiveSafeInt = {
62
62
  * @example
63
63
  *
64
64
  * ```ts
65
- * assert.ok(isPositiveSafeInt(1));
65
+ * assert.isTrue(isPositiveSafeInt(1));
66
66
  *
67
- * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
67
+ * assert.isTrue(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
68
68
  *
69
- * assert.notOk(isPositiveSafeInt(0));
69
+ * assert.isFalse(isPositiveSafeInt(0));
70
70
  *
71
- * assert.ok(PositiveSafeInt.is(42));
71
+ * assert.isTrue(PositiveSafeInt.is(42));
72
72
  * ```
73
73
  *
74
74
  * @param value The value to check.
@@ -99,7 +99,7 @@ const PositiveSafeInt = {
99
99
  * asPositiveSafeInt(5),
100
100
  * );
101
101
  *
102
- * assert(smallest === 5);
102
+ * assert.isTrue(smallest === 5);
103
103
  * ```
104
104
  *
105
105
  * @param a The first PositiveSafeInt.
@@ -118,7 +118,7 @@ const PositiveSafeInt = {
118
118
  * asPositiveSafeInt(5),
119
119
  * );
120
120
  *
121
- * assert(largest === 10);
121
+ * assert.isTrue(largest === 10);
122
122
  * ```
123
123
  *
124
124
  * @param a The first PositiveSafeInt.
@@ -138,11 +138,11 @@ const PositiveSafeInt = {
138
138
  *
139
139
  * const aboveRange = PositiveSafeInt.clamp(Number.MAX_SAFE_INTEGER + 10);
140
140
  *
141
- * assert(belowRange === 1);
141
+ * assert.isTrue(belowRange === 1);
142
142
  *
143
- * assert(withinRange === 123);
143
+ * assert.isTrue(withinRange === 123);
144
144
  *
145
- * assert(aboveRange === Number.MAX_SAFE_INTEGER);
145
+ * assert.isTrue(aboveRange === Number.MAX_SAFE_INTEGER);
146
146
  * ```
147
147
  *
148
148
  * @param value The number to clamp.
@@ -161,9 +161,9 @@ const PositiveSafeInt = {
161
161
  *
162
162
  * const randomValue = PositiveSafeInt.random(min, max);
163
163
  *
164
- * assert.ok(PositiveSafeInt.is(randomValue));
164
+ * assert.isTrue(PositiveSafeInt.is(randomValue));
165
165
  *
166
- * assert.ok(randomValue >= 1 && randomValue <= 6);
166
+ * assert.isTrue(randomValue >= 1 && randomValue <= 6);
167
167
  * ```
168
168
  *
169
169
  * @returns A random PositiveSafeInt between 1 and MAX_SAFE_INTEGER.
@@ -181,7 +181,7 @@ const PositiveSafeInt = {
181
181
  *
182
182
  * const power = PositiveSafeInt.pow(base, exponent);
183
183
  *
184
- * assert(power === 27);
184
+ * assert.isTrue(power === 27);
185
185
  * ```
186
186
  *
187
187
  * @param a The base PositiveSafeInt.
@@ -200,9 +200,9 @@ const PositiveSafeInt = {
200
200
  * asPositiveSafeInt(2048),
201
201
  * );
202
202
  *
203
- * assert(sum === 3048);
203
+ * assert.isTrue(sum === 3048);
204
204
  *
205
- * assert.ok(PositiveSafeInt.is(sum));
205
+ * assert.isTrue(PositiveSafeInt.is(sum));
206
206
  * ```
207
207
  *
208
208
  * @param a The first PositiveSafeInt.
@@ -221,9 +221,9 @@ const PositiveSafeInt = {
221
221
  * asPositiveSafeInt(20),
222
222
  * );
223
223
  *
224
- * assert(difference === 1);
224
+ * assert.isTrue(difference === 1);
225
225
  *
226
- * assert.ok(PositiveSafeInt.is(difference));
226
+ * assert.isTrue(PositiveSafeInt.is(difference));
227
227
  * ```
228
228
  *
229
229
  * @param a The minuend PositiveSafeInt.
@@ -243,9 +243,9 @@ const PositiveSafeInt = {
243
243
  * asPositiveSafeInt(20),
244
244
  * );
245
245
  *
246
- * assert(product === 1000);
246
+ * assert.isTrue(product === 1000);
247
247
  *
248
- * assert.ok(PositiveSafeInt.is(product));
248
+ * assert.isTrue(PositiveSafeInt.is(product));
249
249
  * ```
250
250
  *
251
251
  * @param a The first PositiveSafeInt.
@@ -269,9 +269,9 @@ const PositiveSafeInt = {
269
269
  * asPositiveSafeInt(50),
270
270
  * );
271
271
  *
272
- * assert(quotient === 6);
272
+ * assert.isTrue(quotient === 6);
273
273
  *
274
- * assert(clamped === 1);
274
+ * assert.isTrue(clamped === 1);
275
275
  * ```
276
276
  *
277
277
  * @param a The dividend PositiveSafeInt.
@@ -8,11 +8,11 @@ import { TsDataForgeInternals } from '../refined-number-utils.mjs';
8
8
  * @example
9
9
  *
10
10
  * ```ts
11
- * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
11
+ * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));
12
12
  *
13
- * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
13
+ * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
14
14
  *
15
- * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
15
+ * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));
16
16
  * ```
17
17
  *
18
18
  * @param value - The value to check
@@ -31,9 +31,9 @@ export declare const isSafeInt: (a: number) => a is SafeInt;
31
31
  * ```ts
32
32
  * const branded = asSafeInt(123);
33
33
  *
34
- * assert(branded === 123);
34
+ * assert.isTrue(branded === 123);
35
35
  *
36
- * assert.ok(SafeInt.is(branded));
36
+ * assert.isTrue(SafeInt.is(branded));
37
37
  * ```
38
38
  *
39
39
  * @param value - The value to cast
@@ -71,11 +71,11 @@ export declare const SafeInt: {
71
71
  * @example
72
72
  *
73
73
  * ```ts
74
- * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
74
+ * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));
75
75
  *
76
- * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
76
+ * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
77
77
  *
78
- * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
78
+ * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));
79
79
  * ```
80
80
  *
81
81
  * @param value - The value to check
@@ -108,9 +108,9 @@ export declare const SafeInt: {
108
108
  *
109
109
  * const absolute = SafeInt.abs(negative);
110
110
  *
111
- * assert(absolute === 900);
111
+ * assert.isTrue(absolute === 900);
112
112
  *
113
- * assert.ok(SafeInt.is(absolute));
113
+ * assert.isTrue(SafeInt.is(absolute));
114
114
  * ```
115
115
  *
116
116
  * @param a - The safe integer value
@@ -125,7 +125,7 @@ export declare const SafeInt: {
125
125
  * ```ts
126
126
  * const smallest = SafeInt.min(asSafeInt(25), asSafeInt(-14), asSafeInt(99));
127
127
  *
128
- * assert(smallest === -14);
128
+ * assert.isTrue(smallest === -14);
129
129
  * ```
130
130
  *
131
131
  * @param values - The safe integers to compare (at least one required)
@@ -140,7 +140,7 @@ export declare const SafeInt: {
140
140
  * ```ts
141
141
  * const largest = SafeInt.max(asSafeInt(25), asSafeInt(-14), asSafeInt(99));
142
142
  *
143
- * assert(largest === 99);
143
+ * assert.isTrue(largest === 99);
144
144
  * ```
145
145
  *
146
146
  * @param values - The safe integers to compare (at least one required)
@@ -159,11 +159,11 @@ export declare const SafeInt: {
159
159
  *
160
160
  * const belowRange = SafeInt.clamp(-1e20);
161
161
  *
162
- * assert(aboveRange === Number.MAX_SAFE_INTEGER);
162
+ * assert.isTrue(aboveRange === Number.MAX_SAFE_INTEGER);
163
163
  *
164
- * assert(withinRange === 123);
164
+ * assert.isTrue(withinRange === 123);
165
165
  *
166
- * assert(belowRange === Number.MIN_SAFE_INTEGER);
166
+ * assert.isTrue(belowRange === Number.MIN_SAFE_INTEGER);
167
167
  * ```
168
168
  *
169
169
  * @param value The number to clamp.
@@ -186,9 +186,9 @@ export declare const SafeInt: {
186
186
  *
187
187
  * const randomValue = SafeInt.random(min, max);
188
188
  *
189
- * assert.ok(SafeInt.is(randomValue));
189
+ * assert.isTrue(SafeInt.is(randomValue));
190
190
  *
191
- * assert.ok(randomValue >= -10 && randomValue <= 10);
191
+ * assert.isTrue(randomValue >= -10 && randomValue <= 10);
192
192
  * ```
193
193
  *
194
194
  * @param min - The minimum value (inclusive)
@@ -208,9 +208,9 @@ export declare const SafeInt: {
208
208
  *
209
209
  * const power = SafeInt.pow(base, exponent);
210
210
  *
211
- * assert(power === 243);
211
+ * assert.isTrue(power === 243);
212
212
  *
213
- * assert.ok(SafeInt.is(power));
213
+ * assert.isTrue(SafeInt.is(power));
214
214
  * ```
215
215
  *
216
216
  * @param a The base SafeInt.
@@ -226,9 +226,9 @@ export declare const SafeInt: {
226
226
  * ```ts
227
227
  * const sum = SafeInt.add(asSafeInt(9), asSafeInt(4));
228
228
  *
229
- * assert(sum === 13);
229
+ * assert.isTrue(sum === 13);
230
230
  *
231
- * assert.ok(SafeInt.is(sum));
231
+ * assert.isTrue(SafeInt.is(sum));
232
232
  * ```
233
233
  *
234
234
  * @param a The first SafeInt.
@@ -244,9 +244,9 @@ export declare const SafeInt: {
244
244
  * ```ts
245
245
  * const difference = SafeInt.sub(asSafeInt(9), asSafeInt(14));
246
246
  *
247
- * assert(difference === -5);
247
+ * assert.isTrue(difference === -5);
248
248
  *
249
- * assert.ok(SafeInt.is(difference));
249
+ * assert.isTrue(SafeInt.is(difference));
250
250
  * ```
251
251
  *
252
252
  * @param a The minuend SafeInt.
@@ -262,9 +262,9 @@ export declare const SafeInt: {
262
262
  * ```ts
263
263
  * const product = SafeInt.mul(asSafeInt(-8), asSafeInt(7));
264
264
  *
265
- * assert(product === -56);
265
+ * assert.isTrue(product === -56);
266
266
  *
267
- * assert.ok(SafeInt.is(product));
267
+ * assert.isTrue(SafeInt.is(product));
268
268
  * ```
269
269
  *
270
270
  * @param a The first SafeInt.
@@ -283,9 +283,9 @@ export declare const SafeInt: {
283
283
  * ```ts
284
284
  * const quotient = SafeInt.div(asSafeInt(-17), asSafeInt(5));
285
285
  *
286
- * assert(quotient === -4);
286
+ * assert.isTrue(quotient === -4);
287
287
  *
288
- * assert.ok(SafeInt.is(quotient));
288
+ * assert.isTrue(SafeInt.is(quotient));
289
289
  * ```
290
290
  *
291
291
  * @param a - The dividend
@@ -18,11 +18,11 @@ const { MAX_VALUE, MIN_VALUE, abs, add, castType, clamp, div, is, max: max_, min
18
18
  * @example
19
19
  *
20
20
  * ```ts
21
- * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
21
+ * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));
22
22
  *
23
- * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
23
+ * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
24
24
  *
25
- * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
25
+ * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));
26
26
  * ```
27
27
  *
28
28
  * @param value - The value to check
@@ -41,9 +41,9 @@ const isSafeInt = is;
41
41
  * ```ts
42
42
  * const branded = asSafeInt(123);
43
43
  *
44
- * assert(branded === 123);
44
+ * assert.isTrue(branded === 123);
45
45
  *
46
- * assert.ok(SafeInt.is(branded));
46
+ * assert.isTrue(SafeInt.is(branded));
47
47
  * ```
48
48
  *
49
49
  * @param value - The value to cast
@@ -74,11 +74,11 @@ const SafeInt = {
74
74
  * @example
75
75
  *
76
76
  * ```ts
77
- * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
77
+ * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));
78
78
  *
79
- * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
79
+ * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
80
80
  *
81
- * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
81
+ * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));
82
82
  * ```
83
83
  *
84
84
  * @param value - The value to check
@@ -111,9 +111,9 @@ const SafeInt = {
111
111
  *
112
112
  * const absolute = SafeInt.abs(negative);
113
113
  *
114
- * assert(absolute === 900);
114
+ * assert.isTrue(absolute === 900);
115
115
  *
116
- * assert.ok(SafeInt.is(absolute));
116
+ * assert.isTrue(SafeInt.is(absolute));
117
117
  * ```
118
118
  *
119
119
  * @param a - The safe integer value
@@ -128,7 +128,7 @@ const SafeInt = {
128
128
  * ```ts
129
129
  * const smallest = SafeInt.min(asSafeInt(25), asSafeInt(-14), asSafeInt(99));
130
130
  *
131
- * assert(smallest === -14);
131
+ * assert.isTrue(smallest === -14);
132
132
  * ```
133
133
  *
134
134
  * @param values - The safe integers to compare (at least one required)
@@ -143,7 +143,7 @@ const SafeInt = {
143
143
  * ```ts
144
144
  * const largest = SafeInt.max(asSafeInt(25), asSafeInt(-14), asSafeInt(99));
145
145
  *
146
- * assert(largest === 99);
146
+ * assert.isTrue(largest === 99);
147
147
  * ```
148
148
  *
149
149
  * @param values - The safe integers to compare (at least one required)
@@ -162,11 +162,11 @@ const SafeInt = {
162
162
  *
163
163
  * const belowRange = SafeInt.clamp(-1e20);
164
164
  *
165
- * assert(aboveRange === Number.MAX_SAFE_INTEGER);
165
+ * assert.isTrue(aboveRange === Number.MAX_SAFE_INTEGER);
166
166
  *
167
- * assert(withinRange === 123);
167
+ * assert.isTrue(withinRange === 123);
168
168
  *
169
- * assert(belowRange === Number.MIN_SAFE_INTEGER);
169
+ * assert.isTrue(belowRange === Number.MIN_SAFE_INTEGER);
170
170
  * ```
171
171
  *
172
172
  * @param value The number to clamp.
@@ -189,9 +189,9 @@ const SafeInt = {
189
189
  *
190
190
  * const randomValue = SafeInt.random(min, max);
191
191
  *
192
- * assert.ok(SafeInt.is(randomValue));
192
+ * assert.isTrue(SafeInt.is(randomValue));
193
193
  *
194
- * assert.ok(randomValue >= -10 && randomValue <= 10);
194
+ * assert.isTrue(randomValue >= -10 && randomValue <= 10);
195
195
  * ```
196
196
  *
197
197
  * @param min - The minimum value (inclusive)
@@ -211,9 +211,9 @@ const SafeInt = {
211
211
  *
212
212
  * const power = SafeInt.pow(base, exponent);
213
213
  *
214
- * assert(power === 243);
214
+ * assert.isTrue(power === 243);
215
215
  *
216
- * assert.ok(SafeInt.is(power));
216
+ * assert.isTrue(SafeInt.is(power));
217
217
  * ```
218
218
  *
219
219
  * @param a The base SafeInt.
@@ -229,9 +229,9 @@ const SafeInt = {
229
229
  * ```ts
230
230
  * const sum = SafeInt.add(asSafeInt(9), asSafeInt(4));
231
231
  *
232
- * assert(sum === 13);
232
+ * assert.isTrue(sum === 13);
233
233
  *
234
- * assert.ok(SafeInt.is(sum));
234
+ * assert.isTrue(SafeInt.is(sum));
235
235
  * ```
236
236
  *
237
237
  * @param a The first SafeInt.
@@ -247,9 +247,9 @@ const SafeInt = {
247
247
  * ```ts
248
248
  * const difference = SafeInt.sub(asSafeInt(9), asSafeInt(14));
249
249
  *
250
- * assert(difference === -5);
250
+ * assert.isTrue(difference === -5);
251
251
  *
252
- * assert.ok(SafeInt.is(difference));
252
+ * assert.isTrue(SafeInt.is(difference));
253
253
  * ```
254
254
  *
255
255
  * @param a The minuend SafeInt.
@@ -265,9 +265,9 @@ const SafeInt = {
265
265
  * ```ts
266
266
  * const product = SafeInt.mul(asSafeInt(-8), asSafeInt(7));
267
267
  *
268
- * assert(product === -56);
268
+ * assert.isTrue(product === -56);
269
269
  *
270
- * assert.ok(SafeInt.is(product));
270
+ * assert.isTrue(SafeInt.is(product));
271
271
  * ```
272
272
  *
273
273
  * @param a The first SafeInt.
@@ -286,9 +286,9 @@ const SafeInt = {
286
286
  * ```ts
287
287
  * const quotient = SafeInt.div(asSafeInt(-17), asSafeInt(5));
288
288
  *
289
- * assert(quotient === -4);
289
+ * assert.isTrue(quotient === -4);
290
290
  *
291
- * assert.ok(SafeInt.is(quotient));
291
+ * assert.isTrue(SafeInt.is(quotient));
292
292
  * ```
293
293
  *
294
294
  * @param a - The dividend
@@ -4,11 +4,11 @@
4
4
  * @example
5
5
  *
6
6
  * ```ts
7
- * assert.ok(isUint(4));
7
+ * assert.isTrue(isUint(4));
8
8
  *
9
- * assert.notOk(isUint(-1));
9
+ * assert.isFalse(isUint(-1));
10
10
  *
11
- * assert.ok(Uint.is(0));
11
+ * assert.isTrue(Uint.is(0));
12
12
  * ```
13
13
  *
14
14
  * @param value The value to check.
@@ -23,9 +23,9 @@ export declare const isUint: (a: number) => a is NonNegativeInt;
23
23
  * ```ts
24
24
  * const branded = asUint(12);
25
25
  *
26
- * assert(branded === 12);
26
+ * assert.isTrue(branded === 12);
27
27
  *
28
- * assert.ok(Uint.is(branded));
28
+ * assert.isTrue(Uint.is(branded));
29
29
  * ```
30
30
  *
31
31
  * @param value The value to cast.
@@ -58,11 +58,11 @@ export declare const Uint: {
58
58
  * @example
59
59
  *
60
60
  * ```ts
61
- * assert.ok(isUint(4));
61
+ * assert.isTrue(isUint(4));
62
62
  *
63
- * assert.notOk(isUint(-1));
63
+ * assert.isFalse(isUint(-1));
64
64
  *
65
- * assert.ok(Uint.is(0));
65
+ * assert.isTrue(Uint.is(0));
66
66
  * ```
67
67
  *
68
68
  * @param value The value to check.
@@ -84,7 +84,7 @@ export declare const Uint: {
84
84
  * ```ts
85
85
  * const smallest = Uint.min(asUint(7), asUint(3));
86
86
  *
87
- * assert(smallest === 3);
87
+ * assert.isTrue(smallest === 3);
88
88
  * ```
89
89
  *
90
90
  * @param a The first Uint.
@@ -100,7 +100,7 @@ export declare const Uint: {
100
100
  * ```ts
101
101
  * const largest = Uint.max(asUint(7), asUint(3));
102
102
  *
103
- * assert(largest === 7);
103
+ * assert.isTrue(largest === 7);
104
104
  * ```
105
105
  *
106
106
  * @param a The first Uint.
@@ -118,9 +118,9 @@ export declare const Uint: {
118
118
  *
119
119
  * const clampedPositive = Uint.clamp(42);
120
120
  *
121
- * assert(clampedNegative === 0);
121
+ * assert.isTrue(clampedNegative === 0);
122
122
  *
123
- * assert(clampedPositive === 42);
123
+ * assert.isTrue(clampedPositive === 42);
124
124
  * ```
125
125
  *
126
126
  * @param value The number to clamp.
@@ -139,9 +139,9 @@ export declare const Uint: {
139
139
  *
140
140
  * const randomValue = Uint.random(min, max);
141
141
  *
142
- * assert.ok(Uint.is(randomValue));
142
+ * assert.isTrue(Uint.is(randomValue));
143
143
  *
144
- * assert.ok(randomValue >= 0 && randomValue <= 3);
144
+ * assert.isTrue(randomValue >= 0 && randomValue <= 3);
145
145
  * ```
146
146
  *
147
147
  * @returns A random non-negative integer as a Uint.
@@ -159,7 +159,7 @@ export declare const Uint: {
159
159
  *
160
160
  * const power = Uint.pow(base, exponent);
161
161
  *
162
- * assert(power === 32);
162
+ * assert.isTrue(power === 32);
163
163
  * ```
164
164
  *
165
165
  * @param a The base Uint.
@@ -175,7 +175,7 @@ export declare const Uint: {
175
175
  * ```ts
176
176
  * const sum = Uint.add(asUint(5), asUint(8));
177
177
  *
178
- * assert(sum === 13);
178
+ * assert.isTrue(sum === 13);
179
179
  * ```
180
180
  *
181
181
  * @param a The first Uint.
@@ -191,7 +191,7 @@ export declare const Uint: {
191
191
  * ```ts
192
192
  * const difference = Uint.sub(asUint(5), asUint(8));
193
193
  *
194
- * assert(difference === 0);
194
+ * assert.isTrue(difference === 0);
195
195
  * ```
196
196
  *
197
197
  * @param a The minuend Uint.
@@ -207,7 +207,7 @@ export declare const Uint: {
207
207
  * ```ts
208
208
  * const product = Uint.mul(asUint(7), asUint(6));
209
209
  *
210
- * assert(product === 42);
210
+ * assert.isTrue(product === 42);
211
211
  * ```
212
212
  *
213
213
  * @param a The first Uint.
@@ -223,7 +223,7 @@ export declare const Uint: {
223
223
  * ```ts
224
224
  * const quotient = Uint.div(asUint(10), asUint(4));
225
225
  *
226
- * assert(quotient === 2);
226
+ * assert.isTrue(quotient === 2);
227
227
  * ```
228
228
  *
229
229
  * @param a The dividend Uint.