ts-data-forge 5.1.0 → 5.1.1

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 (226) 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/key-is-in.d.mts +2 -2
  82. package/dist/guard/key-is-in.mjs +2 -2
  83. package/dist/json/json.d.mts +21 -21
  84. package/dist/json/json.mjs +21 -21
  85. package/dist/number/branded-types/int.d.mts +19 -19
  86. package/dist/number/branded-types/int.mjs +19 -19
  87. package/dist/number/branded-types/positive-int.d.mts +20 -20
  88. package/dist/number/branded-types/positive-int.mjs +20 -20
  89. package/dist/number/branded-types/positive-safe-int.d.mts +26 -26
  90. package/dist/number/branded-types/positive-safe-int.mjs +26 -26
  91. package/dist/number/branded-types/safe-int.d.mts +27 -27
  92. package/dist/number/branded-types/safe-int.mjs +27 -27
  93. package/dist/number/branded-types/uint.d.mts +19 -19
  94. package/dist/number/branded-types/uint.mjs +19 -19
  95. package/dist/number/num.d.mts +20 -20
  96. package/dist/number/num.mjs +16 -16
  97. package/dist/number/refined-number-utils.d.mts +11 -11
  98. package/dist/number/refined-number-utils.d.mts.map +1 -1
  99. package/dist/number/refined-number-utils.mjs +11 -11
  100. package/dist/object/object.d.mts +3 -3
  101. package/dist/object/object.d.mts.map +1 -1
  102. package/dist/object/object.mjs +3 -3
  103. package/dist/object/object.mjs.map +1 -1
  104. package/dist/others/tuple.d.mts +3 -3
  105. package/dist/others/tuple.mjs +3 -3
  106. package/dist/promise/promise.d.mts +4 -4
  107. package/dist/promise/promise.mjs +4 -4
  108. package/package.json +15 -13
  109. package/src/array/impl/array-utils-creation.test.mts +1 -1
  110. package/src/array/impl/array-utils-element-access.test.mts +16 -16
  111. package/src/array/impl/array-utils-modification.mts +38 -19
  112. package/src/array/impl/array-utils-reducing-value.mts +8 -8
  113. package/src/array/impl/array-utils-reducing-value.test.mts +23 -31
  114. package/src/array/impl/array-utils-search.mts +4 -4
  115. package/src/array/impl/array-utils-search.test.mts +10 -10
  116. package/src/array/impl/array-utils-set-op.mts +7 -7
  117. package/src/array/impl/array-utils-set-op.test.mts +13 -13
  118. package/src/array/impl/array-utils-size.mts +2 -2
  119. package/src/array/impl/array-utils-slicing.mts +2 -2
  120. package/src/array/impl/array-utils-transformation.test.mts +2 -2
  121. package/src/array/impl/array-utils-validation.mts +18 -18
  122. package/src/array/impl/array-utils-validation.test.mts +80 -78
  123. package/src/array/impl/array.test.mts +6 -6
  124. package/src/collections/imap-mapped.test.mts +16 -18
  125. package/src/collections/imap.mts +15 -15
  126. package/src/collections/imap.test.mts +31 -31
  127. package/src/collections/iset-mapped.mts +19 -19
  128. package/src/collections/iset-mapped.test.mts +52 -52
  129. package/src/collections/iset.mts +19 -19
  130. package/src/collections/iset.test.mts +130 -130
  131. package/src/collections/queue.mts +25 -25
  132. package/src/collections/queue.test.mts +33 -35
  133. package/src/collections/stack.mts +25 -25
  134. package/src/collections/stack.test.mts +15 -15
  135. package/src/functional/match.mts +1 -1
  136. package/src/functional/optional/impl/optional-expect-to-be.mts +2 -2
  137. package/src/functional/optional/impl/optional-is-none.mts +1 -1
  138. package/src/functional/optional/impl/optional-is-optional.mts +2 -2
  139. package/src/functional/optional/impl/optional-is-some.mts +1 -1
  140. package/src/functional/optional/impl/optional-none.mts +2 -2
  141. package/src/functional/optional/impl/optional-some.mts +2 -2
  142. package/src/functional/optional/impl/optional-to-nullable.mts +2 -2
  143. package/src/functional/optional/impl/optional-unwrap-or.mts +4 -4
  144. package/src/functional/optional/impl/optional-unwrap-throw.mts +1 -1
  145. package/src/functional/optional/impl/optional-unwrap.mts +2 -2
  146. package/src/functional/optional/impl/optional-zip.mts +1 -1
  147. package/src/functional/optional.test.mts +53 -54
  148. package/src/functional/pipe.mts +2 -2
  149. package/src/functional/pipe.test.mts +4 -4
  150. package/src/functional/result/impl/result-err.mts +1 -1
  151. package/src/functional/result/impl/result-expect-to-be.mts +2 -2
  152. package/src/functional/result/impl/result-from-promise.mts +1 -1
  153. package/src/functional/result/impl/result-from-throwable.mts +1 -1
  154. package/src/functional/result/impl/result-is-err.mts +2 -2
  155. package/src/functional/result/impl/result-is-ok.mts +2 -2
  156. package/src/functional/result/impl/result-is-result.mts +3 -3
  157. package/src/functional/result/impl/result-ok.mts +1 -1
  158. package/src/functional/result/impl/result-unwrap-err-or.mts +4 -4
  159. package/src/functional/result/impl/result-unwrap-err-throw.mts +1 -1
  160. package/src/functional/result/impl/result-unwrap-err.mts +2 -2
  161. package/src/functional/result/impl/result-unwrap-ok-or.mts +4 -4
  162. package/src/functional/result/impl/result-unwrap-ok.mts +2 -2
  163. package/src/functional/result/impl/result-unwrap-throw.mts +1 -1
  164. package/src/functional/result.test.mts +94 -152
  165. package/src/functional/ternary-result/impl/ternary-result-err.mts +1 -1
  166. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +1 -1
  167. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +1 -1
  168. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +3 -3
  169. package/src/functional/ternary-result.test.mts +8 -8
  170. package/src/globals.d.mts +2 -1
  171. package/src/guard/has-key.mts +8 -5
  172. package/src/guard/has-key.test.mts +0 -5
  173. package/src/guard/is-error.test.mts +143 -0
  174. package/src/guard/is-non-empty-string.test.mts +24 -24
  175. package/src/guard/is-non-null-object.test.mts +26 -26
  176. package/src/guard/is-primitive.test.mts +28 -28
  177. package/src/guard/is-record.test.mts +7 -7
  178. package/src/guard/is-type.test.mts +151 -155
  179. package/src/guard/key-is-in.mts +2 -2
  180. package/src/guard/key-is-in.test.mts +2 -2
  181. package/src/json/json.mts +21 -21
  182. package/src/json/json.test.mts +135 -174
  183. package/src/number/branded-types/finite-number.test.mts +13 -11
  184. package/src/number/branded-types/int.mts +19 -19
  185. package/src/number/branded-types/int.test.mts +14 -14
  186. package/src/number/branded-types/int16.test.mts +16 -16
  187. package/src/number/branded-types/int32.test.mts +16 -16
  188. package/src/number/branded-types/non-negative-finite-number.test.mts +12 -12
  189. package/src/number/branded-types/non-negative-int16.test.mts +16 -16
  190. package/src/number/branded-types/non-negative-int32.test.mts +16 -16
  191. package/src/number/branded-types/non-zero-finite-number.test.mts +14 -14
  192. package/src/number/branded-types/non-zero-int.test.mts +19 -19
  193. package/src/number/branded-types/non-zero-int16.test.mts +16 -16
  194. package/src/number/branded-types/non-zero-int32.test.mts +16 -16
  195. package/src/number/branded-types/non-zero-safe-int.test.mts +23 -23
  196. package/src/number/branded-types/non-zero-uint16.test.mts +16 -16
  197. package/src/number/branded-types/non-zero-uint32.test.mts +16 -16
  198. package/src/number/branded-types/positive-finite-number.test.mts +14 -14
  199. package/src/number/branded-types/positive-int.mts +20 -20
  200. package/src/number/branded-types/positive-int.test.mts +17 -17
  201. package/src/number/branded-types/positive-int16.test.mts +15 -15
  202. package/src/number/branded-types/positive-int32.test.mts +15 -15
  203. package/src/number/branded-types/positive-safe-int.mts +26 -26
  204. package/src/number/branded-types/positive-safe-int.test.mts +19 -19
  205. package/src/number/branded-types/positive-uint16.test.mts +16 -16
  206. package/src/number/branded-types/positive-uint32.test.mts +16 -16
  207. package/src/number/branded-types/safe-int.mts +27 -27
  208. package/src/number/branded-types/safe-int.test.mts +18 -18
  209. package/src/number/branded-types/safe-uint.test.mts +17 -17
  210. package/src/number/branded-types/uint.mts +19 -19
  211. package/src/number/branded-types/uint.test.mts +15 -15
  212. package/src/number/branded-types/uint16.test.mts +15 -15
  213. package/src/number/branded-types/uint32.test.mts +15 -15
  214. package/src/number/enum/int8.test.mts +1 -1
  215. package/src/number/enum/uint8.test.mts +1 -1
  216. package/src/number/num.mts +20 -20
  217. package/src/number/num.test.mts +26 -26
  218. package/src/number/refined-number-utils.mts +13 -13
  219. package/src/object/object.mts +4 -3
  220. package/src/object/object.test.mts +6 -6
  221. package/src/others/cast-mutable.test.mts +1 -1
  222. package/src/others/cast-readonly.test.mts +4 -4
  223. package/src/others/if-then.test.mts +24 -24
  224. package/src/others/tuple.mts +3 -3
  225. package/src/promise/promise.mts +4 -4
  226. package/src/promise/promise.test.mts +7 -13
