@augment-vir/assert 30.0.0 → 30.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 (65) hide show
  1. package/README.md +11 -0
  2. package/dist/assertions/boolean.d.ts +443 -17
  3. package/dist/assertions/boolean.js +365 -8
  4. package/dist/assertions/boundary.d.ts +657 -13
  5. package/dist/assertions/boundary.js +537 -5
  6. package/dist/assertions/enum.d.ts +236 -8
  7. package/dist/assertions/enum.js +197 -5
  8. package/dist/assertions/equality/entry-equality.d.ts +287 -11
  9. package/dist/assertions/equality/entry-equality.js +243 -6
  10. package/dist/assertions/equality/json-equality.d.ts +244 -15
  11. package/dist/assertions/equality/json-equality.js +207 -11
  12. package/dist/assertions/equality/simple-equality.d.ts +849 -28
  13. package/dist/assertions/equality/simple-equality.js +712 -6
  14. package/dist/assertions/equality/ts-type-equality.d.ts +37 -1
  15. package/dist/assertions/equality/ts-type-equality.js +13 -1
  16. package/dist/assertions/extendable-assertions.d.ts +288 -120
  17. package/dist/assertions/extendable-assertions.js +32 -60
  18. package/dist/assertions/http.d.ts +217 -10
  19. package/dist/assertions/http.js +182 -6
  20. package/dist/assertions/instance.d.ts +189 -8
  21. package/dist/assertions/instance.js +159 -5
  22. package/dist/assertions/keys.d.ts +658 -13
  23. package/dist/assertions/keys.js +556 -5
  24. package/dist/assertions/length.d.ts +381 -9
  25. package/dist/assertions/length.js +309 -5
  26. package/dist/assertions/nullish.d.ts +169 -7
  27. package/dist/assertions/nullish.js +137 -6
  28. package/dist/assertions/numeric.d.ts +965 -11
  29. package/dist/assertions/numeric.js +819 -1
  30. package/dist/assertions/output.d.ts +107 -7
  31. package/dist/assertions/output.js +92 -5
  32. package/dist/assertions/primitive.d.ts +416 -13
  33. package/dist/assertions/primitive.js +352 -6
  34. package/dist/assertions/promise.d.ts +640 -21
  35. package/dist/assertions/promise.js +536 -15
  36. package/dist/assertions/regexp.d.ts +202 -3
  37. package/dist/assertions/regexp.js +173 -1
  38. package/dist/assertions/runtime-type.d.ts +1822 -41
  39. package/dist/assertions/runtime-type.js +1558 -35
  40. package/dist/assertions/throws.d.ts +265 -17
  41. package/dist/assertions/throws.js +229 -17
  42. package/dist/assertions/uuid.d.ts +233 -10
  43. package/dist/assertions/uuid.js +195 -6
  44. package/dist/assertions/values.d.ts +1086 -15
  45. package/dist/assertions/values.js +907 -6
  46. package/dist/augments/assertion.error.d.ts +2 -1
  47. package/dist/augments/assertion.error.js +2 -1
  48. package/dist/augments/guards/assert-wrap.d.ts +82 -37
  49. package/dist/augments/guards/assert-wrap.js +13 -2
  50. package/dist/augments/guards/assert.d.ts +30 -14
  51. package/dist/augments/guards/assert.js +21 -4
  52. package/dist/augments/guards/check-wrap.d.ts +94 -51
  53. package/dist/augments/guards/check-wrap.js +11 -3
  54. package/dist/augments/guards/check.d.ts +87 -37
  55. package/dist/augments/guards/check.js +9 -2
  56. package/dist/augments/guards/wait-until.d.ts +110 -103
  57. package/dist/augments/guards/wait-until.js +18 -3
  58. package/dist/augments/if-equals.d.ts +4 -2
  59. package/dist/guard-types/assert-wrap-function.d.ts +5 -2
  60. package/dist/guard-types/check-function.d.ts +5 -2
  61. package/dist/guard-types/check-wrap-wrapper-function.d.ts +4 -1
  62. package/dist/guard-types/guard-group.d.ts +7 -8
  63. package/dist/guard-types/wait-until-function.d.ts +8 -3
  64. package/dist/guard-types/wait-until-function.js +1 -1
  65. package/package.json +17 -4
