@augment-vir/assert 31.0.0 → 31.1.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 (63) hide show
  1. package/dist/assertions/boolean.d.ts +20 -26
  2. package/dist/assertions/boolean.js +185 -41
  3. package/dist/assertions/boundary.d.ts +40 -256
  4. package/dist/assertions/boundary.js +265 -229
  5. package/dist/assertions/enum.d.ts +12 -13
  6. package/dist/assertions/enum.js +98 -20
  7. package/dist/assertions/equality/entry-equality.d.ts +11 -15
  8. package/dist/assertions/equality/entry-equality.js +210 -43
  9. package/dist/assertions/equality/json-equality.d.ts +11 -15
  10. package/dist/assertions/equality/json-equality.js +144 -43
  11. package/dist/assertions/equality/simple-equality.d.ts +39 -46
  12. package/dist/assertions/equality/simple-equality.js +316 -61
  13. package/dist/assertions/extendable-assertions.d.ts +0 -12
  14. package/dist/assertions/extendable-assertions.js +0 -12
  15. package/dist/assertions/http.d.ts +10 -14
  16. package/dist/assertions/http.js +96 -28
  17. package/dist/assertions/instance.d.ts +10 -18
  18. package/dist/assertions/instance.js +92 -26
  19. package/dist/assertions/keys.d.ts +59 -138
  20. package/dist/assertions/keys.js +279 -162
  21. package/dist/assertions/length.d.ts +30 -212
  22. package/dist/assertions/length.js +117 -175
  23. package/dist/assertions/nullish.d.ts +8 -20
  24. package/dist/assertions/nullish.js +85 -27
  25. package/dist/assertions/numeric.d.ts +67 -81
  26. package/dist/assertions/numeric.js +564 -133
  27. package/dist/assertions/output.d.ts +2 -3
  28. package/dist/assertions/output.js +1 -7
  29. package/dist/assertions/primitive.d.ts +33 -40
  30. package/dist/assertions/primitive.js +232 -66
  31. package/dist/assertions/promise.d.ts +20 -30
  32. package/dist/assertions/promise.js +244 -53
  33. package/dist/assertions/regexp.d.ts +12 -14
  34. package/dist/assertions/regexp.js +84 -21
  35. package/dist/assertions/runtime-type.d.ts +99 -150
  36. package/dist/assertions/runtime-type.js +805 -229
  37. package/dist/assertions/throws.d.ts +24 -25
  38. package/dist/assertions/throws.js +43 -5
  39. package/dist/assertions/uuid.d.ts +11 -16
  40. package/dist/assertions/uuid.js +91 -22
  41. package/dist/assertions/values.d.ts +81 -210
  42. package/dist/assertions/values.js +627 -234
  43. package/dist/augments/guards/assert-wrap.d.ts +7 -4
  44. package/dist/augments/guards/assert-wrap.js +5 -4
  45. package/dist/augments/guards/check-wrap.d.ts +7 -5
  46. package/dist/augments/guards/check-wrap.js +5 -4
  47. package/dist/augments/guards/check.d.ts +5 -5
  48. package/dist/augments/guards/check.js +5 -4
  49. package/dist/augments/guards/wait-until.d.ts +8 -4
  50. package/dist/augments/guards/wait-until.js +7 -8
  51. package/dist/guard-types/guard-group.d.ts +5 -2
  52. package/dist/guard-types/wait-until-function.d.ts +2 -10
  53. package/dist/guard-types/wait-until-function.js +1 -9
  54. package/dist/index.d.ts +1 -0
  55. package/package.json +2 -2
  56. package/dist/guard-types/assert-wrap-function.d.ts +0 -12
  57. package/dist/guard-types/assert-wrap-function.js +0 -14
  58. package/dist/guard-types/check-function.d.ts +0 -14
  59. package/dist/guard-types/check-function.js +0 -22
  60. package/dist/guard-types/check-wrap-wrapper-function.d.ts +0 -12
  61. package/dist/guard-types/check-wrap-wrapper-function.js +0 -19
  62. package/dist/guard-types/guard-override.d.ts +0 -4
  63. package/dist/guard-types/guard-override.js +0 -10
@@ -1,87 +1,336 @@
1
1
  import { stringify } from '@augment-vir/core';
2
2
  import { AssertionError } from '../augments/assertion.error.js';
