@augment-vir/assert 31.0.0 → 31.0.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 (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,5 +1,4 @@
1
1
  import { type MaybePromise, type NarrowToExpected } from '@augment-vir/core';
2
- import { autoGuardSymbol } from '../guard-types/guard-override.js';
3
2
  import { type WaitUntilOptions } from '../guard-types/wait-until-function.js';
4
3
  /**
5
4
  * All falsy values in JavaScript. This does not include `NaN` because there is no dedicated type
@@ -52,10 +51,6 @@ export type Falsy<T> = NarrowToExpected<T, FalsyValue>;
52
51
  * @package [`@augment-vir/assert`](https://www.npmjs.com/package/@augment-vir/assert)
53
52
  */
54
53
  export type Truthy<T> = Exclude<T, FalsyValue>;
55
- declare function isFalsy(input: unknown, failureMessage?: string | undefined): asserts input is FalsyValue;
56
- declare function isTruthy<const Actual>(input: Actual, failureMessage?: string | undefined): asserts input is Truthy<Actual>;
57
- declare function isTrue(input: unknown, failureMessage?: string | undefined): asserts input is true;
58
- declare function isFalse(input: unknown, failureMessage?: string | undefined): asserts input is false;
59
54
  export declare const booleanGuards: {
60
55
  assert: {
61
56
  /**
@@ -79,7 +74,7 @@ export declare const booleanGuards: {
79
74
  * - {@link assert.isTrue} : the opposite assertion.
80
75
  * - {@link assert.isFalsy} : a less exact assertion.
81
76
  */
82
- isFalse: typeof isFalse;
77
+ isFalse(this: void, input: unknown, failureMessage?: string | undefined): asserts input is false;
83
78
  /**
84
79
  * Asserts that a value is falsy.
85
80
  *
@@ -101,7 +96,7 @@ export declare const booleanGuards: {
101
96
  * - {@link assert.isTruthy} : the opposite assertion.
102
97
  * - {@link assert.isFalse} : a more exact assertion.
103
98
  */
104
- isFalsy: typeof isFalsy;
99
+ isFalsy(this: void, input: unknown, failureMessage?: string | undefined): asserts input is FalsyValue;
105
100
  /**
106
101
  * Asserts that a value is exactly `true`.
107
102
  *
@@ -123,7 +118,7 @@ export declare const booleanGuards: {
123
118
  * - {@link assert.isFalse} : the opposite assertion.
124
119
  * - {@link assert.isTruthy} : a less exact assertion.
125
120
  */
126
- isTrue: typeof isTrue;
121
+ isTrue(this: void, input: unknown, failureMessage?: string | undefined): asserts input is true;
127
122
  /**
128
123
  * Asserts that a value is truthy.
129
124
  *
@@ -145,7 +140,7 @@ export declare const booleanGuards: {
145
140
  * - {@link assert.isFalsy} : the opposite assertion.
146
141
  * - {@link assert.isTrue} : a more exact assertion.
147
142
  */
148
- isTruthy: typeof isTruthy;
143
+ isTruthy<const Actual>(this: void, input: Actual, failureMessage?: string | undefined): asserts input is Truthy<Actual>;
149
144
  };
150
145
  check: {
151
146
  /**
@@ -168,7 +163,7 @@ export declare const booleanGuards: {
168
163
  * - {@link check.isTrue} : the opposite check.
169
164
  * - {@link check.isFalsy} : a less exact check.
170
165
  */
171
- isFalse: typeof autoGuardSymbol;
166
+ isFalse(this: void, input: unknown): input is false;
172
167
  /**
173
168
  * Checks that a value is falsy.
174
169
  *
@@ -189,7 +184,7 @@ export declare const booleanGuards: {
189
184
  * - {@link check.isTruthy} : the opposite check.
190
185
  * - {@link check.isFalse} : a more exact check.
191
186
  */
192
- isFalsy: typeof autoGuardSymbol;
187
+ isFalsy(this: void, input: unknown): input is FalsyValue;
193
188
  /**
194
189
  * Checks that a value is exactly `true`.
195
190
  *
@@ -210,7 +205,7 @@ export declare const booleanGuards: {
210
205
  * - {@link check.isFalse} : the opposite check.
211
206
  * - {@link check.isTruthy} : a less exact check.
212
207
  */
213
- isTrue: typeof autoGuardSymbol;
208
+ isTrue(this: void, input: unknown): input is true;
214
209
  /**
215
210
  * Checks that a value is truthy.
216
211
  *
@@ -231,7 +226,7 @@ export declare const booleanGuards: {
231
226
  * - {@link check.isFalsy} : the opposite check.
232
227
  * - {@link check.isTrue} : a more exact check.
233
228
  */
234
- isTruthy: <T>(input: T) => input is Truthy<T>;
229
+ isTruthy<T>(this: void, input: T): input is Truthy<T>;
235
230
  };
236
231
  assertWrap: {
237
232
  /**
@@ -256,7 +251,7 @@ export declare const booleanGuards: {
256
251
  * - {@link assertWrap.isTrue} : the opposite assertion.
257
252
  * - {@link assertWrap.isFalsy} : a less exact assertion.
258
253
  */
259
- isFalse: typeof autoGuardSymbol;
254
+ isFalse(this: void, input: unknown, failureMessage?: undefined | string): false;
260
255
  /**
261
256
  * Asserts that a value is falsy. Returns the value if the assertion passes.
262
257
  *
@@ -279,7 +274,7 @@ export declare const booleanGuards: {
279
274
  * - {@link assertWrap.isTruthy} : the opposite assertion.
280
275
  * - {@link assertWrap.isFalse} : a more exact assertion.
281
276
  */
282
- isFalsy: <T>(input: T, failureMessage?: string | undefined) => Falsy<T>;
277
+ isFalsy<T>(this: void, input: T, failureMessage?: undefined | string): Falsy<T>;
283
278
  /**
284
279
  * Asserts that a value is exactly `true`. Returns the value if the assertion passes.
285
280
  *
@@ -302,7 +297,7 @@ export declare const booleanGuards: {
302
297
  * - {@link assertWrap.isFalse} : the opposite assertion.
303
298
  * - {@link assertWrap.isTruthy} : a less exact assertion.
304
299
  */
305
- isTrue: typeof autoGuardSymbol;
300
+ isTrue(this: void, input: unknown, failureMessage?: undefined | string): true;
306
301
  /**
307
302
  * Asserts that a value is truthy. Returns the value if the assertion passes.
308
303
  *
@@ -325,7 +320,7 @@ export declare const booleanGuards: {
325
320
  * - {@link assertWrap.isFalsy} : the opposite assertion.
326
321
  * - {@link assertWrap.isTrue} : a more exact assertion.
327
322
  */
328
- isTruthy: <T>(input: T, failureMessage?: string | undefined) => Truthy<T>;
323
+ isTruthy<T>(this: void, input: T, failureMessage?: undefined | string): Truthy<T>;
329
324
  };
330
325
  checkWrap: {
331
326
  /**
@@ -350,7 +345,7 @@ export declare const booleanGuards: {
350
345
  * - {@link checkWrap.isTrue} : the opposite check.
351
346
  * - {@link checkWrap.isFalsy} : a less exact check.
352
347
  */
353
- isFalse: typeof autoGuardSymbol;
348
+ isFalse(this: void, input: unknown): false | undefined;
354
349
  /**
355
350
  * Checks that a value is falsy. Returns the value if the check passes, otherwise
356
351
  * `undefined`.
@@ -373,7 +368,7 @@ export declare const booleanGuards: {
373
368
  * - {@link checkWrap.isTruthy} : the opposite check.
374
369
  * - {@link checkWrap.isFalse} : a more exact check.
375
370
  */
376
- isFalsy: <T>(input: T) => Falsy<T> | undefined;
371
+ isFalsy<T>(this: void, input: T): Falsy<T> | undefined;
377
372
  /**
378
373
  * Checks that a value is exactly `true`. Returns the value if the check passes, otherwise
379
374
  * `undefined`.
@@ -396,7 +391,7 @@ export declare const booleanGuards: {
396
391
  * - {@link checkWrap.isFalse} : the opposite check.
397
392
  * - {@link checkWrap.isTruthy} : a less exact check.
398
393
  */
399
- isTrue: typeof autoGuardSymbol;
394
+ isTrue(this: void, input: unknown): true | undefined;
400
395
  /**
401
396
  * Checks that a value is truthy. Returns the value if the check passes, otherwise
402
397
  * `undefined`.
@@ -419,7 +414,7 @@ export declare const booleanGuards: {
419
414
  * - {@link checkWrap.isFalsy} : the opposite check.
420
415
  * - {@link checkWrap.isTrue} : a more exact check.
421
416
  */
422
- isTruthy: <T>(input: T) => Truthy<T> | undefined;
417
+ isTruthy<T>(this: void, input: T): Truthy<T> | undefined;
423
418
  };
424
419
  waitUntil: {
425
420
  /**
@@ -445,7 +440,7 @@ export declare const booleanGuards: {
445
440
  * - {@link waitUntil.isTrue} : the opposite assertion.
446
441
  * - {@link waitUntil.isFalsy} : a less exact assertion.
447
442
  */
448
- isFalse: typeof autoGuardSymbol;
443
+ isFalse: (this: void, callback: () => MaybePromise<unknown>, options?: WaitUntilOptions | undefined, failureMessage?: string | undefined) => Promise<false>;
449
444
  /**
450
445
  * Repeatedly calls a callback until its output is falsy. Once the callback output passes,
451
446
  * it is returned. If the attempts time out, an error is thrown.
@@ -469,7 +464,7 @@ export declare const booleanGuards: {
469
464
  * - {@link waitUntil.isTruthy} : the opposite assertion.
470
465
  * - {@link waitUntil.isFalse} : a more exact assertion.
471
466
  */
472
- isFalsy: <Actual>(callback: () => MaybePromise<Actual>, options?: WaitUntilOptions | undefined, failureMessage?: string | undefined) => Promise<Falsy<Actual>>;
467
+ isFalsy: <Actual>(this: void, callback: () => MaybePromise<Actual>, options?: WaitUntilOptions | undefined, failureMessage?: string | undefined) => Promise<Falsy<Actual>>;
473
468
  /**
474
469
  * Repeatedly calls a callback until its output is exactly `true`. Once the callback output
475
470
  * passes, it is returned. If the attempts time out, an error is thrown.
@@ -493,7 +488,7 @@ export declare const booleanGuards: {
493
488
  * - {@link waitUntil.isFalse} : the opposite assertion.
494
489
  * - {@link waitUntil.isTruthy} : a less exact assertion.
495
490
  */
496
- isTrue: typeof autoGuardSymbol;
491
+ isTrue: (this: void, callback: () => MaybePromise<unknown>, options?: WaitUntilOptions | undefined, failureMessage?: string | undefined) => Promise<true>;
497
492
  /**
498
493
  * Repeatedly calls a callback until its output is truthy. Once the callback output passes,
499
494
  * it is returned. If the attempts time out, an error is thrown.
@@ -517,7 +512,6 @@ export declare const booleanGuards: {
517
512
  * - {@link waitUntil.isFalsy} : the opposite assertion.
518
513
  * - {@link waitUntil.isTrue} : a more exact assertion.
519
514
  */
520
- isTruthy: <Actual>(callback: () => MaybePromise<Actual>, options?: WaitUntilOptions | undefined, failureMessage?: string | undefined) => Promise<Truthy<Actual>>;
515
+ isTruthy: <Actual>(this: void, callback: () => MaybePromise<Actual>, options?: WaitUntilOptions | undefined, failureMessage?: string | undefined) => Promise<Truthy<Actual>>;
521
516
  };
522
517
  };
523
- export {};
@@ -1,31 +1,111 @@
1
1
  import { stringify } from '@augment-vir/core';
2
2
  import { AssertionError } from '../augments/assertion.error.js';
3
- import { autoGuard, autoGuardSymbol } from '../guard-types/guard-override.js';
4
- function isFalsy(input, failureMessage) {
5
- if (input) {
6
- throw new AssertionError(`'${stringify(input)}' is not truthy.`, failureMessage);
7
- }
8
- }
9
- function isTruthy(input, failureMessage) {
10
- if (!input) {
11
- throw new AssertionError(`'${stringify(input)}' is not truthy.`, failureMessage);
12
- }
13
- }
14
- function isTrue(input, failureMessage) {
15
- if (input !== true) {
16
- throw new AssertionError(`'${stringify(input)}' is not true.`, failureMessage);
17
- }
18
- }
19
- function isFalse(input, failureMessage) {
20
- if (input !== false) {
21
- throw new AssertionError(`'${stringify(input)}' is not false.`, failureMessage);
22
- }
23
- }
3
+ import { createWaitUntil } from '../guard-types/wait-until-function.js';
24
4
  const assertions = {
25
- isFalse,
26
- isFalsy,
27
- isTrue,
28
- isTruthy,
5
+ /**
6
+ * Asserts that a value is exactly `false`.
7
+ *
8
+ * Type guards the value.
9
+ *
10
+ * @example
11
+ *
12
+ * ```ts
13
+ * import {assert} from '@augment-vir/assert';
14
+ *
15
+ * assert.isFalse(true); // fails
16
+ * assert.isFalse(false); // passes
17
+ * assert.isFalse(1); // fails
18
+ * assert.isFalse(0); // fails
19
+ * ```
20
+ *
21
+ * @throws {@link AssertionError} If the value is not `false`.
22
+ * @see
23
+ * - {@link assert.isTrue} : the opposite assertion.
24
+ * - {@link assert.isFalsy} : a less exact assertion.
25
+ */
26
+ isFalse(input, failureMessage) {
27
+ if (input !== false) {
28
+ throw new AssertionError(`'${stringify(input)}' is not false.`, failureMessage);
29
+ }
30
+ },
31
+ /**
32
+ * Asserts that a value is falsy.
33
+ *
34
+ * Type guards the value when possible.
35
+ *
36
+ * @example
37
+ *
38
+ * ```ts
39
+ * import {assert} from '@augment-vir/assert';
40
+ *
41
+ * assert.isFalsy(true); // fails
42
+ * assert.isFalsy(false); // passes
43
+ * assert.isFalsy(1); // fails
44
+ * assert.isFalsy(0); // passes
45
+ * ```
46
+ *
47
+ * @throws {@link AssertionError} If the value is not falsy.
48
+ * @see
49
+ * - {@link assert.isTruthy} : the opposite assertion.
50
+ * - {@link assert.isFalse} : a more exact assertion.
51
+ */
52
+ isFalsy(input, failureMessage) {
53
+ if (input) {
54
+ throw new AssertionError(`'${stringify(input)}' is not falsy.`, failureMessage);
55
+ }
56
+ },
57
+ /**
58
+ * Asserts that a value is exactly `true`.
59
+ *
60
+ * Type guards the value.
61
+ *
62
+ * @example
63
+ *
64
+ * ```ts
65
+ * import {assert} from '@augment-vir/assert';
66
+ *
67
+ * assert.isTrue(true); // passes
68
+ * assert.isTrue(false); // fails
69
+ * assert.isTrue(1); // fails
70
+ * assert.isTrue(0); // fails
71
+ * ```
72
+ *
73
+ * @throws {@link AssertionError} If the value is not `true`.
74
+ * @see
75
+ * - {@link assert.isFalse} : the opposite assertion.
76
+ * - {@link assert.isTruthy} : a less exact assertion.
77
+ */
78
+ isTrue(input, failureMessage) {
79
+ if (input !== true) {
80
+ throw new AssertionError(`'${stringify(input)}' is not true.`, failureMessage);
81
+ }
82
+ },
83
+ /**
84
+ * Asserts that a value is truthy.
85
+ *
86
+ * Type guards the value.
87
+ *
88
+ * @example
89
+ *
90
+ * ```ts
91
+ * import {assert} from '@augment-vir/assert';
92
+ *
93
+ * assert.isTruthy(true); // passes
94
+ * assert.isTruthy(false); // fails
95
+ * assert.isTruthy(1); // passes
96
+ * assert.isTruthy(0); // fails
97
+ * ```
98
+ *
99
+ * @throws {@link AssertionError} If the value is not truthy.
100
+ * @see
101
+ * - {@link assert.isFalsy} : the opposite assertion.
102
+ * - {@link assert.isTrue} : a more exact assertion.
103
+ */
104
+ isTruthy(input, failureMessage) {
105
+ if (!input) {
106
+ throw new AssertionError(`'${stringify(input)}' is not truthy.`, failureMessage);
107
+ }
108
+ },
29
109
  };
30
110
  export const booleanGuards = {
31
111
  assert: assertions,
@@ -50,7 +130,9 @@ export const booleanGuards = {
50
130
  * - {@link check.isTrue} : the opposite check.
51
131
  * - {@link check.isFalsy} : a less exact check.
52
132
  */
53
- isFalse: autoGuardSymbol,
133
+ isFalse(input) {
134
+ return input === false;
135
+ },
54
136
  /**
55
137
  * Checks that a value is falsy.
56
138
  *
@@ -71,7 +153,9 @@ export const booleanGuards = {
71
153
  * - {@link check.isTruthy} : the opposite check.
72
154
  * - {@link check.isFalse} : a more exact check.
73
155
  */
74
- isFalsy: autoGuardSymbol,
156
+ isFalsy(input) {
157
+ return !input;
158
+ },
75
159
  /**
76
160
  * Checks that a value is exactly `true`.
77
161
  *
@@ -92,7 +176,9 @@ export const booleanGuards = {
92
176
  * - {@link check.isFalse} : the opposite check.
93
177
  * - {@link check.isTruthy} : a less exact check.
94
178
  */
95
- isTrue: autoGuardSymbol,
179
+ isTrue(input) {
180
+ return input === true;
181
+ },
96
182
  /**
97
183
  * Checks that a value is truthy.
98
184
  *
@@ -113,7 +199,9 @@ export const booleanGuards = {
113
199
  * - {@link check.isFalsy} : the opposite check.
114
200
  * - {@link check.isTrue} : a more exact check.
115
201
  */
116
- isTruthy: autoGuard(),
202
+ isTruthy(input) {
203
+ return !!input;
204
+ },
117
205
  },
118
206
  assertWrap: {
119
207
  /**
@@ -138,7 +226,14 @@ export const booleanGuards = {
138
226
  * - {@link assertWrap.isTrue} : the opposite assertion.
139
227
  * - {@link assertWrap.isFalsy} : a less exact assertion.
140
228
  */
141
- isFalse: autoGuardSymbol,
229
+ isFalse(input, failureMessage) {
230
+ if (input === false) {
231
+ return input;
232
+ }
233
+ else {
234
+ throw new AssertionError(`'${stringify(input)}' is not false.`, failureMessage);
235
+ }
236
+ },
142
237
  /**
143
238
  * Asserts that a value is falsy. Returns the value if the assertion passes.
144
239
  *
@@ -161,7 +256,14 @@ export const booleanGuards = {
161
256
  * - {@link assertWrap.isTruthy} : the opposite assertion.
162
257
  * - {@link assertWrap.isFalse} : a more exact assertion.
163
258
  */
164
- isFalsy: autoGuard(),
259
+ isFalsy(input, failureMessage) {
260
+ if (input) {
261
+ throw new AssertionError(`'${stringify(input)}' is not falsy.`, failureMessage);
262
+ }
263
+ else {
264
+ return input;
265
+ }
266
+ },
165
267
  /**
166
268
  * Asserts that a value is exactly `true`. Returns the value if the assertion passes.
167
269
  *
@@ -184,7 +286,14 @@ export const booleanGuards = {
184
286
  * - {@link assertWrap.isFalse} : the opposite assertion.
185
287
  * - {@link assertWrap.isTruthy} : a less exact assertion.
186
288
  */
187
- isTrue: autoGuardSymbol,
289
+ isTrue(input, failureMessage) {
290
+ if (input === true) {
291
+ return input;
292
+ }
293
+ else {
294
+ throw new AssertionError(`'${stringify(input)}' is not true.`, failureMessage);
295
+ }
296
+ },
188
297
  /**
189
298
  * Asserts that a value is truthy. Returns the value if the assertion passes.
190
299
  *
@@ -207,7 +316,14 @@ export const booleanGuards = {
207
316
  * - {@link assertWrap.isFalsy} : the opposite assertion.
208
317
  * - {@link assertWrap.isTrue} : a more exact assertion.
209
318
  */
210
- isTruthy: autoGuard(),
319
+ isTruthy(input, failureMessage) {
320
+ if (input) {
321
+ return input;
322
+ }
323
+ else {
324
+ throw new AssertionError(`'${stringify(input)}' is not truthy.`, failureMessage);
325
+ }
326
+ },
211
327
  },
212
328
  checkWrap: {
213
329
  /**
@@ -232,7 +348,14 @@ export const booleanGuards = {
232
348
  * - {@link checkWrap.isTrue} : the opposite check.
233
349
  * - {@link checkWrap.isFalsy} : a less exact check.
234
350
  */
235
- isFalse: autoGuardSymbol,
351
+ isFalse(input) {
352
+ if (input === false) {
353
+ return input;
354
+ }
355
+ else {
356
+ return undefined;
357
+ }
358
+ },
236
359
  /**
237
360
  * Checks that a value is falsy. Returns the value if the check passes, otherwise
238
361
  * `undefined`.
@@ -255,7 +378,14 @@ export const booleanGuards = {
255
378
  * - {@link checkWrap.isTruthy} : the opposite check.
256
379
  * - {@link checkWrap.isFalse} : a more exact check.
257
380
  */
258
- isFalsy: autoGuard(),
381
+ isFalsy(input) {
382
+ if (input) {
383
+ return undefined;
384
+ }
385
+ else {
386
+ return input;
387
+ }
388
+ },
259
389
  /**
260
390
  * Checks that a value is exactly `true`. Returns the value if the check passes, otherwise
261
391
  * `undefined`.
@@ -278,7 +408,14 @@ export const booleanGuards = {
278
408
  * - {@link checkWrap.isFalse} : the opposite check.
279
409
  * - {@link checkWrap.isTruthy} : a less exact check.
280
410
  */
281
- isTrue: autoGuardSymbol,
411
+ isTrue(input) {
412
+ if (input === true) {
413
+ return input;
414
+ }
415
+ else {
416
+ return undefined;
417
+ }
418
+ },
282
419
  /**
283
420
  * Checks that a value is truthy. Returns the value if the check passes, otherwise
284
421
  * `undefined`.
@@ -301,7 +438,14 @@ export const booleanGuards = {
301
438
  * - {@link checkWrap.isFalsy} : the opposite check.
302
439
  * - {@link checkWrap.isTrue} : a more exact check.
303
440
  */
304
- isTruthy: autoGuard(),
441
+ isTruthy(input) {
442
+ if (input) {
443
+ return input;
444
+ }
445
+ else {
446
+ return undefined;
447
+ }
448
+ },
305
449
  },
306
450
  waitUntil: {
307
451
  /**
@@ -327,7 +471,7 @@ export const booleanGuards = {
327
471
  * - {@link waitUntil.isTrue} : the opposite assertion.
328
472
  * - {@link waitUntil.isFalsy} : a less exact assertion.
329
473
  */
330
- isFalse: autoGuardSymbol,
474
+ isFalse: createWaitUntil(assertions.isFalse),
331
475
  /**
332
476
  * Repeatedly calls a callback until its output is falsy. Once the callback output passes,
333
477
  * it is returned. If the attempts time out, an error is thrown.
@@ -351,7 +495,7 @@ export const booleanGuards = {
351
495
  * - {@link waitUntil.isTruthy} : the opposite assertion.
352
496
  * - {@link waitUntil.isFalse} : a more exact assertion.
353
497
  */
354
- isFalsy: autoGuard(),
498
+ isFalsy: createWaitUntil(assertions.isFalsy),
355
499
  /**
356
500
  * Repeatedly calls a callback until its output is exactly `true`. Once the callback output
357
501
  * passes, it is returned. If the attempts time out, an error is thrown.
@@ -375,7 +519,7 @@ export const booleanGuards = {
375
519
  * - {@link waitUntil.isFalse} : the opposite assertion.
376
520
  * - {@link waitUntil.isTruthy} : a less exact assertion.
377
521
  */
378
- isTrue: autoGuardSymbol,
522
+ isTrue: createWaitUntil(assertions.isTrue),
379
523
  /**
380
524
  * Repeatedly calls a callback until its output is truthy. Once the callback output passes,
381
525
  * it is returned. If the attempts time out, an error is thrown.
@@ -399,6 +543,6 @@ export const booleanGuards = {
399
543
  * - {@link waitUntil.isFalsy} : the opposite assertion.
400
544
  * - {@link waitUntil.isTrue} : a more exact assertion.
401
545
  */
402
- isTruthy: autoGuard(),
546
+ isTruthy: createWaitUntil(assertions.isTruthy),
403
547
  },
404
548
  };