@@ -25,58 +25,702 @@ declare function startsWithout<const ArrayElement>(parent: ReadonlyArray<ArrayEl
25
25
  declare function startsWithout(parent: string, child: string, failureMessage?: string | undefined): void;
26
26
  declare function startsWithout(parent: string | ReadonlyArray<string>, child: string, failureMessage?: string | undefined): void;
27
27
  export declare const boundaryGuards: {
28
- assertions: {
28
+ assert: {
29
29
  /**
30
- * Check if a string or array parent value ends with a specific child value. This uses
31
- * referential equality when the parent value is an array.
30
+ * Asserts that a parent string or array ends with a specific child. This uses reference
31
+ * equality when the parent is an array.
32
32
  *
33
33
  * Performs no type guarding.
34
+ *
35
+ * @example
36
+ *
37
+ * ```ts
38
+ * import {assert} from '@augment-vir/assert';
39
+ *
40
+ * assert.endsWith('ab', 'b'); // passes
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
56
+ * ```
57
+ *
58
+ * @throws {@link AssertionError} If the parent does not end with the child.
59
+ * @see
60
+ * - {@link assert.endsWithout} : the opposite assertion.
61
+ * - {@link assert.startsWith} : assertion on the other end.
34
62
  */
35
63
  endsWith: typeof endsWith;
36
64
  /**
37
- * Check if a string or array parent value does _not_ end with a specific child value. This uses
38
- * referential equality when the parent value is an array.
65
+ * Asserts that a parent string or array does _not_ end with a specific child. This uses
66
+ * reference equality when the parent is an array.
39
67
  *
40
68
  * Performs no type guarding.
69
+ *
70
+ * @example
71
+ *
72
+ * ```ts
73
+ * import {assert} from '@augment-vir/assert';
74
+ *
75
+ * assert.endsWithout('ab', 'b'); // fails
76
+ * 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
91
+ * ```
92
+ *
93
+ * @throws {@link AssertionError} If the parent ends with the child.
94
+ * @see
95
+ * - {@link assert.endsWith} : the opposite assertion.
96
+ * - {@link assert.startsWithout} : assertion on the other end.
41
97
  */
42
98
  endsWithout: typeof endsWithout;
43
99
  /**
44
- * Check if a string or array parent value starts with a specific child value. This uses
45
- * referential equality when the parent value is an array.
100
+ * Asserts that a parent string or array starts with a specific child. This uses reference
101
+ * equality when the parent is an array.
46
102
  *
47
103
  * Performs no type guarding.
104
+ *
105
+ * @example
106
+ *
107
+ * ```ts
108
+ * import {assert} from '@augment-vir/assert';
109
+ *
110
+ * assert.startsWith('ab', 'b'); // fails
111
+ * 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
126
+ * ```
127
+ *
128
+ * @throws {@link AssertionError} If the parent does not start with the child.
129
+ * @see
130
+ * - {@link assert.startsWithout} : the opposite assertion.
131
+ * - {@link assert.endsWith} : assertion on the other end.
48
132
  */
49
133
  startsWith: typeof startsWith;
50
134
  /**
51
- * Check if a string or array parent value does _not_ start with a specific child value. This
52
- * uses referential equality when the parent value is an array.
135
+ * Asserts that a parent string or array starts with a specific child. This uses reference
136
+ * equality when the parent is an array.
53
137
  *
54
138
  * Performs no type guarding.
139
+ *
140
+ * @example
141
+ *
142
+ * ```ts
143
+ * import {assert} from '@augment-vir/assert';
144
+ *
145
+ * assert.startsWith('ab', 'b'); // passes
146
+ * 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
161
+ * ```
162
+ *
163
+ * @throws {@link AssertionError} If the parent does start with the child.
164
+ * @see
165
+ * - {@link assert.startsWithout} : the opposite assertion.
166
+ * - {@link assert.endsWith} : assertion on the other end.
55
167
  */
56
168
  startsWithout: typeof startsWithout;
57
169
  };
58
- checkOverrides: {
170
+ check: {
171
+ /**
172
+ * Checks that a parent string or array ends with a specific child. This uses reference
173
+ * equality when the parent is an array.
174
+ *
175
+ * Performs no type guarding.
176
+ *
177
+ * @example
178
+ *
179
+ * ```ts
180
+ * import {check} from '@augment-vir/assert';
181
+ *
182
+ * check.endsWith('ab', 'b'); // returns `true`
183
+ * 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`
198
+ * ```
199
+ *
200
+ * @see
201
+ * - {@link check.endsWithout} : the opposite check.
202
+ * - {@link check.startsWith} : check on the other end.
203
+ */
59
204
  endsWith: typeof boundaryCheck;
205
+ /**
206
+ * Checks that a parent string or array does _not_ end with a specific child. This uses
207
+ * reference equality when the parent is an array.
208
+ *
209
+ * Performs no type guarding.
210
+ *
211
+ * @example
212
+ *
213
+ * ```ts
214
+ * import {check} from '@augment-vir/assert';
215
+ *
216
+ * check.endsWithout('ab', 'b'); // returns `false`
217
+ * 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`
232
+ * ```
233
+ *
234
+ * @see
235
+ * - {@link check.endsWith} : the opposite check.
236
+ * - {@link check.startsWithout} : check on the other end.
237
+ */
60
238
  endsWithout: typeof boundaryCheck;
239
+ /**
240
+ * Checks that a parent string or array starts with a specific child. This uses reference
241
+ * equality when the parent is an array.
242
+ *
243
+ * Performs no type guarding.
244
+ *
245
+ * @example
246
+ *
247
+ * ```ts
248
+ * import {check} from '@augment-vir/assert';
249
+ *
250
+ * check.startsWith('ab', 'b'); // returns `false`
251
+ * 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`
266
+ * ```
267
+ *
268
+ * @see
269
+ * - {@link check.startsWithout} : the opposite check.
270
+ * - {@link check.endsWith} : check on the other end.
271
+ */
61
272
  startsWith: typeof boundaryCheck;
273
+ /**
274
+ * Checks that a parent string or array starts with a specific child. This uses reference
275
+ * equality when the parent is an array.
276
+ *
277
+ * Performs no type guarding.
278
+ *
279
+ * @example
280
+ *
281
+ * ```ts
282
+ * import {check} from '@augment-vir/assert';
283
+ *
284
+ * check.startsWith('ab', 'b'); // returns `false`
285
+ * 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`
300
+ * ```
301
+ *
302
+ * @see
303
+ * - {@link check.startsWithout} : the opposite check.
304
+ * - {@link check.endsWith} : check on the other end.
305
+ */
62
306
  startsWithout: typeof boundaryCheck;
63
307
  };
64
- assertWrapOverrides: {
308
+ assertWrap: {
309
+ /**
310
+ * Asserts that a parent string or array ends with a specific child. This uses reference
311
+ * equality when the parent is an array. Returns the parent if the assertion passes.
312
+ *
313
+ * Performs no type guarding.
314
+ *
315
+ * @example
316
+ *
317
+ * ```ts
318
+ * import {assertWrap} from '@augment-vir/assert';
319
+ *
320
+ * assertWrap.endsWith('ab', 'b'); // returns `'ab'`
321
+ * 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
336
+ * ```
337
+ *
338
+ * @returns The parent value if it does end with the child.
339
+ * @throws {@link AssertionError} If the parent does not end with the child.
340
+ * @see
341
+ * - {@link assertWrap.endsWithout} : the opposite assertion.
342
+ * - {@link assertWrap.startsWith} : assertion on the other end.
343
+ */
65
344
  endsWith: typeof boundaryAssertWrap;
345
+ /**
346
+ * Asserts that a parent string or array does _not_ end with a specific child. This uses
347
+ * reference equality when the parent is an array. Returns the parent if the assertion
348
+ * passes.
349
+ *
350
+ * Performs no type guarding.
351
+ *
352
+ * @example
353
+ *
354
+ * ```ts
355
+ * import {assertWrap} from '@augment-vir/assert';
356
+ *
357
+ * assertWrap.endsWithout('ab', 'b'); // throws an error
358
+ * 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']`
373
+ * ```
374
+ *
375
+ * @returns The parent value if it does not end with the child.
376
+ * @throws {@link AssertionError} If the parent ends with the child.
377
+ * @see
378
+ * - {@link assertWrap.endsWith} : the opposite assertion.
379
+ * - {@link assertWrap.startsWithout} : assertion on the other end.
380
+ */
66
381
  endsWithout: typeof boundaryAssertWrap;
382
+ /**
383
+ * Checks that a parent string or array starts with a specific child. This uses reference
384
+ * equality when the parent is an array. Returns the parent if the assertion passes.
385
+ *
386
+ * Performs no type guarding.
387
+ *
388
+ * @example
389
+ *
390
+ * ```ts
391
+ * import {assertWrap} from '@augment-vir/assert';
392
+ *
393
+ * assertWrap.startsWith('ab', 'b'); // throws an error
394
+ * 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']`
409
+ * ```
410
+ *
411
+ * @returns The parent value if it starts with the child.
412
+ * @throws {@link AssertionError} If the parent does not start with the child.
413
+ * @see
414
+ * - {@link assertWrap.startsWithout} : the opposite assertion.
415
+ * - {@link assertWrap.endsWith} : assertion on the other end.
416
+ */
67
417
  startsWith: typeof boundaryAssertWrap;
418
+ /**
419
+ * Asserts that a parent string or array starts with a specific child. This uses reference
420
+ * equality when the parent is an array. Returns the parent if the assertion passes.
421
+ *
422
+ * Performs no type guarding.
423
+ *
424
+ * @example
425
+ *
426
+ * ```ts
427
+ * import {assertWrap} from '@augment-vir/assert';
428
+ *
429
+ * assertWrap.startsWith('ab', 'b'); // returns `'ab'`
430
+ * 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
445
+ * ```
446
+ *
447
+ * @returns The parent value if it does not start with the child.
448
+ * @throws {@link AssertionError} If the parent does start with the child.
449
+ * @see
450
+ * - {@link assertWrap.startsWithout} : the opposite assertion.
451
+ * - {@link assertWrap.endsWith} : assertion on the other end.
452
+ */
68
453
  startsWithout: typeof boundaryAssertWrap;
69
454
  };
70
- checkWrapOverrides: {
455
+ checkWrap: {
456
+ /**
457
+ * Checks that a parent string or array ends with a specific child. This uses reference
458
+ * equality when the parent is an array. Returns the value if the check passes, otherwise
459
+ * `undefined`.
460
+ *
461
+ * Performs no type guarding.
462
+ *
463
+ * @example
464
+ *
465
+ * ```ts
466
+ * import {checkWrap} from '@augment-vir/assert';
467
+ *
468
+ * checkWrap.endsWith('ab', 'b'); // returns `'ab'`
469
+ * 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`
484
+ * ```
485
+ *
486
+ * @returns The first value if the check passes, otherwise `undefined`.
487
+ * @see
488
+ * - {@link checkWrap.endsWithout} : the opposite check.
489
+ * - {@link checkWrap.startsWith} : check on the other end.
490
+ */
71
491
  endsWith: typeof boundaryCheckWrap;
492
+ /**
493
+ * Checks that a parent string or array does _not_ end with a specific child. This uses
494
+ * reference equality when the parent is an array. Returns the value if the check passes,
495
+ * otherwise `undefined`.
496
+ *
497
+ * Performs no type guarding.
498
+ *
499
+ * @example
500
+ *
501
+ * ```ts
502
+ * import {checkWrap} from '@augment-vir/assert';
503
+ *
504
+ * checkWrap.endsWithout('ab', 'b'); // returns `undefined`
505
+ * 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']`
520
+ * ```
521
+ *
522
+ * @returns The first value if the check passes, otherwise `undefined`.
523
+ * @see
524
+ * - {@link checkWrap.endsWith} : the opposite check.
525
+ * - {@link checkWrap.startsWithout} : check on the other end.
526
+ */
72
527
  endsWithout: typeof boundaryCheckWrap;
528
+ /**
529
+ * Checks that a parent string or array starts with a specific child. This uses reference
530
+ * equality when the parent is an array. Returns the value if the check passes, otherwise
531
+ * `undefined`.
532
+ *
533
+ * Performs no type guarding.
534
+ *
535
+ * @example
536
+ *
537
+ * ```ts
538
+ * import {checkWrap} from '@augment-vir/assert';
539
+ *
540
+ * checkWrap.startsWith('ab', 'b'); // returns `undefined`
541
+ * 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']`
556
+ * ```
557
+ *
558
+ * @returns The first value if the check passes, otherwise `undefined`.
559
+ * @see
560
+ * - {@link checkWrap.startsWithout} : the opposite check.
561
+ * - {@link checkWrap.endsWith} : check on the other end.
562
+ */
73
563
  startsWith: typeof boundaryCheckWrap;
564
+ /**
565
+ * Checks that a parent string or array starts with a specific child. This uses reference
566
+ * equality when the parent is an array. Returns the value if the check passes, otherwise
567
+ * `undefined`.
568
+ *
569
+ * Performs no type guarding.
570
+ *
571
+ * @example
572
+ *
573
+ * ```ts
574
+ * import {checkWrap} from '@augment-vir/assert';
575
+ *
576
+ * checkWrap.startsWith('ab', 'b'); // returns `undefined`
577
+ * 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']`
592
+ * ```
593
+ *
594
+ * @returns The first value if the check passes, otherwise `undefined`.
595
+ * @see
596
+ * - {@link checkWrap.startsWithout} : the opposite check.
597
+ * - {@link checkWrap.endsWith} : check on the other end.
598
+ */
74
599
  startsWithout: typeof boundaryCheckWrap;
75
600
  };
76
- waitUntilOverrides: {
601
+ waitUntil: {
602
+ /**
603
+ * Repeatedly calls a callback until its output string or array ends with the first input
604
+ * child value. This uses reference equality when the parent is an array. Once the callback
605
+ * output passes, it is returned. If the attempts time out, an error is thrown.
606
+ *
607
+ * Performs no type guarding.
608
+ *
609
+ * @example
610
+ *
611
+ * ```ts
612
+ * import {waitUntil} from '@augment-vir/assert';
613
+ *
614
+ * await waitUntil.endsWith('b', () => 'ab'); // returns `'ab'`
615
+ * 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
624
+ * ```
625
+ *
626
+ * @returns The callback output once it passes.
627
+ * @throws {@link AssertionError} On timeout.
628
+ * @see
629
+ * - {@link waitUntil.endsWithout} : the opposite assertion.
630
+ * - {@link waitUntil.startsWith} : assertion on the other end.
631
+ */
77
632
  endsWith: typeof boundaryWaitUntil;
633
+ /**
634
+ * Repeatedly calls a callback until its output string or array does not end with the first
635
+ * input child value. This uses reference equality when the parent is an array. Once the
636
+ * callback output passes, it is returned. If the attempts time out, an error is thrown.
637
+ *
638
+ * Performs no type guarding.
639
+ *
640
+ * @example
641
+ *
642
+ * ```ts
643
+ * import {waitUntil} from '@augment-vir/assert';
644
+ *
645
+ * await waitUntil.endsWith('b', () => 'ab'); // throws an error
646
+ * 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']`
655
+ * ```
656
+ *
657
+ * @returns The callback output once it passes.
658
+ * @throws {@link AssertionError} On timeout.
659
+ * @see
660
+ * - {@link waitUntil.endsWith} : the opposite assertion.
661
+ * - {@link waitUntil.startsWithout} : assertion on the other end.
662
+ */
78
663
  endsWithout: typeof boundaryWaitUntil;
664
+ /**
665
+ * Repeatedly calls a callback until its output string or array starts with the first input
666
+ * child value. This uses reference equality when the parent is an array. Once the callback
667
+ * output passes, it is returned. If the attempts time out, an error is thrown.
668
+ *
669
+ * Performs no type guarding.
670
+ *
671
+ * @example
672
+ *
673
+ * ```ts
674
+ * import {waitUntil} from '@augment-vir/assert';
675
+ *
676
+ * await waitUntil.endsWith('b', () => 'ab'); // throws an error
677
+ * 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']`
686
+ * ```
687
+ *
688
+ * @returns The callback output once it passes.
689
+ * @throws {@link AssertionError} On timeout.
690
+ * @see
691
+ * - {@link waitUntil.startsWithout} : the opposite assertion.
692
+ * - {@link waitUntil.endsWith} : assertion on the other end.
693
+ */
79
694
  startsWith: typeof boundaryWaitUntil;
695
+ /**
696
+ * Repeatedly calls a callback until its output string or array does not start with the
697
+ * first input child value. This uses reference equality when the parent is an array. Once
698
+ * the callback output passes, it is returned. If the attempts time out, an error is
699
+ * thrown.
700
+ *
701
+ * Performs no type guarding.
702
+ *
703
+ * @example
704
+ *
705
+ * ```ts
706
+ * await waitUntil.endsWith('b', () => 'ab'); // returns `'ab'`
707
+ * 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
716
+ * ```
717
+ *
718
+ * @returns The callback output once it passes.
719
+ * @throws {@link AssertionError} On timeout.
720
+ * @see
721
+ * - {@link waitUntil.startsWith} : the opposite assertion.
722
+ * - {@link waitUntil.endsWithout} : assertion on the other end.
723
+ */
80
724
  startsWithout: typeof boundaryWaitUntil;
81
725
  };
82
726
  };