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
@@ -10,9 +10,9 @@
10
10
  *
11
11
  * const differentNumbers = [1, 2, 4] as const;
12
12
  *
13
- * assert.ok(Arr.eq(numbers, sameNumbers));
13
+ * assert.isTrue(Arr.eq(numbers, sameNumbers));
14
14
  *
15
- * assert.notOk(Arr.eq(numbers, differentNumbers));
15
+ * assert.isFalse(Arr.eq(numbers, differentNumbers));
16
16
  * ```
17
17
  */
18
18
  export const eq = <E,>(
@@ -43,9 +43,9 @@ export const equal = eq;
43
43
  *
44
44
  * const notSubset = [2, 4] as const;
45
45
  *
46
- * assert.ok(Arr.isSubset(subset, superset));
46
+ * assert.isTrue(Arr.isSubset(subset, superset));
47
47
  *
48
- * assert.notOk(Arr.isSubset(notSubset, superset));
48
+ * assert.isFalse(Arr.isSubset(notSubset, superset));
49
49
  * ```
50
50
  */
51
51
  export const isSubset = <E1 extends Primitive, E2 extends Primitive = E1>(
@@ -69,11 +69,11 @@ export const isSubset = <E1 extends Primitive, E2 extends Primitive = E1>(
69
69
  *
70
70
  * const notSuperset = ['a', 'd'] as const;
71
71
  *
72
- * assert.ok(Arr.isSuperset(potentialSuperset, subset));
72
+ * assert.isTrue(Arr.isSuperset(potentialSuperset, subset));
73
73
  *
74
- * assert.notOk(Arr.isSuperset(subset, potentialSuperset));
74
+ * assert.isFalse(Arr.isSuperset(subset, potentialSuperset));
75
75
  *
76
- * assert.notOk(Arr.isSuperset(potentialSuperset, notSuperset));
76
+ * assert.isFalse(Arr.isSuperset(potentialSuperset, notSuperset));
77
77
  * ```
78
78
  */
79
79
  export const isSuperset = <E1 extends Primitive, E2 extends Primitive = E1>(
@@ -20,7 +20,7 @@ describe('Arr set operations', () => {
20
20
  expectType<typeof result, boolean>('=');
21
21
 
22
22
  test('should return true for equal arrays of numbers', () => {
23
- expect(result).toBe(true);
23
+ assert.isTrue(result);
24
24
  });
25
25
  }
26
26
 
@@ -34,7 +34,7 @@ describe('Arr set operations', () => {
34
34
  expectType<typeof result, boolean>('=');
35
35
 
36
36
  test('should return false for different arrays of numbers', () => {
37
- expect(result).toBe(false);
37
+ assert.isFalse(result);
38
38
  });
39
39
  }
40
40
 
@@ -48,7 +48,7 @@ describe('Arr set operations', () => {
48
48
  expectType<typeof result, boolean>('=');
49
49
 
50
50
  test('should return false for arrays of different lengths', () => {
51
- expect(result).toBe(false);
51
+ assert.isFalse(result);
52
52
  });
53
53
  }
54
54
 
@@ -62,7 +62,7 @@ describe('Arr set operations', () => {
62
62
  expectType<typeof result, boolean>('=');
63
63
 
64
64
  test('should return true for equal arrays of strings', () => {
65
- expect(result).toBe(true);
65
+ assert.isTrue(result);
66
66
  });
67
67
  }
68
68
 
@@ -76,7 +76,7 @@ describe('Arr set operations', () => {
76
76
  expectType<typeof result, boolean>('=');
77
77
 
78
78
  test('should return true for empty arrays', () => {
79
- expect(result).toBe(true);
79
+ assert.isTrue(result);
80
80
  });
81
81
  }
82
82
 
@@ -91,7 +91,7 @@ describe('Arr set operations', () => {
91
91
  expectType<typeof result, boolean>('=');
92
92
 
93
93
  test('should return false for arrays of objects with default equality (reference check)', () => {
94
- expect(result).toBe(false);
94
+ assert.isFalse(result);
95
95
  });
96
96
  }
97
97
 
@@ -109,7 +109,7 @@ describe('Arr set operations', () => {
109
109
  expectType<typeof result, boolean>('=');
110
110
 
111
111
  test('should return true for arrays of same object references', () => {
112
- expect(result).toBe(true);
112
+ assert.isTrue(result);
113
113
  });
114
114
  }
115
115
 
@@ -127,7 +127,7 @@ describe('Arr set operations', () => {
127
127
  expectType<typeof result, boolean>('=');
128
128
 
129
129
  test('should return true for arrays of objects with custom equality function', () => {
130
- expect(result).toBe(true);
130
+ assert.isTrue(result);
131
131
  });
132
132
  }
133
133
  });
@@ -143,7 +143,7 @@ describe('Arr set operations', () => {
143
143
  expectType<typeof result, boolean>('=');
144
144
 
145
145
  test('case 1', () => {
146
- expect(result).toBe(true);
146
+ assert.isTrue(result);
147
147
  });
148
148
  }
149
149
 
@@ -157,7 +157,7 @@ describe('Arr set operations', () => {
157
157
  expectType<typeof result, boolean>('=');
158
158
 
159
159
  test('case 2', () => {
160
- expect(result).toBe(false);
160
+ assert.isFalse(result);
161
161
  });
162
162
  }
163
163
  });
@@ -173,13 +173,13 @@ describe('Arr set operations', () => {
173
173
  expectType<typeof result, boolean>('=');
174
174
 
175
175
  test('case 1', () => {
176
- expect(result).toBe(false);
176
+ assert.isFalse(result);
177
177
  });
178
178
 
179
179
  const result2 = isSuperset(xs, ys);
180
180
 
181
181
  test('case 2', () => {
182
- expect(result2).toBe(true);
182
+ assert.isTrue(result2);
183
183
  });
184
184
  }
185
185
 
@@ -193,7 +193,7 @@ describe('Arr set operations', () => {
193
193
  expectType<typeof result, boolean>('=');
194
194
 
195
195
  test('case 3', () => {
196
- expect(result).toBe(false);
196
+ assert.isFalse(result);
197
197
  });
198
198
  }
199
199
  });
@@ -12,9 +12,9 @@
12
12
  *
13
13
  * const sizeOfLetters = Arr.size(letters);
14
14
  *
15
- * assert(sizeOfNumbers === 3);
15
+ * assert.isTrue(sizeOfNumbers === 3);
16
16
  *
17
- * assert(sizeOfLetters === 0);
17
+ * assert.isTrue(sizeOfLetters === 0);
18
18
  * ```
19
19
  */
20
20
  export const size = <const Ar extends readonly unknown[]>(
@@ -16,7 +16,7 @@ import { isEmpty } from './array-utils-validation.mjs';
16
16
  *
17
17
  * assert.deepStrictEqual(remainder, ['Grace', 'Katherine']);
18
18
  *
19
- * assert(remainder.length === 2);
19
+ * assert.isTrue(remainder.length === 2);
20
20
  * }
21
21
  *
22
22
  * {
@@ -50,7 +50,7 @@ export const tail = <const Ar extends readonly unknown[]>(
50
50
  *
51
51
  * assert.deepStrictEqual(withoutLast, ['task-1', 'task-2']);
52
52
  *
53
- * assert(withoutLast.length === 2);
53
+ * assert.isTrue(withoutLast.length === 2);
54
54
  * ```
55
55
  */
56
56
  export const butLast = <const Ar extends readonly unknown[]>(
@@ -893,9 +893,9 @@ describe('Arr transformations', () => {
893
893
 
894
894
  const vegetables = grouped.get('vegetable');
895
895
 
896
- expect(Optional.isSome(fruits)).toBe(true);
896
+ assert.isTrue(Optional.isSome(fruits));
897
897
 
898
- expect(Optional.isSome(vegetables)).toBe(true);
898
+ assert.isTrue(Optional.isSome(vegetables));
899
899
 
900
900
  if (Optional.isSome(fruits)) {
901
901
  expect(fruits.value).toHaveLength(2);
@@ -10,9 +10,9 @@ import { asUint32, Num } from '../../number/index.mjs';
10
10
  *
11
11
  * const maybeValue: unknown = 'Ada';
12
12
  *
13
- * assert.ok(Arr.isArray(maybeArray));
13
+ * assert.isTrue(Arr.isArray(maybeArray));
14
14
  *
15
- * assert.notOk(Arr.isArray(maybeValue));
15
+ * assert.isFalse(Arr.isArray(maybeValue));
16
16
  *
17
17
  * if (Arr.isArray(maybeArray)) {
18
18
  * assert.deepStrictEqual(maybeArray, [1, 2, 3]);
@@ -45,9 +45,9 @@ type Cast<A, B> = A extends B ? A : never;
45
45
  *
46
46
  * const words = ['Ada', 'Lovelace'] as const;
47
47
  *
48
- * assert.ok(Arr.isEmpty(emptyNumbers));
48
+ * assert.isTrue(Arr.isEmpty(emptyNumbers));
49
49
  *
50
- * assert.notOk(Arr.isEmpty(words));
50
+ * assert.isFalse(Arr.isEmpty(words));
51
51
  *
52
52
  * if (Arr.isEmpty(emptyNumbers)) {
53
53
  * assert.deepStrictEqual(emptyNumbers, []);
@@ -67,9 +67,9 @@ export const isEmpty = <E,>(array: readonly E[]): array is readonly [] =>
67
67
  *
68
68
  * const emptyUsers: readonly { id: number }[] = [];
69
69
  *
70
- * assert.ok(Arr.isNonEmpty(users));
70
+ * assert.isTrue(Arr.isNonEmpty(users));
71
71
  *
72
- * assert.notOk(Arr.isNonEmpty(emptyUsers));
72
+ * assert.isFalse(Arr.isNonEmpty(emptyUsers));
73
73
  *
74
74
  * if (Arr.isNonEmpty(users)) {
75
75
  * assert.deepStrictEqual(users[0], { id: 1 });
@@ -90,9 +90,9 @@ export const isNonEmpty = <E,>(
90
90
  *
91
91
  * const triple: readonly number[] = [1, 2, 3];
92
92
  *
93
- * assert.ok(Arr.isArrayOfLength(pair, 2));
93
+ * assert.isTrue(Arr.isArrayOfLength(pair, 2));
94
94
  *
95
- * assert.notOk(Arr.isArrayOfLength(triple, 2));
95
+ * assert.isFalse(Arr.isArrayOfLength(triple, 2));
96
96
  *
97
97
  * if (Arr.isArrayOfLength(pair, 2)) {
98
98
  * assert.deepStrictEqual(pair, [1, 2]);
@@ -114,12 +114,12 @@ export const isArrayOfLength = <E, N extends SizeType.ArgArr>(
114
114
  *
115
115
  * const emptyQueue: readonly string[] = [];
116
116
  *
117
- * assert.ok(Arr.isArrayAtLeastLength(queue, 1));
117
+ * assert.isTrue(Arr.isArrayAtLeastLength(queue, 1));
118
118
  *
119
- * assert.notOk(Arr.isArrayAtLeastLength(emptyQueue, 1));
119
+ * assert.isFalse(Arr.isArrayAtLeastLength(emptyQueue, 1));
120
120
  *
121
121
  * if (Arr.isArrayAtLeastLength(queue, 1)) {
122
- * assert(queue[0] === 'task-1');
122
+ * assert.isTrue(queue[0] === 'task-1');
123
123
  * }
124
124
  * ```
125
125
  */
@@ -142,9 +142,9 @@ export const isArrayAtLeastLength = <E, N extends SizeType.ArgArr>(
142
142
  *
143
143
  * const allStartWithA = Arr.every(words, (value) => value.startsWith('A'));
144
144
  *
145
- * assert.ok(allEven);
145
+ * assert.isTrue(allEven);
146
146
  *
147
- * assert.notOk(allStartWithA);
147
+ * assert.isFalse(allStartWithA);
148
148
  * ```
149
149
  */
150
150
  // Type guard overloads - narrow the entire array type
@@ -204,9 +204,9 @@ export function every<E>(
204
204
  *
205
205
  * const hasShortName = Arr.some(words, (value) => value.length <= 3);
206
206
  *
207
- * assert.notOk(hasEven);
207
+ * assert.isFalse(hasEven);
208
208
  *
209
- * assert.ok(hasShortName);
209
+ * assert.isTrue(hasShortName);
210
210
  * ```
211
211
  */
212
212
  export function some<const Ar extends readonly unknown[]>(
@@ -249,12 +249,12 @@ export function some<E>(
249
249
  * ```ts
250
250
  * const items = ['Ada', 'Grace', 'Katherine'] as const;
251
251
  *
252
- * assert.ok(Arr.indexIsInRange(items, 1));
252
+ * assert.isTrue(Arr.indexIsInRange(items, 1));
253
253
  *
254
- * assert.notOk(Arr.indexIsInRange(items, 3));
254
+ * assert.isFalse(Arr.indexIsInRange(items, 3));
255
255
  *
256
256
  * if (Arr.indexIsInRange(items, 2)) {
257
- * assert(items[2] === 'Katherine');
257
+ * assert.isTrue(items[2] === 'Katherine');
258
258
  * }
259
259
  * ```
260
260
  */