3
- import { autoGuardSymbol } from '../guard-types/guard-override.js';
4
- import { isNumber } from './runtime-type.js';
5
- function isAbove(actual, expected, failureMessage) {
6
- if (actual <= expected) {
7
- throw new AssertionError(`${actual} is not above ${expected}`, failureMessage);
8
- }
9
- }
10
- function isAtLeast(actual, expected, failureMessage) {
11
- if (actual < expected) {
12
- throw new AssertionError(`${actual} is not at least ${expected}`, failureMessage);
13
- }
14
- }
15
- function isInBounds(actual, { max, min }, failureMessage) {
16
- if (actual < min || max < actual) {
17
- throw new AssertionError(`${actual} is not within the bounds ${stringify({ min, max })}`, failureMessage);
18
- }
19
- }
20
- function isOutBounds(actual, { min, max }, failureMessage) {
21
- if (min <= actual && actual <= max) {
22
- throw new AssertionError(`${actual} is not outside the bounds ${stringify({ min, max })}`, failureMessage);
23
- }
24
- }
25
- function isInteger(actual, failureMessage) {
26
- isNumber(actual);
27
- if (!Number.isInteger(actual)) {
28
- throw new AssertionError(`${actual} is not an integer.`, failureMessage);
29
- }
30
- }
31
- function isNotInteger(actual, failureMessage) {
32
- if (Number.isInteger(actual)) {
33
- throw new AssertionError(`${actual} is an integer.`, failureMessage);
34
- }
35
- }
36
- function isBelow(actual, expected, failureMessage) {
37
- if (actual >= expected) {
38
- throw new AssertionError(`${actual} is not below ${expected}`, failureMessage);
39
- }
40
- }
41
- function isAtMost(actual, expected, failureMessage) {
42
- if (actual > expected) {
43
- throw new AssertionError(`${actual} is not at most ${expected}`, failureMessage);
44
- }
45
- }
46
- function isNaNGuard(actual, failureMessage) {
47
- if (!isNaN(actual)) {
48
- throw new AssertionError(`${actual} is not NaN`, failureMessage);
49
- }
50
- }
51
- function isFiniteGuard(actual, failureMessage) {
52
- if (isNaN(actual) || actual === Infinity || actual === -Infinity) {
53
- throw new AssertionError(`${actual} is not finite`, failureMessage);
54
- }
55
- }
56
- function isInfinite(actual, failureMessage) {
57
- if (actual !== Infinity && actual !== -Infinity) {
58
- throw new AssertionError(`${actual} is not infinite`, failureMessage);
59
- }
60
- }
61
- function isApproximately(actual, expected, delta, failureMessage) {
62
- if (actual < expected - delta || actual > expected + delta) {
63
- throw new AssertionError(`${actual} is not within ±${delta} of ${expected}`, failureMessage);
64
- }
65
- }
66
- function isNotApproximately(actual, expected, delta, failureMessage) {
67
- if (actual >= expected - delta && actual <= expected + delta) {
68
- throw new AssertionError(`${actual} is within ±${delta} of ${expected}`, failureMessage);
69
- }
70
- }
3
+ import { createWaitUntil } from '../guard-types/wait-until-function.js';
71
4
  const assertions = {
72
- isInBounds,
73
- isOutBounds,
74
- isInteger,
75
- isNotInteger,
76
- isAbove,
77
- isAtLeast,
78
- isBelow,
79
- isAtMost,
80
- isNaN: isNaNGuard,
81
- isFinite: isFiniteGuard,
82
- isInfinite,
83
- isApproximately,
84
- isNotApproximately,
5
+ /**
6
+ * Asserts that a number is inside the provided min and max bounds, inclusive.
7
+ *
8
+ * Performs no type guarding.
9
+ *
10
+ * @example
11
+ *
12
+ * ```ts
13
+ * import {assert} from '@augment-vir/assert';
14
+ *
15
+ * assert.isInBounds(5, {min: 1, max: 10}); // passes
16
+ * assert.isInBounds(10, {min: 1, max: 10}); // passes
17
+ * assert.isInBounds(11, {min: 1, max: 10}); // fails
18
+ * assert.isInBounds(0, {min: 1, max: 10}); // fails
19
+ * ```
20
+ *
21
+ * @throws {@link AssertionError} If the assertion fails.
22
+ * @see
23
+ * - {@link assert.isOutBounds} : the opposite assertion.
24
+ */
25
+ isInBounds(actual, { max, min }, failureMessage) {
26
+ if (actual < min || max < actual) {
27
+ throw new AssertionError(`${actual} is not within the bounds ${stringify({ min, max })}`, failureMessage);
28
+ }
29
+ },
30
+ /**
31
+ * Asserts that a number is outside the provided min and max bounds, exclusive.
32
+ *
33
+ * Performs no type guarding.
34
+ *
35
+ * @example
36
+ *
37
+ * ```ts
38
+ * import {assert} from '@augment-vir/assert';
39
+ *
40
+ * assert.isOutBounds(5, {min: 1, max: 10}); // fails
41
+ * assert.isOutBounds(10, {min: 1, max: 10}); // fails
42
+ * assert.isOutBounds(11, {min: 1, max: 10}); // passes
43
+ * assert.isOutBounds(0, {min: 1, max: 10}); // passes
44
+ * ```
45
+ *
46
+ * @throws {@link AssertionError} If the assertion fails.
47
+ * @see
48
+ * - {@link assert.isInBounds} : the opposite assertion.
49
+ */
50
+ isOutBounds(actual, { min, max }, failureMessage) {
51
+ if (min <= actual && actual <= max) {
52
+ throw new AssertionError(`${actual} is not outside the bounds ${stringify({ min, max })}`, failureMessage);
53
+ }
54
+ },
55
+ /**
56
+ * Asserts that a number is an integer. This has the same limitations as
57
+ * https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger.
58
+ *
59
+ * Performs no type guarding.
60
+ *
61
+ * @example
62
+ *
63
+ * ```ts
64
+ * import {assert} from '@augment-vir/assert';
65
+ *
66
+ * assert.isInteger(5); // passes
67
+ * assert.isInteger(5.0000000000000001); // passes
68
+ * assert.isInteger(5.1); // fails
69
+ * assert.isInteger(NaN); // fails
70
+ * ```
71
+ *
72
+ * @throws {@link AssertionError} If the assertion fails.
73
+ * @see
74
+ * - {@link assert.isNotInteger} : the opposite assertion.
75
+ */
76
+ isInteger(actual, failureMessage) {
77
+ if (typeof actual !== 'number' || isNaN(actual) || !Number.isInteger(actual)) {
78
+ throw new AssertionError(`${actual} is not an integer.`, failureMessage);
79
+ }
80
+ },
81
+ /**
82
+ * Asserts that a number is not an integer. This has the same limitations, as
83
+ * https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger.
84
+ *
85
+ * Performs no type guarding.
86
+ *
87
+ * @example
88
+ *
89
+ * ```ts
90
+ * import {assert} from '@augment-vir/assert';
91
+ *
92
+ * assert.isNotInteger(5); // fails
93
+ * assert.isNotInteger(5.0000000000000001); // fails
94
+ * assert.isNotInteger(5.1); // passes
95
+ * assert.isNotInteger(NaN); // passes
96
+ * ```
97
+ *
98
+ * @throws {@link AssertionError} If the assertion fails.
99
+ * @see
100
+ * - {@link assert.isInteger} : the opposite assertion.
101
+ */
102
+ isNotInteger(actual, failureMessage) {
103
+ if (Number.isInteger(actual)) {
104
+ throw new AssertionError(`${actual} is an integer.`, failureMessage);
105
+ }
106
+ },
107
+ /**
108
+ * Asserts that a number is above the expectation (`actual > expected`).
109
+ *
110
+ * Performs no type guarding.
111
+ *
112
+ * @example
113
+ *
114
+ * ```ts
115
+ * import {assert} from '@augment-vir/assert';
116
+ *
117
+ * assert.isAbove(10, 5); // passes
118
+ * assert.isAbove(5, 5); // fails
119
+ * assert.isAbove(5, 10); // fails
120
+ * ```
121
+ *
122
+ * @throws {@link AssertionError} If the assertion fails.
123
+ * @see
124
+ * - {@link assert.isBelow} : the opposite assertion.
125
+ * - {@link assert.isAtLeast} : the more lenient assertion.
126
+ */
127
+ isAbove(actual, expected, failureMessage) {
128
+ if (actual <= expected) {
129
+ throw new AssertionError(`${actual} is not above ${expected}`, failureMessage);
130
+ }
131
+ },
132
+ /**
133
+ * Asserts that a number is at least the expectation (`actual >= expected`).
134
+ *
135
+ * Performs no type guarding.
136
+ *
137
+ * @example
138
+ *
139
+ * ```ts
140
+ * import {assert} from '@augment-vir/assert';
141
+ *
142
+ * assert.isAtLeast(10, 5); // passes
143
+ * assert.isAtLeast(5, 5); // passes
144
+ * assert.isAtLeast(5, 10); // fails
145
+ * ```
146
+ *
147
+ * @throws {@link AssertionError} If the assertion fails.
148
+ * @see
149
+ * - {@link assert.isAtMost} : the opposite assertion.
150
+ * - {@link assert.isAbove} : the more restrictive assertion.
151
+ */
152
+ isAtLeast(actual, expected, failureMessage) {
153
+ if (actual < expected) {
154
+ throw new AssertionError(`${actual} is not at least ${expected}`, failureMessage);
155
+ }
156
+ },
157
+ /**
158
+ * Asserts that a number is below the expectation (`actual < expected`).
159
+ *
160
+ * Performs no type guarding.
161
+ *
162
+ * @example
163
+ *
164
+ * ```ts
165
+ * import {assert} from '@augment-vir/assert';
166
+ *
167
+ * assert.isBelow(10, 5); // fails
168
+ * assert.isBelow(5, 5); // fails
169
+ * assert.isBelow(5, 10); // passes
170
+ * ```
171
+ *
172
+ * @throws {@link AssertionError} If the assertion fails.
173
+ * @see
174
+ * - {@link assert.isAbove} : the opposite assertion.
175
+ * - {@link assert.isAtMost} : the more lenient assertion.
176
+ */
177
+ isBelow(actual, expected, failureMessage) {
178
+ if (actual >= expected) {
179
+ throw new AssertionError(`${actual} is not below ${expected}`, failureMessage);
180
+ }
181
+ },
182
+ /**
183
+ * Asserts that a number is at most the expectation (`actual <= expected`).
184
+ *
185
+ * Performs no type guarding.
186
+ *
187
+ * @example
188
+ *
189
+ * ```ts
190
+ * import {assert} from '@augment-vir/assert';
191
+ *
192
+ * assert.isAtMost(10, 5); // fails
193
+ * assert.isAtMost(5, 5); // passes
194
+ * assert.isAtMost(5, 10); // passes
195
+ * ```
196
+ *
197
+ * @throws {@link AssertionError} If the assertion fails.
198
+ * @see
199
+ * - {@link assert.isAtLeast} : the opposite assertion.
200
+ * - {@link assert.isBelow} : the more restrictive assertion.
201
+ */
202
+ isAtMost(actual, expected, failureMessage) {
203
+ if (actual > expected) {
204
+ throw new AssertionError(`${actual} is not at most ${expected}`, failureMessage);
205
+ }
206
+ },
207
+ /**
208
+ * Asserts that a number is
209
+ * [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN).
210
+ *
211
+ * Performs no type guarding.
212
+ *
213
+ * @example
214
+ *
215
+ * ```ts
216
+ * import {assert} from '@augment-vir/assert';
217
+ *
218
+ * assert.isNaN(10); // fails
219
+ * assert.isNaN(parseInt('invalid')); // passes
220
+ * assert.isNaN(Infinity); // fails
221
+ * ```
222
+ *
223
+ * @throws {@link AssertionError} If the assertion fails.
224
+ * @see
225
+ * - {@link assert.isNumber} : can be used as the opposite assertion.
226
+ */
227
+ isNaN(actual, failureMessage) {
228
+ if (!isNaN(actual)) {
229
+ throw new AssertionError(`${actual} is not NaN`, failureMessage);
230
+ }
231
+ },
232
+ /**
233
+ * Asserts that a number is finite: meaning, not `NaN` and not `Infinity` or `-Infinity`.
234
+ *
235
+ * Performs no type guarding.
236
+ *
237
+ * @example
238
+ *
239
+ * ```ts
240
+ * import {assert} from '@augment-vir/assert';
241
+ *
242
+ * assert.isFinite(10); // passes
243
+ * assert.isFinite(parseInt('invalid')); // fails
244
+ * assert.isFinite(Infinity); // fails
245
+ * assert.isFinite(-Infinity); // fails
246
+ * ```
247
+ *
248
+ * @throws {@link AssertionError} If the assertion fails.
249
+ * @see
250
+ * - {@link assert.isNaN} : an opposite assertion.
251
+ * - {@link assert.isInfinite} : an opposite assertion.
252
+ */
253
+ isFinite(actual, failureMessage) {
254
+ if (isNaN(actual) || actual === Infinity || actual === -Infinity) {
255
+ throw new AssertionError(`${actual} is not finite`, failureMessage);
256
+ }
257
+ },
258
+ /**
259
+ * Asserts that a number is either `Infinity` or `-Infinity`.
260
+ *
261
+ * Performs no type guarding.
262
+ *
263
+ * @example
264
+ *
265
+ * ```ts
266
+ * import {assert} from '@augment-vir/assert';
267
+ *
268
+ * assert.isInfinite(10); // fails
269
+ * assert.isInfinite(parseInt('invalid')); // fails
270
+ * assert.isInfinite(Infinity); // passes
271
+ * assert.isInfinite(-Infinity); // passes
272
+ * ```
273
+ *
274
+ * @throws {@link AssertionError} If the assertion fails.
275
+ * @see
276
+ * - {@link assert.isNaN} : an opposite assertion.
277
+ * - {@link assert.isInfinite} : an opposite assertion.
278
+ */
279
+ isInfinite(actual, failureMessage) {
280
+ if (actual !== Infinity && actual !== -Infinity) {
281
+ throw new AssertionError(`${actual} is not infinite`, failureMessage);
282
+ }
283
+ },
284
+ /**
285
+ * Asserts that a number is within ±`delta` of the expectation.
286
+ *
287
+ * Performs no type guarding.
288
+ *
289
+ * @example
290
+ *
291
+ * ```ts
292
+ * import {assert} from '@augment-vir/assert';
293
+ *
294
+ * assert.isApproximately(10, 8, 4); // passes
295
+ * assert.isApproximately(10, 12, 4); // passes
296
+ * assert.isApproximately(10, 8, 1); // fails
297
+ * assert.isApproximately(10, 12, 1); // fails
298
+ * ```
299
+ *
300
+ * @throws {@link AssertionError} If the assertion fails.
301
+ * @see
302
+ * - {@link assert.isNotApproximately} : the opposite assertion.
303
+ */
304
+ isApproximately(actual, expected, delta, failureMessage) {
305
+ if (actual < expected - delta || actual > expected + delta) {
306
+ throw new AssertionError(`${actual} is not within ±${delta} of ${expected}`, failureMessage);
307
+ }
308
+ },
309
+ /**
310
+ * Asserts that a number is outside ±`delta` of the expectation.
311
+ *
312
+ * Performs no type guarding.
313
+ *
314
+ * @example
315
+ *
316
+ * ```ts
317
+ * import {assert} from '@augment-vir/assert';
318
+ *
319
+ * assert.isNotApproximately(10, 8, 4); // fails
320
+ * assert.isNotApproximately(10, 12, 4); // fails
321
+ * assert.isNotApproximately(10, 8, 1); // passes
322
+ * assert.isNotApproximately(10, 12, 1); // passes
323
+ * ```
324
+ *
325
+ * @throws {@link AssertionError} If the assertion fails.
326
+ * @see
327
+ * - {@link assert.isApproximately} : the opposite assertion.
328
+ */
329
+ isNotApproximately(actual, expected, delta, failureMessage) {
330
+ if (actual >= expected - delta && actual <= expected + delta) {
331
+ throw new AssertionError(`${actual} is within ±${delta} of ${expected}`, failureMessage);
332
+ }
333
+ },
85
334
  };
