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
@@ -40,18 +40,18 @@ export type Stack<T> = Readonly<{
40
40
  * ```ts
41
41
  * const stack = createStack<string>();
42
42
  *
43
- * assert.ok(stack.isEmpty);
43
+ * assert.isTrue(stack.isEmpty);
44
44
  *
45
- * assert(stack.size === 0);
45
+ * assert.isTrue(stack.size === 0);
46
46
  *
47
47
  * stack.push('first');
48
48
  *
49
49
  * // eslint-disable-next-line unicorn/prefer-single-call
50
50
  * stack.push('second');
51
51
  *
52
- * assert.notOk(stack.isEmpty);
52
+ * assert.isFalse(stack.isEmpty);
53
53
  *
54
- * assert(stack.size === 2);
54
+ * assert.isTrue(stack.size === 2);
55
55
  *
56
56
  * assert.deepStrictEqual(stack.pop(), Optional.some('second'));
57
57
  *
@@ -61,7 +61,7 @@ export type Stack<T> = Readonly<{
61
61
  *
62
62
  * const seededStack = createStack([10, 20, 30]);
63
63
  *
64
- * assert(seededStack.size === 3);
64
+ * assert.isTrue(seededStack.size === 3);
65
65
  *
66
66
  * assert.deepStrictEqual(seededStack.pop(), Optional.some(30));
67
67
  * ```
@@ -75,18 +75,18 @@ export type Stack<T> = Readonly<{
75
75
  * ```ts
76
76
  * const stack = createStack<string>();
77
77
  *
78
- * assert.ok(stack.isEmpty);
78
+ * assert.isTrue(stack.isEmpty);
79
79
  *
80
- * assert(stack.size === 0);
80
+ * assert.isTrue(stack.size === 0);
81
81
  *
82
82
  * stack.push('first');
83
83
  *
84
84
  * // eslint-disable-next-line unicorn/prefer-single-call
85
85
  * stack.push('second');
86
86
  *
87
- * assert.notOk(stack.isEmpty);
87
+ * assert.isFalse(stack.isEmpty);
88
88
  *
89
- * assert(stack.size === 2);
89
+ * assert.isTrue(stack.size === 2);
90
90
  *
91
91
  * assert.deepStrictEqual(stack.pop(), Optional.some('second'));
92
92
  *
@@ -96,7 +96,7 @@ export type Stack<T> = Readonly<{
96
96
  *
97
97
  * const seededStack = createStack([10, 20, 30]);
98
98
  *
99
- * assert(seededStack.size === 3);
99
+ * assert.isTrue(seededStack.size === 3);
100
100
  *
101
101
  * assert.deepStrictEqual(seededStack.pop(), Optional.some(30));
102
102
  * ```
@@ -110,18 +110,18 @@ export type Stack<T> = Readonly<{
110
110
  * ```ts
111
111
  * const stack = createStack<string>();
112
112
  *
113
- * assert.ok(stack.isEmpty);
113
+ * assert.isTrue(stack.isEmpty);
114
114
  *
115
- * assert(stack.size === 0);
115
+ * assert.isTrue(stack.size === 0);
116
116
  *
117
117
  * stack.push('first');
118
118
  *
119
119
  * // eslint-disable-next-line unicorn/prefer-single-call
120
120
  * stack.push('second');
121
121
  *
122
- * assert.notOk(stack.isEmpty);
122
+ * assert.isFalse(stack.isEmpty);
123
123
  *
124
- * assert(stack.size === 2);
124
+ * assert.isTrue(stack.size === 2);
125
125
  *
126
126
  * assert.deepStrictEqual(stack.pop(), Optional.some('second'));
127
127
  *
@@ -131,7 +131,7 @@ export type Stack<T> = Readonly<{
131
131
  *
132
132
  * const seededStack = createStack([10, 20, 30]);
133
133
  *
134
- * assert(seededStack.size === 3);
134
+ * assert.isTrue(seededStack.size === 3);
135
135
  *
136
136
  * assert.deepStrictEqual(seededStack.pop(), Optional.some(30));
137
137
  * ```
@@ -148,18 +148,18 @@ export type Stack<T> = Readonly<{
148
148
  * ```ts
149
149
  * const stack = createStack<string>();
150
150
  *
151
- * assert.ok(stack.isEmpty);
151
+ * assert.isTrue(stack.isEmpty);
152
152
  *
153
- * assert(stack.size === 0);
153
+ * assert.isTrue(stack.size === 0);
154
154
  *
155
155
  * stack.push('first');
156
156
  *
157
157
  * // eslint-disable-next-line unicorn/prefer-single-call
158
158
  * stack.push('second');
159
159
  *
160
- * assert.notOk(stack.isEmpty);
160
+ * assert.isFalse(stack.isEmpty);
161
161
  *
162
- * assert(stack.size === 2);
162
+ * assert.isTrue(stack.size === 2);
163
163
  *
164
164
  * assert.deepStrictEqual(stack.pop(), Optional.some('second'));
165
165
  *
@@ -169,7 +169,7 @@ export type Stack<T> = Readonly<{
169
169
  *
170
170
  * const seededStack = createStack([10, 20, 30]);
171
171
  *
172
- * assert(seededStack.size === 3);
172
+ * assert.isTrue(seededStack.size === 3);
173
173
  *
174
174
  * assert.deepStrictEqual(seededStack.pop(), Optional.some(30));
175
175
  * ```
@@ -207,18 +207,18 @@ export type Stack<T> = Readonly<{
207
207
  * ```ts
208
208
  * const stack = createStack<string>();
209
209
  *
210
- * assert.ok(stack.isEmpty);
210
+ * assert.isTrue(stack.isEmpty);
211
211
  *
212
- * assert(stack.size === 0);
212
+ * assert.isTrue(stack.size === 0);
213
213
  *
214
214
  * stack.push('first');
215
215
  *
216
216
  * // eslint-disable-next-line unicorn/prefer-single-call
217
217
  * stack.push('second');
218
218
  *
219
- * assert.notOk(stack.isEmpty);
219
+ * assert.isFalse(stack.isEmpty);
220
220
  *
221
- * assert(stack.size === 2);
221
+ * assert.isTrue(stack.size === 2);
222
222
  *
223
223
  * assert.deepStrictEqual(stack.pop(), Optional.some('second'));
224
224
  *
@@ -228,7 +228,7 @@ export type Stack<T> = Readonly<{
228
228
  *
229
229
  * const seededStack = createStack([10, 20, 30]);
230
230
  *
231
- * assert(seededStack.size === 3);
231
+ * assert.isTrue(seededStack.size === 3);
232
232
  *
233
233
  * assert.deepStrictEqual(seededStack.pop(), Optional.some(30));
234
234
  * ```
@@ -171,18 +171,18 @@ class StackClass {
171
171
  * ```ts
172
172
  * const stack = createStack<string>();
173
173
  *
174
- * assert.ok(stack.isEmpty);
174
+ * assert.isTrue(stack.isEmpty);
175
175
  *
176
- * assert(stack.size === 0);
176
+ * assert.isTrue(stack.size === 0);
177
177
  *
178
178
  * stack.push('first');
179
179
  *
180
180
  * // eslint-disable-next-line unicorn/prefer-single-call
181
181
  * stack.push('second');
182
182
  *
183
- * assert.notOk(stack.isEmpty);
183
+ * assert.isFalse(stack.isEmpty);
184
184
  *
185
- * assert(stack.size === 2);
185
+ * assert.isTrue(stack.size === 2);
186
186
  *
187
187
  * assert.deepStrictEqual(stack.pop(), Optional.some('second'));
188
188
  *
@@ -192,7 +192,7 @@ class StackClass {
192
192
  *
193
193
  * const seededStack = createStack([10, 20, 30]);
194
194
  *
195
- * assert(seededStack.size === 3);
195
+ * assert.isTrue(seededStack.size === 3);
196
196
  *
197
197
  * assert.deepStrictEqual(seededStack.pop(), Optional.some(30));
198
198
  * ```
@@ -31,7 +31,7 @@
31
31
  * published: 'Complete',
32
32
  * });
33
33
  *
34
- * assert(message === 'Work in progress');
34
+ * assert.isTrue(message === 'Work in progress');
35
35
  * ```
36
36
  *
37
37
  * @param target - The value to match against
@@ -8,13 +8,13 @@ import { type Unwrap } from './types.mjs';
8
8
  * ```ts
9
9
  * const optionalValue = Optional.some('data');
10
10
  *
11
- * assert(Optional.expectToBe(optionalValue, 'value expected') === 'data');
11
+ * assert.isTrue(Optional.expectToBe(optionalValue, 'value expected') === 'data');
12
12
  *
13
13
  * const expectValue = Optional.expectToBe<string>('missing optional');
14
14
  *
15
15
  * assert.throws(() => expectValue(Optional.none), /missing optional/u);
16
16
  *
17
- * assert(expectValue(Optional.some('present')) === 'present');
17
+ * assert.isTrue(expectValue(Optional.some('present')) === 'present');
18
18
  * ```
19
19
  *
20
20
  * @template O The `UnknownOptional` type to unwrap.
@@ -9,7 +9,7 @@ import { type NarrowToNone } from './types.mjs';
9
9
  *
10
10
  * if (Optional.isNone(optionalValue)) {
11
11
  * // Type narrowed to None
12
- * assert.ok(true); // optionalValue is None
12
+ * assert.isTrue(true); // optionalValue is None
13
13
  * }
14
14
  * ```
15
15
  *
@@ -10,7 +10,7 @@ import { NoneTypeTagName } from './tag.mjs';
10
10
  *
11
11
  * if (Optional.isNone(optionalValue)) {
12
12
  * // Type narrowed to None
13
- * assert.ok(true); // optionalValue is None
13
+ * assert.isTrue(true); // optionalValue is None
14
14
  * }
15
15
  * ```
16
16
  *
@@ -8,9 +8,9 @@
8
8
  *
9
9
  * const notOptional = { $$tag: 'ts-data-forge::Optional.some' };
10
10
  *
11
- * assert.ok(Optional.isOptional(maybeOptional));
11
+ * assert.isTrue(Optional.isOptional(maybeOptional));
12
12
  *
13
- * assert.notOk(Optional.isOptional(notOptional));
13
+ * assert.isFalse(Optional.isOptional(notOptional));
14
14
  * ```
15
15
  *
16
16
  * @param maybeOptional The value to check.
@@ -11,9 +11,9 @@ import { SomeTypeTagName, NoneTypeTagName } from './tag.mjs';
11
11
  *
12
12
  * const notOptional = { $$tag: 'ts-data-forge::Optional.some' };
13
13
  *
14
- * assert.ok(Optional.isOptional(maybeOptional));
14
+ * assert.isTrue(Optional.isOptional(maybeOptional));
15
15
  *
16
- * assert.notOk(Optional.isOptional(notOptional));
16
+ * assert.isFalse(Optional.isOptional(notOptional));
17
17
  * ```
18
18
  *
19
19
  * @param maybeOptional The value to check.
@@ -10,7 +10,7 @@ import { type NarrowToSome } from './types.mjs';
10
10
  * if (Optional.isSome(optionalNumber)) {
11
11
  * const value: number = optionalNumber.value;
12
12
  *
13
- * assert(value === 42);
13
+ * assert.isTrue(value === 42);
14
14
  * }
15
15
  * ```
16
16
  *
@@ -11,7 +11,7 @@ import { SomeTypeTagName } from './tag.mjs';
11
11
  * if (Optional.isSome(optionalNumber)) {
12
12
  * const value: number = optionalNumber.value;
13
13
  *
14
- * assert(value === 42);
14
+ * assert.isTrue(value === 42);
15
15
  * }
16
16
  * ```
17
17
  *
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * const noneValue = Optional.none;
11
11
  *
12
- * assert.ok(Optional.isSome(someValue));
12
+ * assert.isTrue(Optional.isSome(someValue));
13
13
  *
14
- * assert.ok(Optional.isNone(noneValue));
14
+ * assert.isTrue(Optional.isNone(noneValue));
15
15
  * ```
16
16
  */
17
17
  export declare const none: None;
@@ -11,9 +11,9 @@ import { NoneTypeTagName } from './tag.mjs';
11
11
  *
12
12
  * const noneValue = Optional.none;
13
13
  *
14
- * assert.ok(Optional.isSome(someValue));
14
+ * assert.isTrue(Optional.isSome(someValue));
15
15
  *
16
- * assert.ok(Optional.isNone(noneValue));
16
+ * assert.isTrue(Optional.isNone(noneValue));
17
17
  * ```
18
18
  */
19
19
  const none = { $$tag: NoneTypeTagName };
@@ -8,9 +8,9 @@
8
8
  *
9
9
  * const noneValue = Optional.none;
10
10
  *
11
- * assert.ok(Optional.isSome(someValue));
11
+ * assert.isTrue(Optional.isSome(someValue));
12
12
  *
13
- * assert.ok(Optional.isNone(noneValue));
13
+ * assert.isTrue(Optional.isNone(noneValue));
14
14
  * ```
15
15
  *
16
16
  * @template S The type of the value.
@@ -10,9 +10,9 @@ import { SomeTypeTagName } from './tag.mjs';
10
10
  *
11
11
  * const noneValue = Optional.none;
12
12
  *
13
- * assert.ok(Optional.isSome(someValue));
13
+ * assert.isTrue(Optional.isSome(someValue));
14
14
  *
15
- * assert.ok(Optional.isNone(noneValue));
15
+ * assert.isTrue(Optional.isNone(noneValue));
16
16
  * ```
17
17
  *
18
18
  * @template S The type of the value.
@@ -16,9 +16,9 @@ import { type Unwrap } from './types.mjs';
16
16
  *
17
17
  * const noneNumber = Optional.none as Optional<number>;
18
18
  *
19
- * assert(Optional.toNullable(someNumber) === 42);
19
+ * assert.isTrue(Optional.toNullable(someNumber) === 42);
20
20
  *
21
- * assert(Optional.toNullable(noneNumber) === undefined);
21
+ * assert.isTrue(Optional.toNullable(noneNumber) === undefined);
22
22
  * ```
23
23
  *
24
24
  * @template O The `UnknownOptional` type to convert.
@@ -18,9 +18,9 @@ import { unwrap } from './optional-unwrap.mjs';
18
18
  *
19
19
  * const noneNumber = Optional.none as Optional<number>;
20
20
  *
21
- * assert(Optional.toNullable(someNumber) === 42);
21
+ * assert.isTrue(Optional.toNullable(someNumber) === 42);
22
22
  *
23
- * assert(Optional.toNullable(noneNumber) === undefined);
23
+ * assert.isTrue(Optional.toNullable(noneNumber) === undefined);
24
24
  * ```
25
25
  *
26
26
  * @template O The `UnknownOptional` type to convert.
@@ -14,15 +14,15 @@ import { type Unwrap } from './types.mjs';
14
14
  *
15
15
  * const withoutValue = Optional.none as Optional<number>;
16
16
  *
17
- * assert(Optional.unwrapOr(withValue, 0) === 5);
17
+ * assert.isTrue(Optional.unwrapOr(withValue, 0) === 5);
18
18
  *
19
- * assert(Optional.unwrapOr(withoutValue, 0) === 0);
19
+ * assert.isTrue(Optional.unwrapOr(withoutValue, 0) === 0);
20
20
  *
21
21
  * const unwrapWithDefault = Optional.unwrapOr(10);
22
22
  *
23
- * assert(unwrapWithDefault(Optional.some(3)) === 3);
23
+ * assert.isTrue(unwrapWithDefault(Optional.some(3)) === 3);
24
24
  *
25
- * assert(unwrapWithDefault(Optional.none) === 10);
25
+ * assert.isTrue(unwrapWithDefault(Optional.none) === 10);
26
26
  * ```
27
27
  *
28
28
  * @template O The `UnknownOptional` type to unwrap.
@@ -12,7 +12,7 @@ import { type Unwrap } from './types.mjs';
12
12
  * ```ts
13
13
  * const present = Optional.some('available');
14
14
  *
15
- * assert(Optional.unwrapThrow(present) === 'available');
15
+ * assert.isTrue(Optional.unwrapThrow(present) === 'available');
16
16
  *
17
17
  * assert.throws(
18
18
  * () => Optional.unwrapThrow(Optional.none),
@@ -13,7 +13,7 @@ import { isSome } from './optional-is-some.mjs';
13
13
  * ```ts
14
14
  * const present = Optional.some('available');
15
15
  *
16
- * assert(Optional.unwrapThrow(present) === 'available');
16
+ * assert.isTrue(Optional.unwrapThrow(present) === 'available');
17
17
  *
18
18
  * assert.throws(
19
19
  * () => Optional.unwrapThrow(Optional.none),
@@ -16,9 +16,9 @@ import { type Unwrap } from './types.mjs';
16
16
  *
17
17
  * const noneString = Optional.none as Optional<string>;
18
18
  *
19
- * assert(Optional.unwrap(someString) === 'text');
19
+ * assert.isTrue(Optional.unwrap(someString) === 'text');
20
20
  *
21
- * assert(Optional.unwrap(noneString) === undefined);
21
+ * assert.isTrue(Optional.unwrap(noneString) === undefined);
22
22
  * ```
23
23
  *
24
24
  * @template O The `UnknownOptional` type to unwrap.
@@ -7,7 +7,7 @@
7
7
  * ```ts
8
8
  * const zipped = Optional.zip(Optional.some('left'), Optional.some(1));
9
9
  *
10
- * assert.ok(Optional.isSome(zipped));
10
+ * assert.isTrue(Optional.isSome(zipped));
11
11
  *
12
12
  * if (Optional.isSome(zipped)) {
13
13
  * const expected: readonly [string, number] = ['left', 1];
@@ -11,7 +11,7 @@ import { some } from './optional-some.mjs';
11
11
  * ```ts
12
12
  * const zipped = Optional.zip(Optional.some('left'), Optional.some(1));
13
13
  *
14
- * assert.ok(Optional.isSome(zipped));
14
+ * assert.isTrue(Optional.isSome(zipped));
15
15
  *
16
16
  * if (Optional.isSome(zipped)) {
17
17
  * const expected: readonly [string, number] = ['left', 1];
@@ -65,7 +65,7 @@ type PipeBase<A> = Readonly<{
65
65
  * value.toUpperCase(),
66
66
  * );
67
67
  *
68
- * assert(empty.value === undefined);
68
+ * assert.isTrue(empty.value === undefined);
69
69
  * ```
70
70
  *
71
71
  * @template B The type of the transformed value.
@@ -100,7 +100,7 @@ type PipeWithMapOptional<A extends UnknownOptional> = MergeIntersection<PipeBase
100
100
  * (value) => value * 2,
101
101
  * );
102
102
  *
103
- * assert.ok(Optional.isNone(empty.value));
103
+ * assert.isTrue(Optional.isNone(empty.value));
104
104
  * ```
105
105
  *
106
106
  * @template B The type of the transformed inner value.
@@ -16,7 +16,7 @@
16
16
  * value: { id: 1 },
17
17
  * });
18
18
  *
19
- * assert.ok(Result.isErr(failure));
19
+ * assert.isTrue(Result.isErr(failure));
20
20
  * ```
21
21
  *
22
22
  * @template E The type of the error value.
@@ -18,7 +18,7 @@ import { ErrTypeTagName } from './tag.mjs';
18
18
  * value: { id: 1 },
19
19
  * });
20
20
  *
21
- * assert.ok(Result.isErr(failure));
21
+ * assert.isTrue(Result.isErr(failure));
22
22
  * ```
23
23
  *
24
24
  * @template E The type of the error value.
@@ -8,13 +8,13 @@ import { type UnwrapOk } from './types.mjs';
8
8
  * ```ts
9
9
  * const okValue = Result.ok('data');
10
10
  *
11
- * assert(Result.expectToBe(okValue, 'should have value') === 'data');
11
+ * assert.isTrue(Result.expectToBe(okValue, 'should have value') === 'data');
12
12
  *
13
13
  * const expectResult = Result.expectToBe<string>('missing result');
14
14
  *
15
15
  * assert.throws(() => expectResult(Result.err('boom')), /missing result/u);
16
16
  *
17
- * assert(expectResult(Result.ok('value')) === 'value');
17
+ * assert.isTrue(expectResult(Result.ok('value')) === 'value');
18
18
  * ```
19
19
  *
20
20
  * @template R The `UnknownResult` type to unwrap.
@@ -23,7 +23,7 @@ type UnwrapPromise<P extends Promise<unknown>> = P extends Promise<infer V> ? V
23
23
  *
24
24
  * assert.deepStrictEqual(resolved, Result.ok('ok'));
25
25
  *
26
- * assert.ok(Result.isErr(rejected));
26
+ * assert.isTrue(Result.isErr(rejected));
27
27
  * ```
28
28
  *
29
29
  * @template P The type of the input Promise.
@@ -20,7 +20,7 @@ import { ok } from './result-ok.mjs';
20
20
  *
21
21
  * assert.deepStrictEqual(resolved, Result.ok('ok'));
22
22
  *
23
- * assert.ok(Result.isErr(rejected));
23
+ * assert.isTrue(Result.isErr(rejected));
24
24
  * ```
25
25
  *
26
26
  * @template P The type of the input Promise.
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * assert.deepStrictEqual(success, Result.ok(2));
21
21
  *
22
- * assert.ok(Result.isErr(failure));
22
+ * assert.isTrue(Result.isErr(failure));
23
23
  * ```
24
24
  *
25
25
  * @template T The return type of the function.
@@ -24,7 +24,7 @@ import { ok } from './result-ok.mjs';
24
24
  *
25
25
  * assert.deepStrictEqual(success, Result.ok(2));
26
26
  *
27
- * assert.ok(Result.isErr(failure));
27
+ * assert.isTrue(Result.isErr(failure));
28
28
  * ```
29
29
  *
30
30
  * @template T The return type of the function.
@@ -12,10 +12,10 @@ import { type NarrowToErr } from './types.mjs';
12
12
  * if (Result.isOk(operation)) {
13
13
  * const value: number = operation.value;
14
14
  *
15
- * assert(value === 3);
15
+ * assert.isTrue(value === 3);
16
16
  * }
17
17
  *
18
- * assert.ok(Result.isErr(failure));
18
+ * assert.isTrue(Result.isErr(failure));
19
19
  * ```
20
20
  */
21
21
  export declare const isErr: <R extends UnknownResult>(result: R) => result is NarrowToErr<R>;
@@ -13,10 +13,10 @@ import { ErrTypeTagName } from './tag.mjs';
13
13
  * if (Result.isOk(operation)) {
14
14
  * const value: number = operation.value;
15
15
  *
16
- * assert(value === 3);
16
+ * assert.isTrue(value === 3);
17
17
  * }
18
18
  *
19
- * assert.ok(Result.isErr(failure));
19
+ * assert.isTrue(Result.isErr(failure));
20
20
  * ```
21
21
  */
22
22
  const isErr = (result) => result.$$tag === ErrTypeTagName;
@@ -12,10 +12,10 @@ import { type NarrowToOk } from './types.mjs';
12
12
  * if (Result.isOk(operation)) {
13
13
  * const value: number = operation.value;
14
14
  *
15
- * assert(value === 3);
15
+ * assert.isTrue(value === 3);
16
16
  * }
17
17
  *
18
- * assert.ok(Result.isErr(failure));
18
+ * assert.isTrue(Result.isErr(failure));
19
19
  * ```
20
20
  */
21
21
  export declare const isOk: <R extends UnknownResult>(result: R) => result is NarrowToOk<R>;
@@ -13,10 +13,10 @@ import { OkTypeTagName } from './tag.mjs';
13
13
  * if (Result.isOk(operation)) {
14
14
  * const value: number = operation.value;
15
15
  *
16
- * assert(value === 3);
16
+ * assert.isTrue(value === 3);
17
17
  * }
18
18
  *
19
- * assert.ok(Result.isErr(failure));
19
+ * assert.isTrue(Result.isErr(failure));
20
20
  * ```
21
21
  */
22
22
  const isOk = (result) => result.$$tag === OkTypeTagName;
@@ -10,11 +10,11 @@
10
10
  *
11
11
  * const notResult = { $$tag: 'ts-data-forge::Result.ok' };
12
12
  *
13
- * assert.ok(Result.isResult(okValue));
13
+ * assert.isTrue(Result.isResult(okValue));
14
14
  *
15
- * assert.ok(Result.isResult(errValue));
15
+ * assert.isTrue(Result.isResult(errValue));
16
16
  *
17
- * assert.notOk(Result.isResult(notResult));
17
+ * assert.isFalse(Result.isResult(notResult));
18
18
  * ```
19
19
  */
20
20
  export declare const isResult: (maybeResult: unknown) => maybeResult is UnknownResult;
@@ -14,11 +14,11 @@ import { ErrTypeTagName, OkTypeTagName } from './tag.mjs';
14
14
  *
15
15
  * const notResult = { $$tag: 'ts-data-forge::Result.ok' };
16
16
  *
17
- * assert.ok(Result.isResult(okValue));
17
+ * assert.isTrue(Result.isResult(okValue));
18
18
  *
19
- * assert.ok(Result.isResult(errValue));
19
+ * assert.isTrue(Result.isResult(errValue));
20
20
  *
21
- * assert.notOk(Result.isResult(notResult));
21
+ * assert.isFalse(Result.isResult(notResult));
22
22
  * ```
23
23
  */
24
24
  const isResult = (maybeResult) => isRecord(maybeResult) &&
@@ -16,7 +16,7 @@
16
16
  * value: { id: 1 },
17
17
  * });
18
18
  *
19
- * assert.ok(Result.isErr(failure));
19
+ * assert.isTrue(Result.isErr(failure));
20
20
  * ```
21
21
  *
22
22
  * @template S The type of the success value.
@@ -18,7 +18,7 @@ import { OkTypeTagName } from './tag.mjs';
18
18
  * value: { id: 1 },
19
19
  * });
20
20
  *
21
- * assert.ok(Result.isErr(failure));
21
+ * assert.isTrue(Result.isErr(failure));
22
22
  * ```
23
23
  *
24
24
  * @template S The type of the success value.