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
@@ -70,41 +70,41 @@ describe('PositiveInt test', () => {
70
70
 
71
71
  describe(isPositiveInt, () => {
72
72
  test('correctly identifies positive integers', () => {
73
- expect(isPositiveInt(1)).toBe(true);
73
+ assert.isTrue(isPositiveInt(1));
74
74
 
75
- expect(isPositiveInt(2)).toBe(true);
75
+ assert.isTrue(isPositiveInt(2));
76
76
 
77
- expect(isPositiveInt(42)).toBe(true);
77
+ assert.isTrue(isPositiveInt(42));
78
78
 
79
- expect(isPositiveInt(100)).toBe(true);
79
+ assert.isTrue(isPositiveInt(100));
80
80
 
81
- expect(isPositiveInt(Number.MAX_SAFE_INTEGER)).toBe(true);
81
+ assert.isTrue(isPositiveInt(Number.MAX_SAFE_INTEGER));
82
82
  });
83
83
 
84
84
  test('correctly identifies zero', () => {
85
- expect(isPositiveInt(0)).toBe(false);
85
+ assert.isFalse(isPositiveInt(0));
86
86
 
87
- expect(isPositiveInt(-0)).toBe(false);
87
+ assert.isFalse(isPositiveInt(-0));
88
88
  });
89
89
 
90
90
  test('correctly identifies negative integers', () => {
91
- expect(isPositiveInt(-1)).toBe(false);
91
+ assert.isFalse(isPositiveInt(-1));
92
92
 
93
- expect(isPositiveInt(-42)).toBe(false);
93
+ assert.isFalse(isPositiveInt(-42));
94
94
 
95
- expect(isPositiveInt(Number.MIN_SAFE_INTEGER)).toBe(false);
95
+ assert.isFalse(isPositiveInt(Number.MIN_SAFE_INTEGER));
96
96
  });
97
97
 
98
98
  test('correctly identifies non-integers', () => {
99
- expect(isPositiveInt(Number.NaN)).toBe(false);
99
+ assert.isFalse(isPositiveInt(Number.NaN));
100
100
 
101
- expect(isPositiveInt(Number.POSITIVE_INFINITY)).toBe(false);
101
+ assert.isFalse(isPositiveInt(Number.POSITIVE_INFINITY));
102
102
 
103
- expect(isPositiveInt(Number.NEGATIVE_INFINITY)).toBe(false);
103
+ assert.isFalse(isPositiveInt(Number.NEGATIVE_INFINITY));
104
104
 
105
- expect(isPositiveInt(1.2)).toBe(false);
105
+ assert.isFalse(isPositiveInt(1.2));
106
106
 
107
- expect(isPositiveInt(-3.4)).toBe(false);
107
+ assert.isFalse(isPositiveInt(-3.4));
108
108
  });
109
109
  });
110
110
 
@@ -191,9 +191,9 @@ describe('PositiveInt test', () => {
191
191
 
192
192
  expect(result).toBeLessThanOrEqual(max);
193
193
 
194
- expect(PositiveInt.is(result)).toBe(true);
194
+ assert.isTrue(PositiveInt.is(result));
195
195
 
196
- expect(Number.isInteger(result)).toBe(true);
196
+ assert.isTrue(Number.isInteger(result));
197
197
 
198
198
  expect(result).toBeGreaterThan(0);
199
199
  }
@@ -79,39 +79,39 @@ describe('PositiveInt16 test', () => {
79
79
 
80
80
  describe(isPositiveInt16, () => {
81
81
  test('correctly identifies positive int16 values', () => {
82
- expect(isPositiveInt16(1)).toBe(true);
82
+ assert.isTrue(isPositiveInt16(1));
83
83
 
84
- expect(isPositiveInt16(1000)).toBe(true);
84
+ assert.isTrue(isPositiveInt16(1000));
85
85
 
86
- expect(isPositiveInt16(32_767)).toBe(true);
86
+ assert.isTrue(isPositiveInt16(32_767));
87
87
  });
88
88
 
89
89
  test('correctly identifies zero', () => {
90
- expect(isPositiveInt16(0)).toBe(false);
90
+ assert.isFalse(isPositiveInt16(0));
91
91
  });
92
92
 
93
93
  test('correctly identifies values outside int16 range', () => {
94
- expect(isPositiveInt16(32_768)).toBe(false);
94
+ assert.isFalse(isPositiveInt16(32_768));
95
95
 
96
- expect(isPositiveInt16(65_536)).toBe(false);
96
+ assert.isFalse(isPositiveInt16(65_536));
97
97
  });
98
98
 
99
99
  test('correctly identifies negative integers', () => {
100
- expect(isPositiveInt16(-1)).toBe(false);
100
+ assert.isFalse(isPositiveInt16(-1));
101
101
 
102
- expect(isPositiveInt16(-42)).toBe(false);
102
+ assert.isFalse(isPositiveInt16(-42));
103
103
  });
104
104
 
105
105
  test('correctly identifies non-integers', () => {
106
- expect(isPositiveInt16(Number.NaN)).toBe(false);
106
+ assert.isFalse(isPositiveInt16(Number.NaN));
107
107
 
108
- expect(isPositiveInt16(Number.POSITIVE_INFINITY)).toBe(false);
108
+ assert.isFalse(isPositiveInt16(Number.POSITIVE_INFINITY));
109
109
 
110
- expect(isPositiveInt16(Number.NEGATIVE_INFINITY)).toBe(false);
110
+ assert.isFalse(isPositiveInt16(Number.NEGATIVE_INFINITY));
111
111
 
112
- expect(isPositiveInt16(1.2)).toBe(false);
112
+ assert.isFalse(isPositiveInt16(1.2));
113
113
 
114
- expect(isPositiveInt16(-3.4)).toBe(false);
114
+ assert.isFalse(isPositiveInt16(-3.4));
115
115
  });
116
116
  });
117
117
 
@@ -209,9 +209,9 @@ describe('PositiveInt16 test', () => {
209
209
 
210
210
  expect(result).toBeLessThanOrEqual(max);
211
211
 
212
- expect(PositiveInt16.is(result)).toBe(true);
212
+ assert.isTrue(PositiveInt16.is(result));
213
213
 
214
- expect(Number.isInteger(result)).toBe(true);
214
+ assert.isTrue(Number.isInteger(result));
215
215
 
216
216
  expect(result).toBeGreaterThan(0);
217
217
  }
@@ -79,39 +79,39 @@ describe('PositiveInt32 test', () => {
79
79
 
80
80
  describe(isPositiveInt32, () => {
81
81
  test('correctly identifies positive int32 values', () => {
82
- expect(isPositiveInt32(1)).toBe(true);
82
+ assert.isTrue(isPositiveInt32(1));
83
83
 
84
- expect(isPositiveInt32(1000)).toBe(true);
84
+ assert.isTrue(isPositiveInt32(1000));
85
85
 
86
- expect(isPositiveInt32(2_147_483_647)).toBe(true);
86
+ assert.isTrue(isPositiveInt32(2_147_483_647));
87
87
  });
88
88
 
89
89
  test('correctly identifies zero', () => {
90
- expect(isPositiveInt32(0)).toBe(false);
90
+ assert.isFalse(isPositiveInt32(0));
91
91
  });
92
92
 
93
93
  test('correctly identifies values outside int32 range', () => {
94
- expect(isPositiveInt32(2_147_483_648)).toBe(false);
94
+ assert.isFalse(isPositiveInt32(2_147_483_648));
95
95
 
96
- expect(isPositiveInt32(4_294_967_296)).toBe(false);
96
+ assert.isFalse(isPositiveInt32(4_294_967_296));
97
97
  });
98
98
 
99
99
  test('correctly identifies negative integers', () => {
100
- expect(isPositiveInt32(-1)).toBe(false);
100
+ assert.isFalse(isPositiveInt32(-1));
101
101
 
102
- expect(isPositiveInt32(-42)).toBe(false);
102
+ assert.isFalse(isPositiveInt32(-42));
103
103
  });
104
104
 
105
105
  test('correctly identifies non-integers', () => {
106
- expect(isPositiveInt32(Number.NaN)).toBe(false);
106
+ assert.isFalse(isPositiveInt32(Number.NaN));
107
107
 
108
- expect(isPositiveInt32(Number.POSITIVE_INFINITY)).toBe(false);
108
+ assert.isFalse(isPositiveInt32(Number.POSITIVE_INFINITY));
109
109
 
110
- expect(isPositiveInt32(Number.NEGATIVE_INFINITY)).toBe(false);
110
+ assert.isFalse(isPositiveInt32(Number.NEGATIVE_INFINITY));
111
111
 
112
- expect(isPositiveInt32(1.2)).toBe(false);
112
+ assert.isFalse(isPositiveInt32(1.2));
113
113
 
114
- expect(isPositiveInt32(-3.4)).toBe(false);
114
+ assert.isFalse(isPositiveInt32(-3.4));
115
115
  });
116
116
  });
117
117
 
@@ -209,9 +209,9 @@ describe('PositiveInt32 test', () => {
209
209
 
210
210
  expect(result).toBeLessThanOrEqual(max);
211
211
 
212
- expect(PositiveInt32.is(result)).toBe(true);
212
+ assert.isTrue(PositiveInt32.is(result));
213
213
 
214
- expect(Number.isInteger(result)).toBe(true);
214
+ assert.isTrue(Number.isInteger(result));
215
215
 
216
216
  expect(result).toBeGreaterThan(0);
217
217
  }
@@ -38,13 +38,13 @@ const {
38
38
  * @example
39
39
  *
40
40
  * ```ts
41
- * assert.ok(isPositiveSafeInt(1));
41
+ * assert.isTrue(isPositiveSafeInt(1));
42
42
  *
43
- * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
43
+ * assert.isTrue(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
44
44
  *
45
- * assert.notOk(isPositiveSafeInt(0));
45
+ * assert.isFalse(isPositiveSafeInt(0));
46
46
  *
47
- * assert.ok(PositiveSafeInt.is(42));
47
+ * assert.isTrue(PositiveSafeInt.is(42));
48
48
  * ```
49
49
  *
50
50
  * @param value The value to check.
@@ -60,9 +60,9 @@ export const isPositiveSafeInt = is;
60
60
  * ```ts
61
61
  * const branded = asPositiveSafeInt(128);
62
62
  *
63
- * assert(branded === 128);
63
+ * assert.isTrue(branded === 128);
64
64
  *
65
- * assert.ok(PositiveSafeInt.is(branded));
65
+ * assert.isTrue(PositiveSafeInt.is(branded));
66
66
  * ```
67
67
  *
68
68
  * @param value The value to cast.
@@ -87,13 +87,13 @@ export const PositiveSafeInt = {
87
87
  * @example
88
88
  *
89
89
  * ```ts
90
- * assert.ok(isPositiveSafeInt(1));
90
+ * assert.isTrue(isPositiveSafeInt(1));
91
91
  *
92
- * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
92
+ * assert.isTrue(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
93
93
  *
94
- * assert.notOk(isPositiveSafeInt(0));
94
+ * assert.isFalse(isPositiveSafeInt(0));
95
95
  *
96
- * assert.ok(PositiveSafeInt.is(42));
96
+ * assert.isTrue(PositiveSafeInt.is(42));
97
97
  * ```
98
98
  *
99
99
  * @param value The value to check.
@@ -127,7 +127,7 @@ export const PositiveSafeInt = {
127
127
  * asPositiveSafeInt(5),
128
128
  * );
129
129
  *
130
- * assert(smallest === 5);
130
+ * assert.isTrue(smallest === 5);
131
131
  * ```
132
132
  *
133
133
  * @param a The first PositiveSafeInt.
@@ -147,7 +147,7 @@ export const PositiveSafeInt = {
147
147
  * asPositiveSafeInt(5),
148
148
  * );
149
149
  *
150
- * assert(largest === 10);
150
+ * assert.isTrue(largest === 10);
151
151
  * ```
152
152
  *
153
153
  * @param a The first PositiveSafeInt.
@@ -168,11 +168,11 @@ export const PositiveSafeInt = {
168
168
  *
169
169
  * const aboveRange = PositiveSafeInt.clamp(Number.MAX_SAFE_INTEGER + 10);
170
170
  *
171
- * assert(belowRange === 1);
171
+ * assert.isTrue(belowRange === 1);
172
172
  *
173
- * assert(withinRange === 123);
173
+ * assert.isTrue(withinRange === 123);
174
174
  *
175
- * assert(aboveRange === Number.MAX_SAFE_INTEGER);
175
+ * assert.isTrue(aboveRange === Number.MAX_SAFE_INTEGER);
176
176
  * ```
177
177
  *
178
178
  * @param value The number to clamp.
@@ -192,9 +192,9 @@ export const PositiveSafeInt = {
192
192
  *
193
193
  * const randomValue = PositiveSafeInt.random(min, max);
194
194
  *
195
- * assert.ok(PositiveSafeInt.is(randomValue));
195
+ * assert.isTrue(PositiveSafeInt.is(randomValue));
196
196
  *
197
- * assert.ok(randomValue >= 1 && randomValue <= 6);
197
+ * assert.isTrue(randomValue >= 1 && randomValue <= 6);
198
198
  * ```
199
199
  *
200
200
  * @returns A random PositiveSafeInt between 1 and MAX_SAFE_INTEGER.
@@ -213,7 +213,7 @@ export const PositiveSafeInt = {
213
213
  *
214
214
  * const power = PositiveSafeInt.pow(base, exponent);
215
215
  *
216
- * assert(power === 27);
216
+ * assert.isTrue(power === 27);
217
217
  * ```
218
218
  *
219
219
  * @param a The base PositiveSafeInt.
@@ -233,9 +233,9 @@ export const PositiveSafeInt = {
233
233
  * asPositiveSafeInt(2048),
234
234
  * );
235
235
  *
236
- * assert(sum === 3048);
236
+ * assert.isTrue(sum === 3048);
237
237
  *
238
- * assert.ok(PositiveSafeInt.is(sum));
238
+ * assert.isTrue(PositiveSafeInt.is(sum));
239
239
  * ```
240
240
  *
241
241
  * @param a The first PositiveSafeInt.
@@ -255,9 +255,9 @@ export const PositiveSafeInt = {
255
255
  * asPositiveSafeInt(20),
256
256
  * );
257
257
  *
258
- * assert(difference === 1);
258
+ * assert.isTrue(difference === 1);
259
259
  *
260
- * assert.ok(PositiveSafeInt.is(difference));
260
+ * assert.isTrue(PositiveSafeInt.is(difference));
261
261
  * ```
262
262
  *
263
263
  * @param a The minuend PositiveSafeInt.
@@ -278,9 +278,9 @@ export const PositiveSafeInt = {
278
278
  * asPositiveSafeInt(20),
279
279
  * );
280
280
  *
281
- * assert(product === 1000);
281
+ * assert.isTrue(product === 1000);
282
282
  *
283
- * assert.ok(PositiveSafeInt.is(product));
283
+ * assert.isTrue(PositiveSafeInt.is(product));
284
284
  * ```
285
285
  *
286
286
  * @param a The first PositiveSafeInt.
@@ -305,9 +305,9 @@ export const PositiveSafeInt = {
305
305
  * asPositiveSafeInt(50),
306
306
  * );
307
307
  *
308
- * assert(quotient === 6);
308
+ * assert.isTrue(quotient === 6);
309
309
  *
310
- * assert(clamped === 1);
310
+ * assert.isTrue(clamped === 1);
311
311
  * ```
312
312
  *
313
313
  * @param a The dividend PositiveSafeInt.
@@ -88,47 +88,47 @@ describe('PositiveSafeInt test', () => {
88
88
 
89
89
  describe(isPositiveSafeInt, () => {
90
90
  test('correctly identifies positive safe integers', () => {
91
- expect(isPositiveSafeInt(1)).toBe(true);
91
+ assert.isTrue(isPositiveSafeInt(1));
92
92
 
93
- expect(isPositiveSafeInt(2)).toBe(true);
93
+ assert.isTrue(isPositiveSafeInt(2));
94
94
 
95
- expect(isPositiveSafeInt(42)).toBe(true);
95
+ assert.isTrue(isPositiveSafeInt(42));
96
96
 
97
- expect(isPositiveSafeInt(100)).toBe(true);
97
+ assert.isTrue(isPositiveSafeInt(100));
98
98
 
99
- expect(isPositiveSafeInt(Number.MAX_SAFE_INTEGER)).toBe(true);
99
+ assert.isTrue(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
100
100
  });
101
101
 
102
102
  test('correctly identifies zero', () => {
103
- expect(isPositiveSafeInt(0)).toBe(false);
103
+ assert.isFalse(isPositiveSafeInt(0));
104
104
 
105
- expect(isPositiveSafeInt(-0)).toBe(false);
105
+ assert.isFalse(isPositiveSafeInt(-0));
106
106
  });
107
107
 
108
108
  test('correctly identifies negative integers', () => {
109
- expect(isPositiveSafeInt(-1)).toBe(false);
109
+ assert.isFalse(isPositiveSafeInt(-1));
110
110
 
111
- expect(isPositiveSafeInt(-42)).toBe(false);
111
+ assert.isFalse(isPositiveSafeInt(-42));
112
112
 
113
- expect(isPositiveSafeInt(Number.MIN_SAFE_INTEGER)).toBe(false);
113
+ assert.isFalse(isPositiveSafeInt(Number.MIN_SAFE_INTEGER));
114
114
  });
115
115
 
116
116
  test('correctly identifies values outside safe integer range', () => {
117
- expect(isPositiveSafeInt(Number.MAX_SAFE_INTEGER + 1)).toBe(false);
117
+ assert.isFalse(isPositiveSafeInt(Number.MAX_SAFE_INTEGER + 1));
118
118
 
119
- expect(isPositiveSafeInt(Number.MAX_VALUE)).toBe(false);
119
+ assert.isFalse(isPositiveSafeInt(Number.MAX_VALUE));
120
120
  });
121
121
 
122
122
  test('correctly identifies non-integers', () => {
123
- expect(isPositiveSafeInt(Number.NaN)).toBe(false);
123
+ assert.isFalse(isPositiveSafeInt(Number.NaN));
124
124
 
125
- expect(isPositiveSafeInt(Number.POSITIVE_INFINITY)).toBe(false);
125
+ assert.isFalse(isPositiveSafeInt(Number.POSITIVE_INFINITY));
126
126
 
127
- expect(isPositiveSafeInt(Number.NEGATIVE_INFINITY)).toBe(false);
127
+ assert.isFalse(isPositiveSafeInt(Number.NEGATIVE_INFINITY));
128
128
 
129
- expect(isPositiveSafeInt(1.2)).toBe(false);
129
+ assert.isFalse(isPositiveSafeInt(1.2));
130
130
 
131
- expect(isPositiveSafeInt(-3.4)).toBe(false);
131
+ assert.isFalse(isPositiveSafeInt(-3.4));
132
132
  });
133
133
  });
134
134
 
@@ -236,9 +236,9 @@ describe('PositiveSafeInt test', () => {
236
236
 
237
237
  expect(result).toBeLessThanOrEqual(max);
238
238
 
239
- expect(PositiveSafeInt.is(result)).toBe(true);
239
+ assert.isTrue(PositiveSafeInt.is(result));
240
240
 
241
- expect(Number.isInteger(result)).toBe(true);
241
+ assert.isTrue(Number.isInteger(result));
242
242
 
243
243
  expect(result).toBeGreaterThan(0);
244
244
  }
@@ -81,41 +81,41 @@ describe('PositiveUint16 test', () => {
81
81
 
82
82
  describe(isPositiveUint16, () => {
83
83
  test('correctly identifies positive uint16 values', () => {
84
- expect(isPositiveUint16(1)).toBe(true);
84
+ assert.isTrue(isPositiveUint16(1));
85
85
 
86
- expect(isPositiveUint16(1000)).toBe(true);
86
+ assert.isTrue(isPositiveUint16(1000));
87
87
 
88
- expect(isPositiveUint16(65_535)).toBe(true);
88
+ assert.isTrue(isPositiveUint16(65_535));
89
89
 
90
- expect(isPositiveUint16(32_768)).toBe(true);
90
+ assert.isTrue(isPositiveUint16(32_768));
91
91
  });
92
92
 
93
93
  test('correctly identifies zero', () => {
94
- expect(isPositiveUint16(0)).toBe(false);
94
+ assert.isFalse(isPositiveUint16(0));
95
95
  });
96
96
 
97
97
  test('correctly identifies values outside uint16 range', () => {
98
- expect(isPositiveUint16(65_536)).toBe(false);
98
+ assert.isFalse(isPositiveUint16(65_536));
99
99
 
100
- expect(isPositiveUint16(100_000)).toBe(false);
100
+ assert.isFalse(isPositiveUint16(100_000));
101
101
  });
102
102
 
103
103
  test('correctly identifies negative integers', () => {
104
- expect(isPositiveUint16(-1)).toBe(false);
104
+ assert.isFalse(isPositiveUint16(-1));
105
105
 
106
- expect(isPositiveUint16(-42)).toBe(false);
106
+ assert.isFalse(isPositiveUint16(-42));
107
107
  });
108
108
 
109
109
  test('correctly identifies non-integers', () => {
110
- expect(isPositiveUint16(Number.NaN)).toBe(false);
110
+ assert.isFalse(isPositiveUint16(Number.NaN));
111
111
 
112
- expect(isPositiveUint16(Number.POSITIVE_INFINITY)).toBe(false);
112
+ assert.isFalse(isPositiveUint16(Number.POSITIVE_INFINITY));
113
113
 
114
- expect(isPositiveUint16(Number.NEGATIVE_INFINITY)).toBe(false);
114
+ assert.isFalse(isPositiveUint16(Number.NEGATIVE_INFINITY));
115
115
 
116
- expect(isPositiveUint16(1.2)).toBe(false);
116
+ assert.isFalse(isPositiveUint16(1.2));
117
117
 
118
- expect(isPositiveUint16(-3.4)).toBe(false);
118
+ assert.isFalse(isPositiveUint16(-3.4));
119
119
  });
120
120
  });
121
121
 
@@ -217,9 +217,9 @@ describe('PositiveUint16 test', () => {
217
217
 
218
218
  expect(result).toBeLessThanOrEqual(max);
219
219
 
220
- expect(PositiveUint16.is(result)).toBe(true);
220
+ assert.isTrue(PositiveUint16.is(result));
221
221
 
222
- expect(Number.isInteger(result)).toBe(true);
222
+ assert.isTrue(Number.isInteger(result));
223
223
 
224
224
  expect(result).toBeGreaterThan(0);
225
225
  }
@@ -81,41 +81,41 @@ describe('PositiveUint32 test', () => {
81
81
 
82
82
  describe(isPositiveUint32, () => {
83
83
  test('correctly identifies positive uint32 values', () => {
84
- expect(isPositiveUint32(1)).toBe(true);
84
+ assert.isTrue(isPositiveUint32(1));
85
85
 
86
- expect(isPositiveUint32(1000)).toBe(true);
86
+ assert.isTrue(isPositiveUint32(1000));
87
87
 
88
- expect(isPositiveUint32(4_294_967_295)).toBe(true);
88
+ assert.isTrue(isPositiveUint32(4_294_967_295));
89
89
 
90
- expect(isPositiveUint32(2_147_483_648)).toBe(true);
90
+ assert.isTrue(isPositiveUint32(2_147_483_648));
91
91
  });
92
92
 
93
93
  test('correctly identifies zero', () => {
94
- expect(isPositiveUint32(0)).toBe(false);
94
+ assert.isFalse(isPositiveUint32(0));
95
95
  });
96
96
 
97
97
  test('correctly identifies values outside uint32 range', () => {
98
- expect(isPositiveUint32(4_294_967_296)).toBe(false);
98
+ assert.isFalse(isPositiveUint32(4_294_967_296));
99
99
 
100
- expect(isPositiveUint32(10_000_000_000)).toBe(false);
100
+ assert.isFalse(isPositiveUint32(10_000_000_000));
101
101
  });
102
102
 
103
103
  test('correctly identifies negative integers', () => {
104
- expect(isPositiveUint32(-1)).toBe(false);
104
+ assert.isFalse(isPositiveUint32(-1));
105
105
 
106
- expect(isPositiveUint32(-42)).toBe(false);
106
+ assert.isFalse(isPositiveUint32(-42));
107
107
  });
108
108
 
109
109
  test('correctly identifies non-integers', () => {
110
- expect(isPositiveUint32(Number.NaN)).toBe(false);
110
+ assert.isFalse(isPositiveUint32(Number.NaN));
111
111
 
112
- expect(isPositiveUint32(Number.POSITIVE_INFINITY)).toBe(false);
112
+ assert.isFalse(isPositiveUint32(Number.POSITIVE_INFINITY));
113
113
 
114
- expect(isPositiveUint32(Number.NEGATIVE_INFINITY)).toBe(false);
114
+ assert.isFalse(isPositiveUint32(Number.NEGATIVE_INFINITY));
115
115
 
116
- expect(isPositiveUint32(1.2)).toBe(false);
116
+ assert.isFalse(isPositiveUint32(1.2));
117
117
 
118
- expect(isPositiveUint32(-3.4)).toBe(false);
118
+ assert.isFalse(isPositiveUint32(-3.4));
119
119
  });
120
120
  });
121
121
 
@@ -220,9 +220,9 @@ describe('PositiveUint32 test', () => {
220
220
 
221
221
  expect(result).toBeLessThanOrEqual(max);
222
222
 
223
- expect(PositiveUint32.is(result)).toBe(true);
223
+ assert.isTrue(PositiveUint32.is(result));
224
224
 
225
- expect(Number.isInteger(result)).toBe(true);
225
+ assert.isTrue(Number.isInteger(result));
226
226
 
227
227
  expect(result).toBeGreaterThan(0);
228
228
  }