86
335
  export const numericGuards = {
87
336
  assert: assertions,
@@ -105,7 +354,9 @@ export const numericGuards = {
105
354
  * @see
106
355
  * - {@link check.isOutBounds} : the opposite check.
107
356
  */
108
- isInBounds: autoGuardSymbol,
357
+ isInBounds(actual, { max, min }) {
358
+ return min <= actual && actual <= max;
359
+ },
109
360
  /**
110
361
  * Checks that a number is outside the provided min and max bounds, exclusive.
111
362
  *
@@ -125,7 +376,9 @@ export const numericGuards = {
125
376
  * @see
126
377
  * - {@link check.isInBounds} : the opposite check.
127
378
  */
128
- isOutBounds: autoGuardSymbol,
379
+ isOutBounds(actual, { max, min }) {
380
+ return actual < min || max < actual;
381
+ },
129
382
  /**
130
383
  * Checks that a number is an integer. This has the same limitations as
131
384
  * https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger.
@@ -146,7 +399,9 @@ export const numericGuards = {
146
399
  * @see
147
400
  * - {@link check.isNotInteger} : the opposite check.
148
401
  */
149
- isInteger: autoGuardSymbol,
402
+ isInteger(actual) {
403
+ return typeof actual === 'number' && !isNaN(actual) && Number.isInteger(actual);
404
+ },
150
405
  /**
151
406
  * Checks that a number is not an integer. This has the same limitations, as
152
407
  * https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger.
@@ -167,7 +422,9 @@ export const numericGuards = {
167
422
  * @see
168
423
  * - {@link check.isInteger} : the opposite check.
169
424
  */
170
- isNotInteger: autoGuardSymbol,
425
+ isNotInteger(actual) {
426
+ return typeof actual !== 'number' || isNaN(actual) || !Number.isInteger(actual);
427
+ },
171
428
  /**
172
429
  * Checks that a number is above the expectation (`actual > expected`).
173
430
  *
@@ -187,7 +444,9 @@ export const numericGuards = {
187
444
  * - {@link check.isBelow} : the opposite check.
188
445
  * - {@link check.isAtLeast} : the more lenient check.
189
446
  */
190
- isAbove: autoGuardSymbol,
447
+ isAbove(actual, expected) {
448
+ return actual > expected;
449
+ },
191
450
  /**
192
451
  * Checks that a number is at least the expectation (`actual >= expected`).
193
452
  *
@@ -207,7 +466,9 @@ export const numericGuards = {
207
466
  * - {@link check.isAtMost} : the opposite check.
208
467
  * - {@link check.isAbove} : the more restrictive check.
209
468
  */
210
- isAtLeast: autoGuardSymbol,
469
+ isAtLeast(actual, expected) {
470
+ return actual >= expected;
471
+ },
211
472
  /**
212
473
  * Checks that a number is below the expectation (`actual < expected`).
213
474
  *
@@ -227,7 +488,9 @@ export const numericGuards = {
227
488
  * - {@link check.isAbove} : the opposite check.
228
489
  * - {@link check.isAtMost} : the more lenient check.
229
490
  */
230
- isBelow: autoGuardSymbol,
491
+ isBelow(actual, expected) {
492
+ return actual < expected;
493
+ },
231
494
  /**
232
495
  * Checks that a number is at most the expectation (`actual <= expected`).
233
496
  *
@@ -247,7 +510,9 @@ export const numericGuards = {
247
510
  * - {@link check.isAtLeast} : the opposite check.
248
511
  * - {@link check.isBelow} : the more restrictive check.
249
512
  */
250
- isAtMost: autoGuardSymbol,
513
+ isAtMost(actual, expected) {
514
+ return actual <= expected;
515
+ },
251
516
  /**
252
517
  * Checks that a number is
253
518
  * [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN).
@@ -267,7 +532,9 @@ export const numericGuards = {
267
532
  * @see
268
533
  * - {@link check.isNumber} : can be used as the opposite check.
269
534
  */
270
- isNaN: autoGuardSymbol,
535
+ isNaN(input) {
536
+ return isNaN(input);
537
+ },
271
538
  /**
272
539
  * Checks that a number is finite: meaning, not `NaN` and not `Infinity` or `-Infinity`.
273
540
  *
@@ -288,7 +555,9 @@ export const numericGuards = {
288
555
  * - {@link check.isNaN} : an opposite check.
289
556
  * - {@link check.isInfinite} : an opposite check.
290
557
  */
291
- isFinite: autoGuardSymbol,
558
+ isFinite(actual) {
559
+ return !isNaN(actual) && actual !== Infinity && actual !== -Infinity;
560
+ },
292
561
  /**
293
562
  * Checks that a number is either `Infinity` or `-Infinity`.
294
563
  *
@@ -309,7 +578,9 @@ export const numericGuards = {
309
578
  * - {@link check.isNaN} : an opposite check.
310
579
  * - {@link check.isInfinite} : an opposite check.
311
580
  */
312
- isInfinite: autoGuardSymbol,
581
+ isInfinite(actual) {
582
+ return actual === Infinity || actual === -Infinity;
583
+ },
313
584
  /**
314
585
  * Checks that a number is within ±`delta` of the expectation.
315
586
  *
@@ -329,7 +600,9 @@ export const numericGuards = {
329
600
  * @see
330
601
  * - {@link check.isNotApproximately} : the opposite check.
331
602
  */
332
- isApproximately: autoGuardSymbol,
603
+ isApproximately(actual, expected, delta) {
604
+ return expected - delta <= actual && actual <= expected + delta;
605
+ },
333
606
  /**
334
607
  * Checks that a number is outside ±`delta` of the expectation.
335
608
  *
@@ -349,7 +622,9 @@ export const numericGuards = {
349
622
  * @see
350
623
  * - {@link check.isApproximately} : the opposite check.
351
624
  */
352
- isNotApproximately: autoGuardSymbol,
625
+ isNotApproximately(actual, expected, delta) {
626
+ return actual < expected - delta || actual > expected + delta;
627
+ },
353
628
  },
354
629
  assertWrap: {
355
630
  /**
@@ -373,7 +648,12 @@ export const numericGuards = {
373
648
  * @see
374
649
  * - {@link assertWrap.isOutBounds} : the opposite assertion.
375
650
  */
376
- isInBounds: autoGuardSymbol,
651
+ isInBounds(actual, { max, min }, failureMessage) {
652
+ if (actual < min || max < actual) {
653
+ throw new AssertionError(`${actual} is not within the bounds ${stringify({ min, max })}`, failureMessage);
654
+ }
655
+ return actual;
656
+ },
377
657
  /**
378
658
  * Asserts that a number is outside the provided min and max bounds, exclusive. Returns the
379
659
  * number if the assertion passes.
@@ -395,7 +675,12 @@ export const numericGuards = {
395
675
  * @see
396
676
  * - {@link assertWrap.isInBounds} : the opposite assertion.
397
677
  */
398
- isOutBounds: autoGuardSymbol,
678
+ isOutBounds(actual, { min, max }, failureMessage) {
679
+ if (min <= actual && actual <= max) {
680
+ throw new AssertionError(`${actual} is not outside the bounds ${stringify({ min, max })}`, failureMessage);
681
+ }
682
+ return actual;
683
+ },
399
684
  /**
400
685
  * Asserts that a number is an integer. Returns the number if the assertion passes. This has
401
686
  * the same limitations as
@@ -418,7 +703,12 @@ export const numericGuards = {
418
703
  * @see
419
704
  * - {@link assertWrap.isNotInteger} : the opposite assertion.
420
705
  */
421
- isInteger: autoGuardSymbol,
706
+ isInteger(actual, failureMessage) {
707
+ if (typeof actual !== 'number' || isNaN(actual) || !Number.isInteger(actual)) {
708
+ throw new AssertionError(`${actual} is not an integer.`, failureMessage);
709
+ }
710
+ return actual;
711
+ },
422
712
  /**
423
713
  * Asserts that a number is not an integer. Returns the number if the assertion passes. This
424
714
  * has the same limitations, as
@@ -441,7 +731,12 @@ export const numericGuards = {
441
731
  * @see
442
732
  * - {@link assertWrap.isInteger} : the opposite assertion.
443
733
  */
444
- isNotInteger: autoGuardSymbol,
734
+ isNotInteger(actual, failureMessage) {
735
+ if (Number.isInteger(actual)) {
736
+ throw new AssertionError(`${actual} is an integer.`, failureMessage);
737
+ }
738
+ return actual;
739
+ },
445
740
  /**
446
741
  * Asserts that a number is above the expectation (`actual > expected`). Returns the number
447
742
  * if the assertion passes.
@@ -464,7 +759,12 @@ export const numericGuards = {
464
759
  * - {@link assertWrap.isBelow} : the opposite assertion.
465
760
  * - {@link assertWrap.isAtLeast} : the more lenient assertion.
466
761
  */
467
- isAbove: autoGuardSymbol,
762
+ isAbove(actual, expected, failureMessage) {
763
+ if (actual <= expected) {
764
+ throw new AssertionError(`${actual} is not above ${expected}`, failureMessage);
765
+ }
766
+ return actual;
767
+ },
468
768
  /**
469
769
  * Asserts that a number is at least the expectation (`actual >= expected`). Returns the
470
770
  * number if the assertion passes.
@@ -487,7 +787,12 @@ export const numericGuards = {
487
787
  * - {@link assertWrap.isAtMost} : the opposite assertion.
488
788
  * - {@link assertWrap.isAbove} : the more restrictive assertion.
489
789
  */
490
- isAtLeast: autoGuardSymbol,
790
+ isAtLeast(actual, expected, failureMessage) {
791
+ if (actual < expected) {
792
+ throw new AssertionError(`${actual} is not at least ${expected}`, failureMessage);
793
+ }
794
+ return actual;
795
+ },
491
796
  /**
492
797
  * Asserts that a number is below the expectation (`actual < expected`). Returns the number
493
798
  * if the assertion passes.
@@ -510,7 +815,12 @@ export const numericGuards = {
510
815
  * - {@link assertWrap.isAbove} : the opposite assertion.
511
816
  * - {@link assertWrap.isAtMost} : the more lenient assertion.
512
817
  */
513
- isBelow: autoGuardSymbol,
818
+ isBelow(actual, expected, failureMessage) {
819
+ if (actual >= expected) {
820
+ throw new AssertionError(`${actual} is not below ${expected}`, failureMessage);
821
+ }
822
+ return actual;
823
+ },
514
824
  /**
515
825
  * Asserts that a number is at most the expectation (`actual <= expected`). Returns the
516
826
  * number if the assertion passes.
@@ -533,7 +843,12 @@ export const numericGuards = {
533
843
  * - {@link assertWrap.isAtLeast} : the opposite assertion.
534
844
  * - {@link assertWrap.isBelow} : the more restrictive assertion.
535
845
  */
536
- isAtMost: autoGuardSymbol,
846
+ isAtMost(actual, expected, failureMessage) {
847
+ if (actual > expected) {
848
+ throw new AssertionError(`${actual} is not at most ${expected}`, failureMessage);
849
+ }
850
+ return actual;
851
+ },
537
852
  /**
538
853
  * Asserts that a number is
539
854
  * [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN).
@@ -556,7 +871,12 @@ export const numericGuards = {
556
871
  * @see
557
872
  * - {@link assertWrap.isNumber} : can be used as the opposite assertion.
558
873
  */
559
- isNaN: autoGuardSymbol,
874
+ isNaN(actual, failureMessage) {
875
+ if (!isNaN(actual)) {
876
+ throw new AssertionError(`${actual} is not NaN`, failureMessage);
877
+ }
878
+ return actual;
879
+ },
560
880
  /**
561
881
  * Asserts that a number is finite: meaning, not `NaN` and not `Infinity` or `-Infinity`.
562
882
  * Returns the number if the assertion passes.
@@ -580,7 +900,12 @@ export const numericGuards = {
580
900
  * - {@link assertWrap.isNaN} : an opposite assertion.
581
901
  * - {@link assertWrap.isInfinite} : an opposite assertion.
582
902
  */
583
- isFinite: autoGuardSymbol,
903
+ isFinite(actual, failureMessage) {
904
+ if (isNaN(actual) || actual === Infinity || actual === -Infinity) {
905
+ throw new AssertionError(`${actual} is not finite`, failureMessage);
906
+ }
907
+ return actual;
908
+ },
584
909
  /**
585
910
  * Asserts that a number is either `Infinity` or `-Infinity`. Returns the number if the
586
911
  * assertion passes.
@@ -604,7 +929,12 @@ export const numericGuards = {
604
929
  * - {@link assertWrap.isNaN} : an opposite assertion.
605
930
  * - {@link assertWrap.isInfinite} : an opposite assertion.
606
931
  */
607
- isInfinite: autoGuardSymbol,
932
+ isInfinite(actual, failureMessage) {
933
+ if (actual !== Infinity && actual !== -Infinity) {
934
+ throw new AssertionError(`${actual} is not infinite`, failureMessage);
935
+ }
936
+ return actual;
937
+ },
608
938
  /**
609
939
  * Asserts that a number is within ±`delta` of the expectation. Returns the number if the
610
940
  * assertion passes.
@@ -627,7 +957,12 @@ export const numericGuards = {
627
957
  * @see
628
958
  * - {@link assertWrap.isNotApproximately} : the opposite assertion.
629
959
  */
630
- isApproximately: autoGuardSymbol,
960
+ isApproximately(actual, expected, delta, failureMessage) {
961
+ if (actual < expected - delta || actual > expected + delta) {
962
+ throw new AssertionError(`${actual} is not within ±${delta} of ${expected}`, failureMessage);
963
+ }
964
+ return actual;
965
+ },
631
966
  /**
632
967
  * Asserts that a number is outside ±`delta` of the expectation. Returns the number if the
633
968
  * assertion passes.
@@ -650,7 +985,12 @@ export const numericGuards = {
650
985
  * @see
651
986
  * - {@link assertWrap.isApproximately} : the opposite assertion.
652
987
  */
653
- isNotApproximately: autoGuardSymbol,
988
+ isNotApproximately(actual, expected, delta, failureMessage) {
989
+ if (actual >= expected - delta && actual <= expected + delta) {
990
+ throw new AssertionError(`${actual} is within ±${delta} of ${expected}`, failureMessage);
991
+ }
992
+ return actual;
993
+ },
654
994
  },
655
995
  checkWrap: {
656
996
  /**
@@ -673,7 +1013,14 @@ export const numericGuards = {
673
1013
  * @see
674
1014
  * - {@link checkWrap.isOutBounds} : the opposite check.
675
1015
  */
676
- isInBounds: autoGuardSymbol,
1016
+ isInBounds(actual, { max, min }) {
1017
+ if (min <= actual && actual <= max) {
1018
+ return actual;
1019
+ }
1020
+ else {
1021
+ return undefined;
1022
+ }
1023
+ },
677
1024
  /**
678
1025
  * Checks that a number is outside the provided min and max bounds, exclusive. Returns the
679
1026
  * number if the check passes, otherwise `undefined`.
@@ -694,7 +1041,14 @@ export const numericGuards = {
694
1041
  * @see
695
1042
  * - {@link checkWrap.isInBounds} : the opposite check.
696
1043
  */
697
- isOutBounds: autoGuardSymbol,
1044
+ isOutBounds(actual, { max, min }) {
1045
+ if (actual < min || max < actual) {
1046
+ return actual;
1047
+ }
1048
+ else {
1049
+ return undefined;
1050
+ }
1051
+ },
698
1052
  /**
699
1053
  * Checks that a number is an integer. Returns the number if the check passes, otherwise
700
1054
  * `undefined`. This has the same limitations as
@@ -716,7 +1070,14 @@ export const numericGuards = {
716
1070
  * @see
717
1071
  * - {@link checkWrap.isNotInteger} : the opposite check.
718
1072
  */
719
- isInteger: autoGuardSymbol,
1073
+ isInteger(actual) {
1074
+ if (typeof actual === 'number' && !isNaN(actual) && Number.isInteger(actual)) {
1075
+ return actual;
1076
+ }
1077
+ else {
1078
+ return undefined;
1079
+ }
1080
+ },
720
1081
  /**
721
1082
  * Checks that a number is not an integer. Returns the number if the check passes, otherwise
722
1083
  * `undefined`. This has the same limitations, as
@@ -738,7 +1099,14 @@ export const numericGuards = {
738
1099
  * @see
739
1100
  * - {@link checkWrap.isInteger} : the opposite check.
740
1101
  */
741
- isNotInteger: autoGuardSymbol,
1102
+ isNotInteger(actual) {
1103
+ if (typeof actual !== 'number' || isNaN(actual) || !Number.isInteger(actual)) {
1104
+ return actual;
1105
+ }
1106
+ else {
1107
+ return undefined;
1108
+ }
1109
+ },
742
1110
  /**
743
1111
  * Checks that a number is above the expectation (`actual > expected`). Returns the number
744
1112
  * if the check passes, otherwise `undefined`.
@@ -760,7 +1128,14 @@ export const numericGuards = {
760
1128
  * - {@link checkWrap.isBelow} : the opposite check.
761
1129
  * - {@link checkWrap.isAtLeast} : the more lenient check.
762
1130
  */
763
- isAbove: autoGuardSymbol,
1131
+ isAbove(actual, expected) {
1132
+ if (actual > expected) {
1133
+ return actual;
1134
+ }
1135
+ else {
1136
+ return undefined;
1137
+ }
1138
+ },
764
1139
  /**
765
1140
  * Checks that a number is at least the expectation (`actual >= expected`). Returns the
766
1141
  * number if the check passes, otherwise `undefined`.
@@ -782,7 +1157,14 @@ export const numericGuards = {
782
1157
  * - {@link checkWrap.isAtMost} : the opposite check.
783
1158
  * - {@link checkWrap.isAbove} : the more restrictive check.
784
1159
  */
785
- isAtLeast: autoGuardSymbol,
1160
+ isAtLeast(actual, expected) {
1161
+ if (actual >= expected) {
1162
+ return actual;
1163
+ }
1164
+ else {
1165
+ return undefined;
1166
+ }
1167
+ },
786
1168
  /**
787
1169
  * Checks that a number is below the expectation (`actual < expected`). Returns the number
788
1170
  * if the check passes, otherwise `undefined`.
@@ -804,7 +1186,14 @@ export const numericGuards = {
804
1186
  * - {@link checkWrap.isAbove} : the opposite check.
805
1187
  * - {@link checkWrap.isAtMost} : the more lenient check.
806
1188
  */
807
- isBelow: autoGuardSymbol,
1189
+ isBelow(actual, expected) {
1190
+ if (actual < expected) {
1191
+ return actual;
1192
+ }
1193
+ else {
1194
+ return undefined;
1195
+ }
1196
+ },
808
1197
  /**
809
1198
  * Checks that a number is at most the expectation (`actual <= expected`). Returns the
810
1199
  * number if the check passes, otherwise `undefined`.
@@ -826,7 +1215,14 @@ export const numericGuards = {
826
1215
  * - {@link checkWrap.isAtLeast} : the opposite check.
827
1216
  * - {@link checkWrap.isBelow} : the more restrictive check.
828
1217
  */
829
- isAtMost: autoGuardSymbol,
1218
+ isAtMost(actual, expected) {
1219
+ if (actual <= expected) {
1220
+ return actual;
1221
+ }
1222
+ else {
1223
+ return undefined;
1224
+ }
1225
+ },
830
1226
  /**
831
1227
  * Checks that a number is
832
1228
  * [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN).
@@ -848,7 +1244,14 @@ export const numericGuards = {
848
1244
  * @see
849
1245
  * - {@link checkWrap.isNumber} : can be used as the opposite check.
850
1246
  */
851
- isNaN: autoGuardSymbol,
1247
+ isNaN(actual) {
1248
+ if (isNaN(actual)) {
1249
+ return actual;
1250
+ }
1251
+ else {
1252
+ return undefined;
1253
+ }
1254
+ },
852
1255
  /**
853
1256
  * Checks that a number is finite: meaning, not `NaN` and not `Infinity` or `-Infinity`.
854
1257
  * Returns the number if the check passes, otherwise `undefined`.
@@ -871,7 +1274,14 @@ export const numericGuards = {
871
1274
  * - {@link checkWrap.isNaN} : an opposite check.
872
1275
  * - {@link checkWrap.isInfinite} : an opposite check.
873
1276
  */
874
- isFinite: autoGuardSymbol,
1277
+ isFinite(actual) {
1278
+ if (!isNaN(actual) && actual !== Infinity && actual !== -Infinity) {
1279
+ return actual;
1280
+ }
1281
+ else {
1282
+ return undefined;
1283
+ }
1284
+ },
875
1285
  /**
876
1286
  * Checks that a number is either `Infinity` or `-Infinity`. Returns the number if the check
877
1287
  * passes, otherwise `undefined`.
@@ -894,7 +1304,14 @@ export const numericGuards = {
894
1304
  * - {@link checkWrap.isNaN} : an opposite check.
895
1305
  * - {@link checkWrap.isInfinite} : an opposite check.
896
1306
  */
897
- isInfinite: autoGuardSymbol,
1307
+ isInfinite(actual) {
1308
+ if (actual === Infinity || actual === -Infinity) {
1309
+ return actual;
1310
+ }
1311
+ else {
1312
+ return undefined;
1313
+ }
1314
+ },
898
1315
  /**
899
1316
  * Checks that a number is within ±`delta` of the expectation. Returns the number if the
900
1317
  * check passes, otherwise `undefined`.
@@ -916,7 +1333,14 @@ export const numericGuards = {
916
1333
  * @see
917
1334
  * - {@link checkWrap.isNotApproximately} : the opposite check.
918
1335
  */
919
- isApproximately: autoGuardSymbol,
1336
+ isApproximately(actual, expected, delta) {
1337
+ if (expected - delta <= actual && actual <= expected + delta) {
1338
+ return actual;
1339
+ }
1340
+ else {
1341
+ return undefined;
1342
+ }
1343
+ },
920
1344
  /**
921
1345
  * Checks that a number is outside ±`delta` of the expectation. Returns the number if the
922
1346
  * check passes, otherwise `undefined`.
@@ -938,7 +1362,14 @@ export const numericGuards = {
938
1362
  * @see
939
1363
  * - {@link checkWrap.isApproximately} : the opposite check.
940
1364
  */
941
- isNotApproximately: autoGuardSymbol,
1365
+ isNotApproximately(actual, expected, delta) {
1366
+ if (actual < expected - delta || actual > expected + delta) {
1367
+ return actual;
1368
+ }
1369
+ else {
1370
+ return undefined;
1371
+ }
1372
+ },
942
1373
  },
943
1374
  waitUntil: {
944
1375
  /**
@@ -962,7 +1393,7 @@ export const numericGuards = {
962
1393
  * @see
963
1394
  * - {@link waitUntil.isOutBounds} : the opposite assertion.
964
1395
  */
965
- isInBounds: autoGuardSymbol,
1396
+ isInBounds: createWaitUntil(assertions.isInBounds),
966
1397
  /**
967
1398
  * Repeatedly calls a callback until its output is outside the provided min and max bounds,
968
1399
  * exclusive. If the attempts time out, an error is thrown.
@@ -984,7 +1415,7 @@ export const numericGuards = {
984
1415
  * @see
985
1416
  * - {@link waitUntil.isInBounds} : the opposite assertion.
986
1417
  */
987
- isOutBounds: autoGuardSymbol,
1418
+ isOutBounds: createWaitUntil(assertions.isOutBounds),
988
1419
  /**
989
1420
  * Repeatedly calls a callback until its output is an integer. This has the same limitations
990
1421
  * as
@@ -1008,7 +1439,7 @@ export const numericGuards = {
1008
1439
  * @see
1009
1440
  * - {@link waitUntil.isNotInteger} : the opposite assertion.
1010
1441
  */
1011
- isInteger: autoGuardSymbol,
1442
+ isInteger: createWaitUntil(assertions.isInteger),
1012
1443
  /**
1013
1444
  * Repeatedly calls a callback until its output is not an integer. This has the same
1014
1445
  * limitations, as
@@ -1032,7 +1463,7 @@ export const numericGuards = {
1032
1463
  * @see
1033
1464
  * - {@link waitUntil.isInteger} : the opposite assertion.
1034
1465
  */
1035
- isNotInteger: autoGuardSymbol,
1466
+ isNotInteger: createWaitUntil(assertions.isNotInteger),
1036
1467
  /**
1037
1468
  * Repeatedly calls a callback until its output is a number that is above the expectation
1038
1469
  * (`actual > expected`). Once the callback output passes, it is returned. If the attempts
@@ -1056,7 +1487,7 @@ export const numericGuards = {
1056
1487
  * - {@link waitUntil.isBelow} : the opposite assertion.
1057
1488
  * - {@link waitUntil.isAtLeast} : the more lenient assertion.
1058
1489
  */
1059
- isAbove: autoGuardSymbol,
1490
+ isAbove: createWaitUntil(assertions.isAbove),
1060
1491
  /**
1061
1492
  * Repeatedly calls a callback until its output is a number that is at least the expectation
1062
1493
  * (`actual >= expected`). Once the callback output passes, it is returned. If the attempts
@@ -1080,7 +1511,7 @@ export const numericGuards = {
1080
1511
  * - {@link waitUntil.isAtMost} : the opposite assertion.
1081
1512
  * - {@link waitUntil.isAbove} : the more restrictive assertion.
1082
1513
  */
1083
- isAtLeast: autoGuardSymbol,
1514
+ isAtLeast: createWaitUntil(assertions.isAtLeast),
1084
1515
  /**
1085
1516
  * Repeatedly calls a callback until its output is a number that is below the expectation
1086
1517
  * (`actual < expected`). Once the callback output passes, it is returned. If the attempts
@@ -1104,7 +1535,7 @@ export const numericGuards = {
1104
1535
  * - {@link waitUntil.isAbove} : the opposite assertion.
1105
1536
  * - {@link waitUntil.isAtMost} : the more lenient assertion.
1106
1537
  */
1107
- isBelow: autoGuardSymbol,
1538
+ isBelow: createWaitUntil(assertions.isBelow),
1108
1539
  /**
1109
1540
  * Repeatedly calls a callback until its output is a number that is at most the expectation
1110
1541
  * (`actual <= expected`). Once the callback output passes, it is returned. If the attempts
@@ -1128,7 +1559,7 @@ export const numericGuards = {
1128
1559
  * - {@link waitUntil.isAtLeast} : the opposite assertion.
1129
1560
  * - {@link waitUntil.isBelow} : the more restrictive assertion.
1130
1561
  */
1131
- isAtMost: autoGuardSymbol,
1562
+ isAtMost: createWaitUntil(assertions.isAtMost),
1132
1563
  /**
1133
1564
  * Repeatedly calls a callback until its output is a number that is
1134
1565
  * [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN).
@@ -1152,7 +1583,7 @@ export const numericGuards = {
1152
1583
  * @see
1153
1584
  * - {@link waitUntil.isNumber} : can be used as the opposite assertion.
1154
1585
  */
1155
- isNaN: autoGuardSymbol,
1586
+ isNaN: createWaitUntil(assertions.isNaN),
1156
1587
  /**
1157
1588
  * Repeatedly calls a callback until its output is a number that is finite: meaning, not
1158
1589
  * `NaN` and not `Infinity` or `-Infinity`. Once the callback output passes, it is returned.
@@ -1177,7 +1608,7 @@ export const numericGuards = {
1177
1608
  * - {@link waitUntil.isNaN} : an opposite assertion.
1178
1609
  * - {@link waitUntil.isInfinite} : an opposite assertion.
1179
1610
  */
1180
- isFinite: autoGuardSymbol,
1611
+ isFinite: createWaitUntil(assertions.isFinite),
1181
1612
  /**
1182
1613
  * Repeatedly calls a callback until its output is a number that is either `Infinity` or
1183
1614
  * `-Infinity`. Once the callback output passes, it is returned. If the attempts time out,
@@ -1202,7 +1633,7 @@ export const numericGuards = {
1202
1633
  * - {@link waitUntil.isNaN} : an opposite assertion.
1203
1634
  * - {@link waitUntil.isInfinite} : an opposite assertion.
1204
1635
  */
1205
- isInfinite: autoGuardSymbol,
1636
+ isInfinite: createWaitUntil(assertions.isInfinite),
1206
1637
  /**
1207
1638
  * Repeatedly calls a callback until its output is a number that is within ±`delta` of the
1208
1639
  * expectation. Once the callback output passes, it is returned. If the attempts time out,
@@ -1226,7 +1657,7 @@ export const numericGuards = {
1226
1657
  * @see
1227
1658
  * - {@link waitUntil.isNotApproximately} : the opposite assertion.
1228
1659
  */
1229
- isApproximately: autoGuardSymbol,
1660
+ isApproximately: createWaitUntil(assertions.isApproximately),
1230
1661
  /**
1231
1662
  * Repeatedly calls a callback until its output is a number that is outside ±`delta` of the
1232
1663
  * expectation. Once the callback output passes, it is returned. If the attempts time out,
@@ -1250,6 +1681,6 @@ export const numericGuards = {
1250
1681
  * @see
1251
1682
  * - {@link waitUntil.isApproximately} : the opposite assertion.
1252
1683
  */
1253
- isNotApproximately: autoGuardSymbol,
1684
+ isNotApproximately: createWaitUntil(assertions.isNotApproximately),
1254
1685
  },
1255
1686
  };