@@ -60,35 +60,35 @@ describe('NonZeroInt test', () => {
60
60
 
61
61
  describe(isNonZeroInt, () => {
62
62
  test('correctly identifies non-zero integers', () => {
63
- expect(isNonZeroInt(1)).toBe(true);
63
+ assert.isTrue(isNonZeroInt(1));
64
64
 
65
- expect(isNonZeroInt(-1)).toBe(true);
65
+ assert.isTrue(isNonZeroInt(-1));
66
66
 
67
- expect(isNonZeroInt(42)).toBe(true);
67
+ assert.isTrue(isNonZeroInt(42));
68
68
 
69
- expect(isNonZeroInt(-42)).toBe(true);
69
+ assert.isTrue(isNonZeroInt(-42));
70
70
 
71
- expect(isNonZeroInt(Number.MAX_SAFE_INTEGER)).toBe(true);
71
+ assert.isTrue(isNonZeroInt(Number.MAX_SAFE_INTEGER));
72
72
 
73
- expect(isNonZeroInt(Number.MIN_SAFE_INTEGER)).toBe(true);
73
+ assert.isTrue(isNonZeroInt(Number.MIN_SAFE_INTEGER));
74
74
  });
75
75
 
76
76
  test('correctly identifies zero', () => {
77
- expect(isNonZeroInt(0)).toBe(false);
77
+ assert.isFalse(isNonZeroInt(0));
78
78
 
79
- expect(isNonZeroInt(-0)).toBe(false);
79
+ assert.isFalse(isNonZeroInt(-0));
80
80
  });
81
81
 
82
82
  test('correctly identifies non-integers', () => {
83
- expect(isNonZeroInt(Number.NaN)).toBe(false);
83
+ assert.isFalse(isNonZeroInt(Number.NaN));
84
84
 
85
- expect(isNonZeroInt(Number.POSITIVE_INFINITY)).toBe(false);
85
+ assert.isFalse(isNonZeroInt(Number.POSITIVE_INFINITY));
86
86
 
87
- expect(isNonZeroInt(Number.NEGATIVE_INFINITY)).toBe(false);
87
+ assert.isFalse(isNonZeroInt(Number.NEGATIVE_INFINITY));
88
88
 
89
- expect(isNonZeroInt(1.2)).toBe(false);
89
+ assert.isFalse(isNonZeroInt(1.2));
90
90
 
91
- expect(isNonZeroInt(-3.4)).toBe(false);
91
+ assert.isFalse(isNonZeroInt(-3.4));
92
92
  });
93
93
  });
94
94
 
@@ -175,9 +175,9 @@ describe('NonZeroInt test', () => {
175
175
 
176
176
  expect(result).toBeLessThanOrEqual(max);
177
177
 
178
- expect(NonZeroInt.is(result)).toBe(true);
178
+ assert.isTrue(NonZeroInt.is(result));
179
179
 
180
- expect(Number.isInteger(result)).toBe(true);
180
+ assert.isTrue(Number.isInteger(result));
181
181
 
182
182
  expect(result).not.toBe(0);
183
183
  }
@@ -195,9 +195,9 @@ describe('NonZeroInt test', () => {
195
195
 
196
196
  expect(result).toBeLessThanOrEqual(max);
197
197
 
198
- expect(NonZeroInt.is(result)).toBe(true);
198
+ assert.isTrue(NonZeroInt.is(result));
199
199
 
200
- expect(Number.isInteger(result)).toBe(true);
200
+ assert.isTrue(Number.isInteger(result));
201
201
 
202
202
  expect(result).not.toBe(0);
203
203
  }
@@ -215,9 +215,9 @@ describe('NonZeroInt test', () => {
215
215
 
216
216
  expect(result).toBeLessThanOrEqual(max);
217
217
 
218
- expect(NonZeroInt.is(result)).toBe(true);
218
+ assert.isTrue(NonZeroInt.is(result));
219
219
 
220
- expect(Number.isInteger(result)).toBe(true);
220
+ assert.isTrue(Number.isInteger(result));
221
221
 
222
222
  expect(result).not.toBe(0);
223
223
  }
@@ -77,39 +77,39 @@ describe('NonZeroInt16 test', () => {
77
77
 
78
78
  describe(isNonZeroInt16, () => {
79
79
  test('correctly identifies non-zero int16 values', () => {
80
- expect(isNonZeroInt16(1)).toBe(true);
80
+ assert.isTrue(isNonZeroInt16(1));
81
81
 
82
- expect(isNonZeroInt16(-1)).toBe(true);
82
+ assert.isTrue(isNonZeroInt16(-1));
83
83
 
84
- expect(isNonZeroInt16(32_767)).toBe(true);
84
+ assert.isTrue(isNonZeroInt16(32_767));
85
85
 
86
- expect(isNonZeroInt16(-32_768)).toBe(true);
86
+ assert.isTrue(isNonZeroInt16(-32_768));
87
87
  });
88
88
 
89
89
  test('correctly identifies zero', () => {
90
- expect(isNonZeroInt16(0)).toBe(false);
90
+ assert.isFalse(isNonZeroInt16(0));
91
91
  });
92
92
 
93
93
  test('correctly identifies values outside int16 range', () => {
94
- expect(isNonZeroInt16(32_768)).toBe(false);
94
+ assert.isFalse(isNonZeroInt16(32_768));
95
95
 
96
- expect(isNonZeroInt16(-32_769)).toBe(false);
96
+ assert.isFalse(isNonZeroInt16(-32_769));
97
97
 
98
- expect(isNonZeroInt16(65_536)).toBe(false);
98
+ assert.isFalse(isNonZeroInt16(65_536));
99
99
 
100
- expect(isNonZeroInt16(-65_536)).toBe(false);
100
+ assert.isFalse(isNonZeroInt16(-65_536));
101
101
  });
102
102
 
103
103
  test('correctly identifies non-integers', () => {
104
- expect(isNonZeroInt16(Number.NaN)).toBe(false);
104
+ assert.isFalse(isNonZeroInt16(Number.NaN));
105
105
 
106
- expect(isNonZeroInt16(Number.POSITIVE_INFINITY)).toBe(false);
106
+ assert.isFalse(isNonZeroInt16(Number.POSITIVE_INFINITY));
107
107
 
108
- expect(isNonZeroInt16(Number.NEGATIVE_INFINITY)).toBe(false);
108
+ assert.isFalse(isNonZeroInt16(Number.NEGATIVE_INFINITY));
109
109
 
110
- expect(isNonZeroInt16(1.2)).toBe(false);
110
+ assert.isFalse(isNonZeroInt16(1.2));
111
111
 
112
- expect(isNonZeroInt16(-3.4)).toBe(false);
112
+ assert.isFalse(isNonZeroInt16(-3.4));
113
113
  });
114
114
  });
115
115
 
@@ -217,9 +217,9 @@ describe('NonZeroInt16 test', () => {
217
217
 
218
218
  expect(result).toBeLessThanOrEqual(max);
219
219
 
220
- expect(NonZeroInt16.is(result)).toBe(true);
220
+ assert.isTrue(NonZeroInt16.is(result));
221
221
 
222
- expect(Number.isInteger(result)).toBe(true);
222
+ assert.isTrue(Number.isInteger(result));
223
223
 
224
224
  expect(result).not.toBe(0);
225
225
  }
@@ -77,39 +77,39 @@ describe('NonZeroInt32 test', () => {
77
77
 
78
78
  describe(isNonZeroInt32, () => {
79
79
  test('correctly identifies non-zero int32 values', () => {
80
- expect(isNonZeroInt32(1)).toBe(true);
80
+ assert.isTrue(isNonZeroInt32(1));
81
81
 
82
- expect(isNonZeroInt32(-1)).toBe(true);
82
+ assert.isTrue(isNonZeroInt32(-1));
83
83
 
84
- expect(isNonZeroInt32(2_147_483_647)).toBe(true);
84
+ assert.isTrue(isNonZeroInt32(2_147_483_647));
85
85
 
86
- expect(isNonZeroInt32(-2_147_483_648)).toBe(true);
86
+ assert.isTrue(isNonZeroInt32(-2_147_483_648));
87
87
  });
88
88
 
89
89
  test('correctly identifies zero', () => {
90
- expect(isNonZeroInt32(0)).toBe(false);
90
+ assert.isFalse(isNonZeroInt32(0));
91
91
  });
92
92
 
93
93
  test('correctly identifies values outside int32 range', () => {
94
- expect(isNonZeroInt32(2_147_483_648)).toBe(false);
94
+ assert.isFalse(isNonZeroInt32(2_147_483_648));
95
95
 
96
- expect(isNonZeroInt32(-2_147_483_649)).toBe(false);
96
+ assert.isFalse(isNonZeroInt32(-2_147_483_649));
97
97
 
98
- expect(isNonZeroInt32(4_294_967_296)).toBe(false);
98
+ assert.isFalse(isNonZeroInt32(4_294_967_296));
99
99
 
100
- expect(isNonZeroInt32(-4_294_967_296)).toBe(false);
100
+ assert.isFalse(isNonZeroInt32(-4_294_967_296));
101
101
  });
102
102
 
103
103
  test('correctly identifies non-integers', () => {
104
- expect(isNonZeroInt32(Number.NaN)).toBe(false);
104
+ assert.isFalse(isNonZeroInt32(Number.NaN));
105
105
 
106
- expect(isNonZeroInt32(Number.POSITIVE_INFINITY)).toBe(false);
106
+ assert.isFalse(isNonZeroInt32(Number.POSITIVE_INFINITY));
107
107
 
108
- expect(isNonZeroInt32(Number.NEGATIVE_INFINITY)).toBe(false);
108
+ assert.isFalse(isNonZeroInt32(Number.NEGATIVE_INFINITY));
109
109
 
110
- expect(isNonZeroInt32(1.2)).toBe(false);
110
+ assert.isFalse(isNonZeroInt32(1.2));
111
111
 
112
- expect(isNonZeroInt32(-3.4)).toBe(false);
112
+ assert.isFalse(isNonZeroInt32(-3.4));
113
113
  });
114
114
  });
115
115
 
@@ -222,9 +222,9 @@ describe('NonZeroInt32 test', () => {
222
222
 
223
223
  expect(result).toBeLessThanOrEqual(max);
224
224
 
225
- expect(NonZeroInt32.is(result)).toBe(true);
225
+ assert.isTrue(NonZeroInt32.is(result));
226
226
 
227
- expect(Number.isInteger(result)).toBe(true);
227
+ assert.isTrue(Number.isInteger(result));
228
228
 
229
229
  expect(result).not.toBe(0);
230
230
  }
@@ -85,45 +85,45 @@ describe('NonZeroSafeInt test', () => {
85
85
 
86
86
  describe(isNonZeroSafeInt, () => {
87
87
  test('correctly identifies non-zero safe integers', () => {
88
- expect(isNonZeroSafeInt(1)).toBe(true);
88
+ assert.isTrue(isNonZeroSafeInt(1));
89
89
 
90
- expect(isNonZeroSafeInt(-1)).toBe(true);
90
+ assert.isTrue(isNonZeroSafeInt(-1));
91
91
 
92
- expect(isNonZeroSafeInt(42)).toBe(true);
92
+ assert.isTrue(isNonZeroSafeInt(42));
93
93
 
94
- expect(isNonZeroSafeInt(-42)).toBe(true);
94
+ assert.isTrue(isNonZeroSafeInt(-42));
95
95
 
96
- expect(isNonZeroSafeInt(Number.MAX_SAFE_INTEGER)).toBe(true);
96
+ assert.isTrue(isNonZeroSafeInt(Number.MAX_SAFE_INTEGER));
97
97
 
98
- expect(isNonZeroSafeInt(Number.MIN_SAFE_INTEGER)).toBe(true);
98
+ assert.isTrue(isNonZeroSafeInt(Number.MIN_SAFE_INTEGER));
99
99
  });
100
100
 
101
101
  test('correctly identifies zero', () => {
102
- expect(isNonZeroSafeInt(0)).toBe(false);
102
+ assert.isFalse(isNonZeroSafeInt(0));
103
103
 
104
- expect(isNonZeroSafeInt(-0)).toBe(false);
104
+ assert.isFalse(isNonZeroSafeInt(-0));
105
105
  });
106
106
 
107
107
  test('correctly identifies values outside safe integer range', () => {
108
- expect(isNonZeroSafeInt(Number.MAX_SAFE_INTEGER + 1)).toBe(false);
108
+ assert.isFalse(isNonZeroSafeInt(Number.MAX_SAFE_INTEGER + 1));
109
109
 
110
- expect(isNonZeroSafeInt(Number.MIN_SAFE_INTEGER - 1)).toBe(false);
110
+ assert.isFalse(isNonZeroSafeInt(Number.MIN_SAFE_INTEGER - 1));
111
111
 
112
- expect(isNonZeroSafeInt(Number.MAX_VALUE)).toBe(false);
112
+ assert.isFalse(isNonZeroSafeInt(Number.MAX_VALUE));
113
113
 
114
- expect(isNonZeroSafeInt(-Number.MAX_VALUE)).toBe(false);
114
+ assert.isFalse(isNonZeroSafeInt(-Number.MAX_VALUE));
115
115
  });
116
116
 
117
117
  test('correctly identifies non-integers', () => {
118
- expect(isNonZeroSafeInt(Number.NaN)).toBe(false);
118
+ assert.isFalse(isNonZeroSafeInt(Number.NaN));
119
119
 
120
- expect(isNonZeroSafeInt(Number.POSITIVE_INFINITY)).toBe(false);
120
+ assert.isFalse(isNonZeroSafeInt(Number.POSITIVE_INFINITY));
121
121
 
122
- expect(isNonZeroSafeInt(Number.NEGATIVE_INFINITY)).toBe(false);
122
+ assert.isFalse(isNonZeroSafeInt(Number.NEGATIVE_INFINITY));
123
123
 
124
- expect(isNonZeroSafeInt(1.2)).toBe(false);
124
+ assert.isFalse(isNonZeroSafeInt(1.2));
125
125
 
126
- expect(isNonZeroSafeInt(-3.4)).toBe(false);
126
+ assert.isFalse(isNonZeroSafeInt(-3.4));
127
127
  });
128
128
  });
129
129
 
@@ -243,9 +243,9 @@ describe('NonZeroSafeInt test', () => {
243
243
 
244
244
  expect(result).toBeLessThanOrEqual(max);
245
245
 
246
- expect(NonZeroSafeInt.is(result)).toBe(true);
246
+ assert.isTrue(NonZeroSafeInt.is(result));
247
247
 
248
- expect(Number.isInteger(result)).toBe(true);
248
+ assert.isTrue(Number.isInteger(result));
249
249
 
250
250
  expect(result).not.toBe(0);
251
251
  }
@@ -263,9 +263,9 @@ describe('NonZeroSafeInt test', () => {
263
263
 
264
264
  expect(result).toBeLessThanOrEqual(max);
265
265
 
266
- expect(NonZeroSafeInt.is(result)).toBe(true);
266
+ assert.isTrue(NonZeroSafeInt.is(result));
267
267
 
268
- expect(Number.isInteger(result)).toBe(true);
268
+ assert.isTrue(Number.isInteger(result));
269
269
 
270
270
  expect(result).not.toBe(0);
271
271
  }
@@ -283,9 +283,9 @@ describe('NonZeroSafeInt test', () => {
283
283
 
284
284
  expect(result).toBeLessThanOrEqual(max);
285
285
 
286
- expect(NonZeroSafeInt.is(result)).toBe(true);
286
+ assert.isTrue(NonZeroSafeInt.is(result));
287
287
 
288
- expect(Number.isInteger(result)).toBe(true);
288
+ assert.isTrue(Number.isInteger(result));
289
289
 
290
290
  expect(result).not.toBe(0);
291
291
  }
@@ -81,41 +81,41 @@ describe('NonZeroUint16 test', () => {
81
81
 
82
82
  describe(isNonZeroUint16, () => {
83
83
  test('correctly identifies non-zero uint16 values', () => {
84
- expect(isNonZeroUint16(1)).toBe(true);
84
+ assert.isTrue(isNonZeroUint16(1));
85
85
 
86
- expect(isNonZeroUint16(1000)).toBe(true);
86
+ assert.isTrue(isNonZeroUint16(1000));
87
87
 
88
- expect(isNonZeroUint16(65_535)).toBe(true);
88
+ assert.isTrue(isNonZeroUint16(65_535));
89
89
 
90
- expect(isNonZeroUint16(32_768)).toBe(true);
90
+ assert.isTrue(isNonZeroUint16(32_768));
91
91
  });
92
92
 
93
93
  test('correctly identifies zero', () => {
94
- expect(isNonZeroUint16(0)).toBe(false);
94
+ assert.isFalse(isNonZeroUint16(0));
95
95
  });
96
96
 
97
97
  test('correctly identifies values outside uint16 range', () => {
98
- expect(isNonZeroUint16(65_536)).toBe(false);
98
+ assert.isFalse(isNonZeroUint16(65_536));
99
99
 
100
- expect(isNonZeroUint16(100_000)).toBe(false);
100
+ assert.isFalse(isNonZeroUint16(100_000));
101
101
  });
102
102
 
103
103
  test('correctly identifies negative integers', () => {
104
- expect(isNonZeroUint16(-1)).toBe(false);
104
+ assert.isFalse(isNonZeroUint16(-1));
105
105
 
106
- expect(isNonZeroUint16(-42)).toBe(false);
106
+ assert.isFalse(isNonZeroUint16(-42));
107
107
  });
108
108
 
109
109
  test('correctly identifies non-integers', () => {
110
- expect(isNonZeroUint16(Number.NaN)).toBe(false);
110
+ assert.isFalse(isNonZeroUint16(Number.NaN));
111
111
 
112
- expect(isNonZeroUint16(Number.POSITIVE_INFINITY)).toBe(false);
112
+ assert.isFalse(isNonZeroUint16(Number.POSITIVE_INFINITY));
113
113
 
114
- expect(isNonZeroUint16(Number.NEGATIVE_INFINITY)).toBe(false);
114
+ assert.isFalse(isNonZeroUint16(Number.NEGATIVE_INFINITY));
115
115
 
116
- expect(isNonZeroUint16(1.2)).toBe(false);
116
+ assert.isFalse(isNonZeroUint16(1.2));
117
117
 
118
- expect(isNonZeroUint16(-3.4)).toBe(false);
118
+ assert.isFalse(isNonZeroUint16(-3.4));
119
119
  });
120
120
  });
121
121
 
@@ -213,9 +213,9 @@ describe('NonZeroUint16 test', () => {
213
213
 
214
214
  expect(result).toBeLessThanOrEqual(max);
215
215
 
216
- expect(NonZeroUint16.is(result)).toBe(true);
216
+ assert.isTrue(NonZeroUint16.is(result));
217
217
 
218
- expect(Number.isInteger(result)).toBe(true);
218
+ assert.isTrue(Number.isInteger(result));
219
219
 
220
220
  expect(result).not.toBe(0);
221
221
  }
@@ -81,41 +81,41 @@ describe('NonZeroUint32 test', () => {
81
81
 
82
82
  describe(isNonZeroUint32, () => {
83
83
  test('correctly identifies non-zero uint32 values', () => {
84
- expect(isNonZeroUint32(1)).toBe(true);
84
+ assert.isTrue(isNonZeroUint32(1));
85
85
 
86
- expect(isNonZeroUint32(1000)).toBe(true);
86
+ assert.isTrue(isNonZeroUint32(1000));
87
87
 
88
- expect(isNonZeroUint32(4_294_967_295)).toBe(true);
88
+ assert.isTrue(isNonZeroUint32(4_294_967_295));
89
89
 
90
- expect(isNonZeroUint32(2_147_483_648)).toBe(true);
90
+ assert.isTrue(isNonZeroUint32(2_147_483_648));
91
91
  });
92
92
 
93
93
  test('correctly identifies zero', () => {
94
- expect(isNonZeroUint32(0)).toBe(false);
94
+ assert.isFalse(isNonZeroUint32(0));
95
95
  });
96
96
 
97
97
  test('correctly identifies values outside uint32 range', () => {
98
- expect(isNonZeroUint32(4_294_967_296)).toBe(false);
98
+ assert.isFalse(isNonZeroUint32(4_294_967_296));
99
99
 
100
- expect(isNonZeroUint32(10_000_000_000)).toBe(false);
100
+ assert.isFalse(isNonZeroUint32(10_000_000_000));
101
101
  });
102
102
 
103
103
  test('correctly identifies negative integers', () => {
104
- expect(isNonZeroUint32(-1)).toBe(false);
104
+ assert.isFalse(isNonZeroUint32(-1));
105
105
 
106
- expect(isNonZeroUint32(-42)).toBe(false);
106
+ assert.isFalse(isNonZeroUint32(-42));
107
107
  });
108
108
 
109
109
  test('correctly identifies non-integers', () => {
110
- expect(isNonZeroUint32(Number.NaN)).toBe(false);
110
+ assert.isFalse(isNonZeroUint32(Number.NaN));
111
111
 
112
- expect(isNonZeroUint32(Number.POSITIVE_INFINITY)).toBe(false);
112
+ assert.isFalse(isNonZeroUint32(Number.POSITIVE_INFINITY));
113
113
 
114
- expect(isNonZeroUint32(Number.NEGATIVE_INFINITY)).toBe(false);
114
+ assert.isFalse(isNonZeroUint32(Number.NEGATIVE_INFINITY));
115
115
 
116
- expect(isNonZeroUint32(1.2)).toBe(false);
116
+ assert.isFalse(isNonZeroUint32(1.2));
117
117
 
118
- expect(isNonZeroUint32(-3.4)).toBe(false);
118
+ assert.isFalse(isNonZeroUint32(-3.4));
119
119
  });
120
120
  });
121
121
 
@@ -213,9 +213,9 @@ describe('NonZeroUint32 test', () => {
213
213
 
214
214
  expect(result).toBeLessThanOrEqual(max);
215
215
 
216
- expect(NonZeroUint32.is(result)).toBe(true);
216
+ assert.isTrue(NonZeroUint32.is(result));
217
217
 
218
- expect(Number.isInteger(result)).toBe(true);
218
+ assert.isTrue(Number.isInteger(result));
219
219
 
220
220
  expect(result).not.toBe(0);
221
221
  }
@@ -73,37 +73,37 @@ describe('PositiveFiniteNumber test', () => {
73
73
 
74
74
  describe(isPositiveFiniteNumber, () => {
75
75
  test('correctly identifies positive finite numbers', () => {
76
- expect(isPositiveFiniteNumber(1)).toBe(true);
76
+ assert.isTrue(isPositiveFiniteNumber(1));
77
77
 
78
- expect(isPositiveFiniteNumber(3.14)).toBe(true);
78
+ assert.isTrue(isPositiveFiniteNumber(3.14));
79
79
 
80
- expect(isPositiveFiniteNumber(0.5)).toBe(true);
80
+ assert.isTrue(isPositiveFiniteNumber(0.5));
81
81
 
82
- expect(isPositiveFiniteNumber(Number.MIN_VALUE)).toBe(true);
82
+ assert.isTrue(isPositiveFiniteNumber(Number.MIN_VALUE));
83
83
 
84
- expect(isPositiveFiniteNumber(Number.MAX_VALUE)).toBe(true);
84
+ assert.isTrue(isPositiveFiniteNumber(Number.MAX_VALUE));
85
85
  });
86
86
 
87
87
  test('correctly identifies zero', () => {
88
- expect(isPositiveFiniteNumber(0)).toBe(false);
88
+ assert.isFalse(isPositiveFiniteNumber(0));
89
89
 
90
- expect(isPositiveFiniteNumber(-0)).toBe(false);
90
+ assert.isFalse(isPositiveFiniteNumber(-0));
91
91
  });
92
92
 
93
93
  test('correctly identifies negative numbers', () => {
94
- expect(isPositiveFiniteNumber(-1)).toBe(false);
94
+ assert.isFalse(isPositiveFiniteNumber(-1));
95
95
 
96
- expect(isPositiveFiniteNumber(-0.1)).toBe(false);
96
+ assert.isFalse(isPositiveFiniteNumber(-0.1));
97
97
 
98
- expect(isPositiveFiniteNumber(-Number.MAX_VALUE)).toBe(false);
98
+ assert.isFalse(isPositiveFiniteNumber(-Number.MAX_VALUE));
99
99
  });
100
100
 
101
101
  test('correctly identifies non-finite numbers', () => {
102
- expect(isPositiveFiniteNumber(Number.NaN)).toBe(false);
102
+ assert.isFalse(isPositiveFiniteNumber(Number.NaN));
103
103
 
104
- expect(isPositiveFiniteNumber(Number.POSITIVE_INFINITY)).toBe(false);
104
+ assert.isFalse(isPositiveFiniteNumber(Number.POSITIVE_INFINITY));
105
105
 
106
- expect(isPositiveFiniteNumber(Number.NEGATIVE_INFINITY)).toBe(false);
106
+ assert.isFalse(isPositiveFiniteNumber(Number.NEGATIVE_INFINITY));
107
107
  });
108
108
  });
109
109
 
@@ -219,7 +219,7 @@ describe('PositiveFiniteNumber test', () => {
219
219
 
220
220
  expect(result).toBeLessThanOrEqual(max);
221
221
 
222
- expect(PositiveFiniteNumber.is(result)).toBe(true);
222
+ assert.isTrue(PositiveFiniteNumber.is(result));
223
223
 
224
224
  expect(result).toBeGreaterThan(0);
225
225
  }
@@ -38,11 +38,11 @@ const {
38
38
  * @example
39
39
  *
40
40
  * ```ts
41
- * assert.ok(isPositiveInt(5));
41
+ * assert.isTrue(isPositiveInt(5));
42
42
  *
43
- * assert.notOk(isPositiveInt(0));
43
+ * assert.isFalse(isPositiveInt(0));
44
44
  *
45
- * assert.ok(PositiveInt.is(10));
45
+ * assert.isTrue(PositiveInt.is(10));
46
46
  * ```
47
47
  *
48
48
  * @param value - The value to check
@@ -62,9 +62,9 @@ export const isPositiveInt = is;
62
62
  * ```ts
63
63
  * const branded = asPositiveInt(7);
64
64
  *
65
- * assert(branded === 7);
65
+ * assert.isTrue(branded === 7);
66
66
  *
67
- * assert.ok(PositiveInt.is(branded));
67
+ * assert.isTrue(PositiveInt.is(branded));
68
68
  * ```
69
69
  *
70
70
  * @param value - The value to cast
@@ -96,11 +96,11 @@ export const PositiveInt = {
96
96
  * @example
97
97
  *
98
98
  * ```ts
99
- * assert.ok(isPositiveInt(5));
99
+ * assert.isTrue(isPositiveInt(5));
100
100
  *
101
- * assert.notOk(isPositiveInt(0));
101
+ * assert.isFalse(isPositiveInt(0));
102
102
  *
103
- * assert.ok(PositiveInt.is(10));
103
+ * assert.isTrue(PositiveInt.is(10));
104
104
  * ```
105
105
  *
106
106
  * @param value - The value to check
@@ -131,7 +131,7 @@ export const PositiveInt = {
131
131
  * asPositiveInt(12),
132
132
  * );
133
133
  *
134
- * assert(smallest === 3);
134
+ * assert.isTrue(smallest === 3);
135
135
  * ```
136
136
  *
137
137
  * @param values - The positive integers to compare (at least one required)
@@ -151,7 +151,7 @@ export const PositiveInt = {
151
151
  * asPositiveInt(12),
152
152
  * );
153
153
  *
154
- * assert(largest === 12);
154
+ * assert.isTrue(largest === 12);
155
155
  * ```
156
156
  *
157
157
  * @param values - The positive integers to compare (at least one required)
@@ -172,9 +172,9 @@ export const PositiveInt = {
172
172
  *
173
173
  * const withinRange = PositiveInt.clamp(10);
174
174
  *
175
- * assert(belowRange === 1);
175
+ * assert.isTrue(belowRange === 1);
176
176
  *
177
- * assert(withinRange === 10);
177
+ * assert.isTrue(withinRange === 10);
178
178
  * ```
179
179
  *
180
180
  * @param value - The number to clamp
@@ -197,9 +197,9 @@ export const PositiveInt = {
197
197
  *
198
198
  * const randomValue = PositiveInt.random(min, max);
199
199
  *
200
- * assert.ok(PositiveInt.is(randomValue));
200
+ * assert.isTrue(PositiveInt.is(randomValue));
201
201
  *
202
- * assert.ok(randomValue >= 3 && randomValue <= 6);
202
+ * assert.isTrue(randomValue >= 3 && randomValue <= 6);
203
203
  * ```
204
204
  *
205
205
  * @param min - The minimum value (inclusive, must be >= 1)
@@ -221,7 +221,7 @@ export const PositiveInt = {
221
221
  *
222
222
  * const power = PositiveInt.pow(base, exponent);
223
223
  *
224
- * assert(power === 16);
224
+ * assert.isTrue(power === 16);
225
225
  * ```
226
226
  *
227
227
  * @param a - The base positive integer
@@ -238,7 +238,7 @@ export const PositiveInt = {
238
238
  * ```ts
239
239
  * const sum = PositiveInt.add(asPositiveInt(4), asPositiveInt(5));
240
240
  *
241
- * assert(sum === 9);
241
+ * assert.isTrue(sum === 9);
242
242
  * ```
243
243
  *
244
244
  * @param a - First positive integer
@@ -258,7 +258,7 @@ export const PositiveInt = {
258
258
  * ```ts
259
259
  * const difference = PositiveInt.sub(asPositiveInt(5), asPositiveInt(7));
260
260
  *
261
- * assert(difference === 1);
261
+ * assert.isTrue(difference === 1);
262
262
  * ```
263
263
  *
264
264
  * @param a - The minuend (positive integer)
@@ -275,7 +275,7 @@ export const PositiveInt = {
275
275
  * ```ts
276
276
  * const product = PositiveInt.mul(asPositiveInt(3), asPositiveInt(7));
277
277
  *
278
- * assert(product === 21);
278
+ * assert.isTrue(product === 21);
279
279
  * ```
280
280
  *
281
281
  * @param a - First positive integer
@@ -299,9 +299,9 @@ export const PositiveInt = {
299
299
  *
300
300
  * const clamped = PositiveInt.div(asPositiveInt(3), asPositiveInt(10));
301
301
  *
302
- * assert(quotient === 4);
302
+ * assert.isTrue(quotient === 4);
303
303
  *
304
- * assert(clamped === 1);
304
+ * assert.isTrue(clamped === 1);
305
305
  * ```
306
306
  *
307
307
  * @param a - The dividend (positive integer)