@augment-vir/assert 31.9.1 → 31.9.3

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.
@@ -79,8 +79,20 @@ const assertions = {
79
79
  *
80
80
  * assert.endsWith('ab', 'b'); // passes
81
81
  * assert.endsWith('ab', 'a'); // fails
82
- * assert.endsWith(['a', 'b'], 'b'); // passes
83
- * assert.endsWith(['a', 'b'], 'a'); // fails
82
+ * assert.endsWith(
83
+ * [
84
+ * 'a',
85
+ * 'b',
86
+ * ],
87
+ * 'b',
88
+ * ); // passes
89
+ * assert.endsWith(
90
+ * [
91
+ * 'a',
92
+ * 'b',
93
+ * ],
94
+ * 'a',
95
+ * ); // fails
84
96
  * ```
85
97
  *
86
98
  * @throws {@link AssertionError} If the parent does not end with the child.
@@ -102,8 +114,20 @@ const assertions = {
102
114
  *
103
115
  * assert.endsWithout('ab', 'b'); // fails
104
116
  * assert.endsWithout('ab', 'a'); // passes
105
- * assert.endsWithout(['a', 'b'], 'b'); // fails
106
- * assert.endsWithout(['a', 'b'], 'a'); // passes
117
+ * assert.endsWithout(
118
+ * [
119
+ * 'a',
120
+ * 'b',
121
+ * ],
122
+ * 'b',
123
+ * ); // fails
124
+ * assert.endsWithout(
125
+ * [
126
+ * 'a',
127
+ * 'b',
128
+ * ],
129
+ * 'a',
130
+ * ); // passes
107
131
  * ```
108
132
  *
109
133
  * @throws {@link AssertionError} If the parent ends with the child.
@@ -125,8 +149,20 @@ const assertions = {
125
149
  *
126
150
  * assert.startsWith('ab', 'b'); // fails
127
151
  * assert.startsWith('ab', 'a'); // passes
128
- * assert.startsWith(['a', 'b'], 'b'); // fails
129
- * assert.startsWith(['a', 'b'], 'a'); // passes
152
+ * assert.startsWith(
153
+ * [
154
+ * 'a',
155
+ * 'b',
156
+ * ],
157
+ * 'b',
158
+ * ); // fails
159
+ * assert.startsWith(
160
+ * [
161
+ * 'a',
162
+ * 'b',
163
+ * ],
164
+ * 'a',
165
+ * ); // passes
130
166
  * ```
131
167
  *
132
168
  * @throws {@link AssertionError} If the parent does not start with the child.
@@ -148,8 +184,20 @@ const assertions = {
148
184
  *
149
185
  * assert.startsWith('ab', 'b'); // passes
150
186
  * assert.startsWith('ab', 'a'); // fails
151
- * assert.startsWith(['a', 'b'], 'b'); // passes
152
- * assert.startsWith(['a', 'b'], 'a'); // fails
187
+ * assert.startsWith(
188
+ * [
189
+ * 'a',
190
+ * 'b',
191
+ * ],
192
+ * 'b',
193
+ * ); // passes
194
+ * assert.startsWith(
195
+ * [
196
+ * 'a',
197
+ * 'b',
198
+ * ],
199
+ * 'a',
200
+ * ); // fails
153
201
  * ```
154
202
  *
155
203
  * @throws {@link AssertionError} If the parent does start with the child.
@@ -175,8 +223,20 @@ export const boundaryGuards = {
175
223
  *
176
224
  * check.endsWith('ab', 'b'); // returns `true`
177
225
  * check.endsWith('ab', 'a'); // returns `false`
178
- * check.endsWith(['a', 'b'], 'b'); // returns `true`
179
- * check.endsWith(['a', 'b'], 'a'); // returns `false`
226
+ * check.endsWith(
227
+ * [
228
+ * 'a',
229
+ * 'b',
230
+ * ],
231
+ * 'b',
232
+ * ); // returns `true`
233
+ * check.endsWith(
234
+ * [
235
+ * 'a',
236
+ * 'b',
237
+ * ],
238
+ * 'a',
239
+ * ); // returns `false`
180
240
  * ```
181
241
  *
182
242
  * @see
@@ -202,8 +262,20 @@ export const boundaryGuards = {
202
262
  *
203
263
  * check.endsWithout('ab', 'b'); // returns `false`
204
264
  * check.endsWithout('ab', 'a'); // returns `true`
205
- * check.endsWithout(['a', 'b'], 'b'); // returns `false`
206
- * check.endsWithout(['a', 'b'], 'a'); // returns `true`
265
+ * check.endsWithout(
266
+ * [
267
+ * 'a',
268
+ * 'b',
269
+ * ],
270
+ * 'b',
271
+ * ); // returns `false`
272
+ * check.endsWithout(
273
+ * [
274
+ * 'a',
275
+ * 'b',
276
+ * ],
277
+ * 'a',
278
+ * ); // returns `true`
207
279
  * ```
208
280
  *
209
281
  * @see
@@ -229,8 +301,20 @@ export const boundaryGuards = {
229
301
  *
230
302
  * check.startsWith('ab', 'b'); // returns `false`
231
303
  * check.startsWith('ab', 'a'); // returns `true`
232
- * check.startsWith(['a', 'b'], 'b'); // returns `false`
233
- * check.startsWith(['a', 'b'], 'a'); // returns `true`
304
+ * check.startsWith(
305
+ * [
306
+ * 'a',
307
+ * 'b',
308
+ * ],
309
+ * 'b',
310
+ * ); // returns `false`
311
+ * check.startsWith(
312
+ * [
313
+ * 'a',
314
+ * 'b',
315
+ * ],
316
+ * 'a',
317
+ * ); // returns `true`
234
318
  * ```
235
319
  *
236
320
  * @see
@@ -256,8 +340,20 @@ export const boundaryGuards = {
256
340
  *
257
341
  * check.startsWith('ab', 'b'); // returns `false`
258
342
  * check.startsWith('ab', 'a'); // returns `true`
259
- * check.startsWith(['a', 'b'], 'b'); // returns `false`
260
- * check.startsWith(['a', 'b'], 'a'); // returns `true`
343
+ * check.startsWith(
344
+ * [
345
+ * 'a',
346
+ * 'b',
347
+ * ],
348
+ * 'b',
349
+ * ); // returns `false`
350
+ * check.startsWith(
351
+ * [
352
+ * 'a',
353
+ * 'b',
354
+ * ],
355
+ * 'a',
356
+ * ); // returns `true`
261
357
  * ```
262
358
  *
263
359
  * @see
@@ -285,8 +381,20 @@ export const boundaryGuards = {
285
381
  *
286
382
  * assertWrap.endsWith('ab', 'b'); // returns `'ab'`
287
383
  * assertWrap.endsWith('ab', 'a'); // throws an error
288
- * assertWrap.endsWith(['a', 'b'], 'b'); // returns `['a', 'b']`
289
- * assertWrap.endsWith(['a', 'b'], 'a'); // throws an error
384
+ * assertWrap.endsWith(
385
+ * [
386
+ * 'a',
387
+ * 'b',
388
+ * ],
389
+ * 'b',
390
+ * ); // returns `['a', 'b']`
391
+ * assertWrap.endsWith(
392
+ * [
393
+ * 'a',
394
+ * 'b',
395
+ * ],
396
+ * 'a',
397
+ * ); // throws an error
290
398
  * ```
291
399
  *
292
400
  * @returns The parent value if it does end with the child.
@@ -320,8 +428,20 @@ export const boundaryGuards = {
320
428
  *
321
429
  * assertWrap.endsWithout('ab', 'b'); // throws an error
322
430
  * assertWrap.endsWithout('ab', 'a'); // returns `'ab'`
323
- * assertWrap.endsWithout(['a', 'b'], 'b'); // throws an error
324
- * assertWrap.endsWithout(['a', 'b'], 'a'); // returns `['a', 'b']`
431
+ * assertWrap.endsWithout(
432
+ * [
433
+ * 'a',
434
+ * 'b',
435
+ * ],
436
+ * 'b',
437
+ * ); // throws an error
438
+ * assertWrap.endsWithout(
439
+ * [
440
+ * 'a',
441
+ * 'b',
442
+ * ],
443
+ * 'a',
444
+ * ); // returns `['a', 'b']`
325
445
  * ```
326
446
  *
327
447
  * @returns The parent value if it does not end with the child.
@@ -354,8 +474,20 @@ export const boundaryGuards = {
354
474
  *
355
475
  * assertWrap.startsWith('ab', 'b'); // throws an error
356
476
  * assertWrap.startsWith('ab', 'a'); // returns `'ab'`
357
- * assertWrap.startsWith(['a', 'b'], 'b'); // throws an error
358
- * assertWrap.startsWith(['a', 'b'], 'a'); // returns `['a', 'b']`
477
+ * assertWrap.startsWith(
478
+ * [
479
+ * 'a',
480
+ * 'b',
481
+ * ],
482
+ * 'b',
483
+ * ); // throws an error
484
+ * assertWrap.startsWith(
485
+ * [
486
+ * 'a',
487
+ * 'b',
488
+ * ],
489
+ * 'a',
490
+ * ); // returns `['a', 'b']`
359
491
  * ```
360
492
  *
361
493
  * @returns The parent value if it starts with the child.
@@ -388,8 +520,20 @@ export const boundaryGuards = {
388
520
  *
389
521
  * assertWrap.startsWith('ab', 'b'); // returns `'ab'`
390
522
  * assertWrap.startsWith('ab', 'a'); // throws an error
391
- * assertWrap.startsWith(['a', 'b'], 'b'); // returns `['a', 'b']`
392
- * assertWrap.startsWith(['a', 'b'], 'a'); // throws an error
523
+ * assertWrap.startsWith(
524
+ * [
525
+ * 'a',
526
+ * 'b',
527
+ * ],
528
+ * 'b',
529
+ * ); // returns `['a', 'b']`
530
+ * assertWrap.startsWith(
531
+ * [
532
+ * 'a',
533
+ * 'b',
534
+ * ],
535
+ * 'a',
536
+ * ); // throws an error
393
537
  * ```
394
538
  *
395
539
  * @returns The parent value if it does not start with the child.
@@ -425,8 +569,20 @@ export const boundaryGuards = {
425
569
  *
426
570
  * checkWrap.endsWith('ab', 'b'); // returns `'ab'`
427
571
  * checkWrap.endsWith('ab', 'a'); // returns `undefined`
428
- * checkWrap.endsWith(['a', 'b'], 'b'); // returns `['a', 'b']`
429
- * checkWrap.endsWith(['a', 'b'], 'a'); // returns `undefined`
572
+ * checkWrap.endsWith(
573
+ * [
574
+ * 'a',
575
+ * 'b',
576
+ * ],
577
+ * 'b',
578
+ * ); // returns `['a', 'b']`
579
+ * checkWrap.endsWith(
580
+ * [
581
+ * 'a',
582
+ * 'b',
583
+ * ],
584
+ * 'a',
585
+ * ); // returns `undefined`
430
586
  * ```
431
587
  *
432
588
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -464,8 +620,20 @@ export const boundaryGuards = {
464
620
  *
465
621
  * checkWrap.endsWithout('ab', 'b'); // returns `undefined`
466
622
  * checkWrap.endsWithout('ab', 'a'); // returns `'ab'`
467
- * checkWrap.endsWithout(['a', 'b'], 'b'); // returns `undefined`
468
- * checkWrap.endsWithout(['a', 'b'], 'a'); // returns `['a', 'b']`
623
+ * checkWrap.endsWithout(
624
+ * [
625
+ * 'a',
626
+ * 'b',
627
+ * ],
628
+ * 'b',
629
+ * ); // returns `undefined`
630
+ * checkWrap.endsWithout(
631
+ * [
632
+ * 'a',
633
+ * 'b',
634
+ * ],
635
+ * 'a',
636
+ * ); // returns `['a', 'b']`
469
637
  * ```
470
638
  *
471
639
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -503,8 +671,20 @@ export const boundaryGuards = {
503
671
  *
504
672
  * checkWrap.startsWith('ab', 'b'); // returns `undefined`
505
673
  * checkWrap.startsWith('ab', 'a'); // returns `'ab'`
506
- * checkWrap.startsWith(['a', 'b'], 'b'); // returns `undefined`
507
- * checkWrap.startsWith(['a', 'b'], 'a'); // returns `['a', 'b']`
674
+ * checkWrap.startsWith(
675
+ * [
676
+ * 'a',
677
+ * 'b',
678
+ * ],
679
+ * 'b',
680
+ * ); // returns `undefined`
681
+ * checkWrap.startsWith(
682
+ * [
683
+ * 'a',
684
+ * 'b',
685
+ * ],
686
+ * 'a',
687
+ * ); // returns `['a', 'b']`
508
688
  * ```
509
689
  *
510
690
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -542,8 +722,20 @@ export const boundaryGuards = {
542
722
  *
543
723
  * checkWrap.startsWith('ab', 'b'); // returns `undefined`
544
724
  * checkWrap.startsWith('ab', 'a'); // returns `'ab'`
545
- * checkWrap.startsWith(['a', 'b'], 'b'); // returns `undefined`
546
- * checkWrap.startsWith(['a', 'b'], 'a'); // returns `['a', 'b']`
725
+ * checkWrap.startsWith(
726
+ * [
727
+ * 'a',
728
+ * 'b',
729
+ * ],
730
+ * 'b',
731
+ * ); // returns `undefined`
732
+ * checkWrap.startsWith(
733
+ * [
734
+ * 'a',
735
+ * 'b',
736
+ * ],
737
+ * 'a',
738
+ * ); // returns `['a', 'b']`
547
739
  * ```
548
740
  *
549
741
  * @returns The first value if the check passes, otherwise `undefined`.
@@ -583,8 +775,14 @@ export const boundaryGuards = {
583
775
  *
584
776
  * await waitUntil.endsWith('b', () => 'ab'); // returns `'ab'`
585
777
  * await waitUntil.endsWith('a', () => 'ab'); // throws an error
586
- * await waitUntil.endsWith('b', () => ['a', 'b']); // returns `['a', 'b']`
587
- * await waitUntil.endsWith('a', () => ['a', 'b']); // throws an error
778
+ * await waitUntil.endsWith('b', () => [
779
+ * 'a',
780
+ * 'b',
781
+ * ]); // returns `['a', 'b']`
782
+ * await waitUntil.endsWith('a', () => [
783
+ * 'a',
784
+ * 'b',
785
+ * ]); // throws an error
588
786
  * ```
589
787
  *
590
788
  * @returns The callback output once it passes.
@@ -608,8 +806,14 @@ export const boundaryGuards = {
608
806
  *
609
807
  * await waitUntil.endsWith('b', () => 'ab'); // throws an error
610
808
  * await waitUntil.endsWith('a', () => 'ab'); // returns `'ab'`
611
- * await waitUntil.endsWith('b', () => ['a', 'b']); // throws an error
612
- * await waitUntil.endsWith('a', () => ['a', 'b']); // returns `['a', 'b']`
809
+ * await waitUntil.endsWith('b', () => [
810
+ * 'a',
811
+ * 'b',
812
+ * ]); // throws an error
813
+ * await waitUntil.endsWith('a', () => [
814
+ * 'a',
815
+ * 'b',
816
+ * ]); // returns `['a', 'b']`
613
817
  * ```
614
818
  *
615
819
  * @returns The callback output once it passes.
@@ -633,8 +837,14 @@ export const boundaryGuards = {
633
837
  *
634
838
  * await waitUntil.endsWith('b', () => 'ab'); // throws an error
635
839
  * await waitUntil.endsWith('a', () => 'ab'); // returns `'ab'`
636
- * await waitUntil.endsWith('b', () => ['a', 'b']); // throws an error
637
- * await waitUntil.endsWith('a', () => ['a', 'b']); // returns `['a', 'b']`
840
+ * await waitUntil.endsWith('b', () => [
841
+ * 'a',
842
+ * 'b',
843
+ * ]); // throws an error
844
+ * await waitUntil.endsWith('a', () => [
845
+ * 'a',
846
+ * 'b',
847
+ * ]); // returns `['a', 'b']`
638
848
  * ```
639
849
  *
640
850
  * @returns The callback output once it passes.
@@ -657,8 +867,14 @@ export const boundaryGuards = {
657
867
  * ```ts
658
868
  * await waitUntil.endsWith('b', () => 'ab'); // returns `'ab'`
659
869
  * await waitUntil.endsWith('a', () => 'ab'); // throws an error
660
- * await waitUntil.endsWith('b', () => ['a', 'b']); // returns `['a', 'b']`
661
- * await waitUntil.endsWith('a', () => ['a', 'b']); // throws an error
870
+ * await waitUntil.endsWith('b', () => [
871
+ * 'a',
872
+ * 'b',
873
+ * ]); // returns `['a', 'b']`
874
+ * await waitUntil.endsWith('a', () => [
875
+ * 'a',
876
+ * 'b',
877
+ * ]); // throws an error
662
878
  * ```
663
879
  *
664
880
  * @returns The callback output once it passes.
@@ -38,7 +38,10 @@ const assertions = {
38
38
  else if (!expected || typeof expected !== 'object') {
39
39
  throw new AssertionError(`${stringify(expected)} is not an object.`, failureMessage);
40
40
  }
41
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
41
+ const allKeys = Array.from(new Set([
42
+ ...Reflect.ownKeys(actual),
43
+ ...Reflect.ownKeys(expected),
44
+ ]));
42
45
  allKeys.forEach((key) => {
43
46
  const actualValue = actual[key];
44
47
  const expectedValue = expected[key];
@@ -79,7 +82,10 @@ const assertions = {
79
82
  if (!actual || typeof actual !== 'object' || !expected || typeof expected !== 'object') {
80
83
  return;
81
84
  }
82
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
85
+ const allKeys = Array.from(new Set([
86
+ ...Reflect.ownKeys(actual),
87
+ ...Reflect.ownKeys(expected),
88
+ ]));
83
89
  const valid = allKeys.some((key) => {
84
90
  const actualValue = actual[key];
85
91
  const expectedValue = expected[key];
@@ -129,7 +135,10 @@ export const entryEqualityGuards = {
129
135
  typeof expected !== 'object') {
130
136
  return false;
131
137
  }
132
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
138
+ const allKeys = Array.from(new Set([
139
+ ...Reflect.ownKeys(actual),
140
+ ...Reflect.ownKeys(expected),
141
+ ]));
133
142
  return allKeys.every((key) => {
134
143
  const actualValue = actual[key];
135
144
  const expectedValue = expected[key];
@@ -172,7 +181,10 @@ export const entryEqualityGuards = {
172
181
  typeof expected !== 'object') {
173
182
  return true;
174
183
  }
175
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
184
+ const allKeys = Array.from(new Set([
185
+ ...Reflect.ownKeys(actual),
186
+ ...Reflect.ownKeys(expected),
187
+ ]));
176
188
  return allKeys.some((key) => {
177
189
  const actualValue = actual[key];
178
190
  const expectedValue = expected[key];
@@ -218,7 +230,10 @@ export const entryEqualityGuards = {
218
230
  else if (!expected || typeof expected !== 'object') {
219
231
  throw new AssertionError(`${stringify(expected)} is not an object.`, failureMessage);
220
232
  }
221
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
233
+ const allKeys = Array.from(new Set([
234
+ ...Reflect.ownKeys(actual),
235
+ ...Reflect.ownKeys(expected),
236
+ ]));
222
237
  allKeys.forEach((key) => {
223
238
  const actualValue = actual[key];
224
239
  const expectedValue = expected[key];
@@ -266,7 +281,10 @@ export const entryEqualityGuards = {
266
281
  typeof expected !== 'object') {
267
282
  return actual;
268
283
  }
269
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
284
+ const allKeys = Array.from(new Set([
285
+ ...Reflect.ownKeys(actual),
286
+ ...Reflect.ownKeys(expected),
287
+ ]));
270
288
  const valid = allKeys.some((key) => {
271
289
  const actualValue = actual[key];
272
290
  const expectedValue = expected[key];
@@ -319,7 +337,10 @@ export const entryEqualityGuards = {
319
337
  typeof expected !== 'object') {
320
338
  return undefined;
321
339
  }
322
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
340
+ const allKeys = Array.from(new Set([
341
+ ...Reflect.ownKeys(actual),
342
+ ...Reflect.ownKeys(expected),
343
+ ]));
323
344
  const valid = allKeys.every((key) => {
324
345
  const actualValue = actual[key];
325
346
  const expectedValue = expected[key];
@@ -370,7 +391,10 @@ export const entryEqualityGuards = {
370
391
  typeof expected !== 'object') {
371
392
  return actual;
372
393
  }
373
- const allKeys = Array.from(new Set([...Reflect.ownKeys(actual), ...Reflect.ownKeys(expected)]));
394
+ const allKeys = Array.from(new Set([
395
+ ...Reflect.ownKeys(actual),
396
+ ...Reflect.ownKeys(expected),
397
+ ]));
374
398
  const valid = allKeys.some((key) => {
375
399
  const actualValue = actual[key];
376
400
  const expectedValue = expected[key];
@@ -11,10 +11,10 @@ type AssertTypeOf<TestingType> = {
11
11
  }>['branded']['toEqualTypeOf'];
12
12
  matches: ExpectTypeOf<TestingType, {
13
13
  positive: true;
14
- }>['toMatchTypeOf'];
14
+ }>['toExtend'];
15
15
  notMatches: ExpectTypeOf<TestingType, {
16
16
  positive: false;
17
- }>['toMatchTypeOf'];
17
+ }>['toExtend'];
18
18
  };
19
19
  declare function tsType<Actual>(
20
20
  /** Run-time value to type check. */