@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
@@ -39,20 +39,8 @@ export declare const boundaryGuards: {
39
39
  *
40
40
  * assert.endsWith('ab', 'b'); // passes
41
41
  * assert.endsWith('ab', 'a'); // fails
42
- * assert.endsWith(
43
- * [
44
- * 'a',
45
- * 'b',
46
- * ],
47
- * 'b',
48
- * ); // passes
49
- * assert.endsWith(
50
- * [
51
- * 'a',
52
- * 'b',
53
- * ],
54
- * 'a',
55
- * ); // fails
42
+ * assert.endsWith(['a', 'b'], 'b'); // passes
43
+ * assert.endsWith(['a', 'b'], 'a'); // fails
56
44
  * ```
57
45
  *
58
46
  * @throws {@link AssertionError} If the parent does not end with the child.
@@ -74,20 +62,8 @@ export declare const boundaryGuards: {
74
62
  *
75
63
  * assert.endsWithout('ab', 'b'); // fails
76
64
  * assert.endsWithout('ab', 'a'); // passes
77
- * assert.endsWithout(
78
- * [
79
- * 'a',
80
- * 'b',
81
- * ],
82
- * 'b',
83
- * ); // fails
84
- * assert.endsWithout(
85
- * [
86
- * 'a',
87
- * 'b',
88
- * ],
89
- * 'a',
90
- * ); // passes
65
+ * assert.endsWithout(['a', 'b'], 'b'); // fails
66
+ * assert.endsWithout(['a', 'b'], 'a'); // passes
91
67
  * ```
92
68
  *
93
69
  * @throws {@link AssertionError} If the parent ends with the child.
@@ -109,20 +85,8 @@ export declare const boundaryGuards: {
109
85
  *
110
86
  * assert.startsWith('ab', 'b'); // fails
111
87
  * assert.startsWith('ab', 'a'); // passes
112
- * assert.startsWith(
113
- * [
114
- * 'a',
115
- * 'b',
116
- * ],
117
- * 'b',
118
- * ); // fails
119
- * assert.startsWith(
120
- * [
121
- * 'a',
122
- * 'b',
123
- * ],
124
- * 'a',
125
- * ); // passes
88
+ * assert.startsWith(['a', 'b'], 'b'); // fails
89
+ * assert.startsWith(['a', 'b'], 'a'); // passes
126
90
  * ```
127
91
  *
128
92
  * @throws {@link AssertionError} If the parent does not start with the child.
@@ -144,20 +108,8 @@ export declare const boundaryGuards: {
144
108
  *
145
109
  * assert.startsWith('ab', 'b'); // passes
146
110
  * assert.startsWith('ab', 'a'); // fails
147
- * assert.startsWith(
148
- * [
149
- * 'a',
150
- * 'b',
151
- * ],
152
- * 'b',
153
- * ); // passes
154
- * assert.startsWith(
155
- * [
156
- * 'a',
157
- * 'b',
158
- * ],
159
- * 'a',
160
- * ); // fails
111
+ * assert.startsWith(['a', 'b'], 'b'); // passes
112
+ * assert.startsWith(['a', 'b'], 'a'); // fails
161
113
  * ```
162
114
  *
163
115
  * @throws {@link AssertionError} If the parent does start with the child.
@@ -181,20 +133,8 @@ export declare const boundaryGuards: {
181
133
  *
182
134
  * check.endsWith('ab', 'b'); // returns `true`
183
135
  * check.endsWith('ab', 'a'); // returns `false`
184
- * check.endsWith(
185
- * [
186
- * 'a',
187
- * 'b',
188
- * ],
189
- * 'b',
190
- * ); // returns `true`
191
- * check.endsWith(
192
- * [
193
- * 'a',
194
- * 'b',
195
- * ],
196
- * 'a',
197
- * ); // returns `false`
136
+ * check.endsWith(['a', 'b'], 'b'); // returns `true`
137
+ * check.endsWith(['a', 'b'], 'a'); // returns `false`
198
138
  * ```
199
139
  *
200
140
  * @see
@@ -215,20 +155,8 @@ export declare const boundaryGuards: {
215
155
  *
216
156
  * check.endsWithout('ab', 'b'); // returns `false`
217
157
  * check.endsWithout('ab', 'a'); // returns `true`
218
- * check.endsWithout(
219
- * [
220
- * 'a',
221
- * 'b',
222
- * ],
223
- * 'b',
224
- * ); // returns `false`
225
- * check.endsWithout(
226
- * [
227
- * 'a',
228
- * 'b',
229
- * ],
230
- * 'a',
231
- * ); // returns `true`
158
+ * check.endsWithout(['a', 'b'], 'b'); // returns `false`
159
+ * check.endsWithout(['a', 'b'], 'a'); // returns `true`
232
160
  * ```
233
161
  *
234
162
  * @see
@@ -249,20 +177,8 @@ export declare const boundaryGuards: {
249
177
  *
250
178
  * check.startsWith('ab', 'b'); // returns `false`
251
179
  * check.startsWith('ab', 'a'); // returns `true`
252
- * check.startsWith(
253
- * [
254
- * 'a',
255
- * 'b',
256
- * ],
257
- * 'b',
258
- * ); // returns `false`
259
- * check.startsWith(
260
- * [
261
- * 'a',
262
- * 'b',
263
- * ],
264
- * 'a',
265
- * ); // returns `true`
180
+ * check.startsWith(['a', 'b'], 'b'); // returns `false`
181
+ * check.startsWith(['a', 'b'], 'a'); // returns `true`
266
182
  * ```
267
183
  *
268
184
  * @see
@@ -283,20 +199,8 @@ export declare const boundaryGuards: {
283
199
  *
284
200
  * check.startsWith('ab', 'b'); // returns `false`
285
201
  * check.startsWith('ab', 'a'); // returns `true`
286
- * check.startsWith(
287
- * [
288
- * 'a',
289
- * 'b',
290
- * ],
291
- * 'b',
292
- * ); // returns `false`
293
- * check.startsWith(
294
- * [
295
- * 'a',
296
- * 'b',
297
- * ],
298
- * 'a',
299
- * ); // returns `true`
202
+ * check.startsWith(['a', 'b'], 'b'); // returns `false`
203
+ * check.startsWith(['a', 'b'], 'a'); // returns `true`
300
204
  * ```
301
205
  *
302
206
  * @see
@@ -319,20 +223,8 @@ export declare const boundaryGuards: {
319
223
  *
320
224
  * assertWrap.endsWith('ab', 'b'); // returns `'ab'`
321
225
  * assertWrap.endsWith('ab', 'a'); // throws an error
322
- * assertWrap.endsWith(
323
- * [
324
- * 'a',
325
- * 'b',
326
- * ],
327
- * 'b',
328
- * ); // returns `['a', 'b']`
329
- * assertWrap.endsWith(
330
- * [
331
- * 'a',
332
- * 'b',
333
- * ],
334
- * 'a',
335
- * ); // throws an error
226
+ * assertWrap.endsWith(['a', 'b'], 'b'); // returns `['a', 'b']`
227
+ * assertWrap.endsWith(['a', 'b'], 'a'); // throws an error
336
228
  * ```
337
229
  *
338
230
  * @returns The parent value if it does end with the child.
@@ -356,20 +248,8 @@ export declare const boundaryGuards: {
356
248
  *
357
249
  * assertWrap.endsWithout('ab', 'b'); // throws an error
358
250
  * assertWrap.endsWithout('ab', 'a'); // returns `'ab'`
359
- * assertWrap.endsWithout(
360
- * [
361
- * 'a',
362
- * 'b',
363
- * ],
364
- * 'b',
365
- * ); // throws an error
366
- * assertWrap.endsWithout(
367
- * [
368
- * 'a',
369
- * 'b',
370
- * ],
371
- * 'a',
372
- * ); // returns `['a', 'b']`
251
+ * assertWrap.endsWithout(['a', 'b'], 'b'); // throws an error
252
+ * assertWrap.endsWithout(['a', 'b'], 'a'); // returns `['a', 'b']`
373
253
  * ```
374
254
  *
375
255
  * @returns The parent value if it does not end with the child.
@@ -392,20 +272,8 @@ export declare const boundaryGuards: {
392
272
  *
393
273
  * assertWrap.startsWith('ab', 'b'); // throws an error
394
274
  * assertWrap.startsWith('ab', 'a'); // returns `'ab'`
395
- * assertWrap.startsWith(
396
- * [
397
- * 'a',
398
- * 'b',
399
- * ],
400
- * 'b',
401
- * ); // throws an error
402
- * assertWrap.startsWith(
403
- * [
404
- * 'a',
405
- * 'b',
406
- * ],
407
- * 'a',
408
- * ); // returns `['a', 'b']`
275
+ * assertWrap.startsWith(['a', 'b'], 'b'); // throws an error
276
+ * assertWrap.startsWith(['a', 'b'], 'a'); // returns `['a', 'b']`
409
277
  * ```
410
278
  *
411
279
  * @returns The parent value if it starts with the child.
@@ -428,20 +296,8 @@ export declare const boundaryGuards: {
428
296
  *
429
297
  * assertWrap.startsWith('ab', 'b'); // returns `'ab'`
430
298
  * assertWrap.startsWith('ab', 'a'); // throws an error
431
- * assertWrap.startsWith(
432
- * [
433
- * 'a',
434
- * 'b',
435
- * ],
436
- * 'b',
437
- * ); // returns `['a', 'b']`
438
- * assertWrap.startsWith(
439
- * [
440
- * 'a',
441
- * 'b',
442
- * ],
443
- * 'a',
444
- * ); // throws an error
299
+ * assertWrap.startsWith(['a', 'b'], 'b'); // returns `['a', 'b']`
300
+ * assertWrap.startsWith(['a', 'b'], 'a'); // throws an error
445
301
  * ```
446
302
  *
447
303
  * @returns The parent value if it does not start with the child.
@@ -467,20 +323,8 @@ export declare const boundaryGuards: {
467
323
  *
468
324
  * checkWrap.endsWith('ab', 'b'); // returns `'ab'`
469
325
  * checkWrap.endsWith('ab', 'a'); // returns `undefined`
470
- * checkWrap.endsWith(
471
- * [
472
- * 'a',
473
- * 'b',
474
- * ],
475
- * 'b',
476
- * ); // returns `['a', 'b']`
477
- * checkWrap.endsWith(
478
- * [
479
- * 'a',
480
- * 'b',
481
- * ],
482
- * 'a',
483
- * ); // returns `undefined`
326
+ * checkWrap.endsWith(['a', 'b'], 'b'); // returns `['a', 'b']`
327
+ * checkWrap.endsWith(['a', 'b'], 'a'); // returns `undefined`
484
328
  * ```
485
329
  *
486
330
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -503,20 +347,8 @@ export declare const boundaryGuards: {
503
347
  *
504
348
  * checkWrap.endsWithout('ab', 'b'); // returns `undefined`
505
349
  * checkWrap.endsWithout('ab', 'a'); // returns `'ab'`
506
- * checkWrap.endsWithout(
507
- * [
508
- * 'a',
509
- * 'b',
510
- * ],
511
- * 'b',
512
- * ); // returns `undefined`
513
- * checkWrap.endsWithout(
514
- * [
515
- * 'a',
516
- * 'b',
517
- * ],
518
- * 'a',
519
- * ); // returns `['a', 'b']`
350
+ * checkWrap.endsWithout(['a', 'b'], 'b'); // returns `undefined`
351
+ * checkWrap.endsWithout(['a', 'b'], 'a'); // returns `['a', 'b']`
520
352
  * ```
521
353
  *
522
354
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -539,20 +371,8 @@ export declare const boundaryGuards: {
539
371
  *
540
372
  * checkWrap.startsWith('ab', 'b'); // returns `undefined`
541
373
  * checkWrap.startsWith('ab', 'a'); // returns `'ab'`
542
- * checkWrap.startsWith(
543
- * [
544
- * 'a',
545
- * 'b',
546
- * ],
547
- * 'b',
548
- * ); // returns `undefined`
549
- * checkWrap.startsWith(
550
- * [
551
- * 'a',
552
- * 'b',
553
- * ],
554
- * 'a',
555
- * ); // returns `['a', 'b']`
374
+ * checkWrap.startsWith(['a', 'b'], 'b'); // returns `undefined`
375
+ * checkWrap.startsWith(['a', 'b'], 'a'); // returns `['a', 'b']`
556
376
  * ```
557
377
  *
558
378
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -575,20 +395,8 @@ export declare const boundaryGuards: {
575
395
  *
576
396
  * checkWrap.startsWith('ab', 'b'); // returns `undefined`
577
397
  * checkWrap.startsWith('ab', 'a'); // returns `'ab'`
578
- * checkWrap.startsWith(
579
- * [
580
- * 'a',
581
- * 'b',
582
- * ],
583
- * 'b',
584
- * ); // returns `undefined`
585
- * checkWrap.startsWith(
586
- * [
587
- * 'a',
588
- * 'b',
589
- * ],
590
- * 'a',
591
- * ); // returns `['a', 'b']`
398
+ * checkWrap.startsWith(['a', 'b'], 'b'); // returns `undefined`
399
+ * checkWrap.startsWith(['a', 'b'], 'a'); // returns `['a', 'b']`
592
400
  * ```
593
401
  *
594
402
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -613,14 +421,8 @@ export declare const boundaryGuards: {
613
421
  *
614
422
  * await waitUntil.endsWith('b', () => 'ab'); // returns `'ab'`
615
423
  * await waitUntil.endsWith('a', () => 'ab'); // throws an error
616
- * await waitUntil.endsWith('b', () => [
617
- * 'a',
618
- * 'b',
619
- * ]); // returns `['a', 'b']`
620
- * await waitUntil.endsWith('a', () => [
621
- * 'a',
622
- * 'b',
623
- * ]); // throws an error
424
+ * await waitUntil.endsWith('b', () => ['a', 'b']); // returns `['a', 'b']`
425
+ * await waitUntil.endsWith('a', () => ['a', 'b']); // throws an error
624
426
  * ```
625
427
  *
626
428
  * @returns The callback output once it passes.
@@ -644,14 +446,8 @@ export declare const boundaryGuards: {
644
446
  *
645
447
  * await waitUntil.endsWith('b', () => 'ab'); // throws an error
646
448
  * await waitUntil.endsWith('a', () => 'ab'); // returns `'ab'`
647
- * await waitUntil.endsWith('b', () => [
648
- * 'a',
649
- * 'b',
650
- * ]); // throws an error
651
- * await waitUntil.endsWith('a', () => [
652
- * 'a',
653
- * 'b',
654
- * ]); // returns `['a', 'b']`
449
+ * await waitUntil.endsWith('b', () => ['a', 'b']); // throws an error
450
+ * await waitUntil.endsWith('a', () => ['a', 'b']); // returns `['a', 'b']`
655
451
  * ```
656
452
  *
657
453
  * @returns The callback output once it passes.
@@ -675,14 +471,8 @@ export declare const boundaryGuards: {
675
471
  *
676
472
  * await waitUntil.endsWith('b', () => 'ab'); // throws an error
677
473
  * await waitUntil.endsWith('a', () => 'ab'); // returns `'ab'`
678
- * await waitUntil.endsWith('b', () => [
679
- * 'a',
680
- * 'b',
681
- * ]); // throws an error
682
- * await waitUntil.endsWith('a', () => [
683
- * 'a',
684
- * 'b',
685
- * ]); // returns `['a', 'b']`
474
+ * await waitUntil.endsWith('b', () => ['a', 'b']); // throws an error
475
+ * await waitUntil.endsWith('a', () => ['a', 'b']); // returns `['a', 'b']`
686
476
  * ```
687
477
  *
688
478
  * @returns The callback output once it passes.
@@ -705,14 +495,8 @@ export declare const boundaryGuards: {
705
495
  * ```ts
706
496
  * await waitUntil.endsWith('b', () => 'ab'); // returns `'ab'`
707
497
  * await waitUntil.endsWith('a', () => 'ab'); // throws an error
708
- * await waitUntil.endsWith('b', () => [
709
- * 'a',
710
- * 'b',
711
- * ]); // returns `['a', 'b']`
712
- * await waitUntil.endsWith('a', () => [
713
- * 'a',
714
- * 'b',
715
- * ]); // throws an error
498
+ * await waitUntil.endsWith('b', () => ['a', 'b']); // returns `['a', 'b']`
499
+ * await waitUntil.endsWith('a', () => ['a', 'b']); // throws an error
716
500
  * ```
717
501
  *
718
502
  * @returns The callback output once it passes.