@@ -66,7 +66,6 @@ test('Can get all keys between objects', t => {
66
66
assert <got , expected >(t );
67
67
assert <expected , got >(t );
68
68
});
69
-
70
69
```
71
70
72
71
### AllRequired
@@ -80,7 +79,6 @@ test('Can make all fields of options object required (not optional and not nulla
80
79
assert <got , expected >(t );
81
80
assert <expected , got >(t );
82
81
});
83
-
84
82
```
85
83
86
84
### CombineObjects
@@ -102,7 +100,6 @@ test('Can combine two objects (without pesky & in vscode)', t => {
102
100
assert <got , expected >(t );
103
101
assert <expected , got >(t );
104
102
});
105
-
106
103
```
107
104
108
105
### DeepPartial
@@ -169,7 +166,6 @@ test('Can get a deep partial object with functions', t => {
169
166
assert <got , expected >(t );
170
167
assert <expected , got >(t );
171
168
});
172
-
173
169
```
174
170
175
171
### DeepReadonly
@@ -216,7 +212,6 @@ test('Can make an object with functions readonly', t => {
216
212
assert <got , expected >(t );
217
213
assert <expected , got >(t );
218
214
});
219
-
220
215
```
221
216
222
217
### DiffKeys
@@ -234,7 +229,6 @@ test('Can get all keys that are different between objects', t => {
234
229
assert <gotA , ' x' >(t );
235
230
assert <gotB , ' z' >(t );
236
231
});
237
-
238
232
```
239
233
240
234
### GetKey
@@ -259,7 +253,6 @@ test('Will get `never` if key does not exist', t => {
259
253
assert <got , expected >(t );
260
254
assert <expected , got >(t );
261
255
});
262
-
263
256
```
264
257
265
258
### HasKey
@@ -280,7 +273,6 @@ test('Can get an object with only shared properties', t => {
280
273
assert <got , expected >(t );
281
274
assert <expected , got >(t );
282
275
});
283
-
284
276
```
285
277
286
278
### KeysByType
@@ -299,7 +291,6 @@ test('Can filter object keys by right side type', t => {
299
291
assert <got , expected >(t );
300
292
assert <expected , got >(t );
301
293
});
302
-
303
294
```
304
295
305
296
### Merge
@@ -329,7 +320,6 @@ test('Can merge an object containing all strings as keys', t => {
329
320
assert <got , expected >(t );
330
321
assert <expected , got >(t );
331
322
});
332
-
333
323
```
334
324
335
325
### ObjectKeys
@@ -353,7 +343,6 @@ test('Can turn an object into another object', t => {
353
343
assert <got , expected >(t );
354
344
assert <expected , got >(t );
355
345
});
356
-
357
346
```
358
347
359
348
### Omit
@@ -369,7 +358,6 @@ test('Can omit keys from an object', t => {
369
358
assert <got , expected >(t );
370
359
assert <expected , got >(t );
371
360
});
372
-
373
361
```
374
362
375
363
### Optional
@@ -384,7 +372,6 @@ test('Can make properties optional', t => {
384
372
assert <got , expected >(t );
385
373
assert <expected , got >(t );
386
374
});
387
-
388
375
```
389
376
390
377
### Overwrite
@@ -403,7 +390,6 @@ test('Can overwrite properties on an object', t => {
403
390
assert <got2 , expected >(t );
404
391
assert <expected , got2 >(t );
405
392
});
406
-
407
393
```
408
394
409
395
### PlainObject
@@ -433,7 +419,6 @@ test('Can make certain fields of options object required', t => {
433
419
assert <got2 , expected2 >(t );
434
420
assert <got3 , expected3 >(t );
435
421
});
436
-
437
422
```
438
423
439
424
### SharedKeys
@@ -449,7 +434,6 @@ test('Can get keys that are same between objects', t => {
449
434
assert <got , expected >(t );
450
435
assert <expected , got >(t );
451
436
});
452
-
453
437
```
454
438
455
439
### StrictUnion
@@ -474,7 +458,6 @@ test('disallow union members with mixed properties', t => {
474
458
assert <isStrict <nonStrictUnion >, ' No' >(t );
475
459
476
460
});
477
-
478
461
```
479
462
480
463
### StringKeys
@@ -500,7 +483,6 @@ test('Can get a union of all values in an object', t => {
500
483
assert <got , expected >(t );
501
484
assert <expected , got >(t );
502
485
});
503
-
504
486
```
505
487
506
488
### UnionKeys
@@ -517,7 +499,6 @@ test('Can get all keys between objects in a union', t => {
517
499
assert <got , expected >(t );
518
500
assert <expected , got >(t );
519
501
});
520
-
521
502
```
522
503
523
504
## Utils
@@ -557,7 +538,6 @@ test("cannot be used to prevent a distributive conditional from distributing", t
557
538
assert <Test , " Yes" | " No" >(t );
558
539
assert <" Yes" | " No" , Test >(t );
559
540
});
560
-
561
541
```
562
542
563
543
### NoInfer
@@ -573,7 +553,6 @@ test('Will not infer based on second argument', t => {
573
553
assert <typeof x , ' hi' >(t );
574
554
assert <typeof x , number >(t );
575
555
});
576
-
577
556
```
578
557
579
558
### Nominal
@@ -586,7 +565,6 @@ test('Can make a new nominal type', t => {
586
565
// TODO: improve once negative testing is in place
587
566
assert <Id , Nominal <string , ' id' >>(t );
588
567
});
589
-
590
568
```
591
569
592
570
### Nullable
@@ -604,7 +582,6 @@ test('Will make a type not nullable', t => {
604
582
605
583
assert <got , string >(t );
606
584
});
607
-
608
585
```
609
586
610
587
### PromiseOr
@@ -616,7 +593,6 @@ test('Will give back a promise containing given type union the type itself', t =
616
593
617
594
assert <got , expected >(t );
618
595
});
619
-
620
596
```
621
597
622
598
### UnionToIntersection
@@ -640,7 +616,6 @@ test('Union of Objects', t => {
640
616
641
617
assert <got , expected >(t );
642
618
});
643
-
644
619
```
645
620
646
621
## Functions
@@ -659,7 +634,6 @@ test('Can define the type of a function that takes any arguments', t => {
659
634
assert <got , expected >(t );
660
635
assert <got2 , expected2 >(t );
661
636
});
662
-
663
637
```
664
638
665
639
### ArgsAsTuple
@@ -681,7 +655,6 @@ test("Can get a tuple of function's argument types", t => {
681
655
assert <ArgsAsTuple <F2 >, E2 >(t );
682
656
assert <ArgsAsTuple <F3 >, E3 >(t );
683
657
});
684
-
685
658
```
686
659
687
660
### ConstructorFunction
@@ -693,7 +666,6 @@ test('Can build a constructor type for a type', t => {
693
666
694
667
assert <Constructor , typeof Thing >(t );
695
668
});
696
-
697
669
```
698
670
699
671
### OverwriteReturn
@@ -708,8 +680,6 @@ test('Can change return type of a function', t => {
708
680
assert <got , expected >(t );
709
681
assert <expected , got >(t );
710
682
});
711
-
712
-
713
683
```
714
684
715
685
### Predicate
@@ -721,7 +691,6 @@ test('Can build a predicate function with single known argument type', t => {
721
691
722
692
assert <PredFunc , expected >(t );
723
693
});
724
-
725
694
```
726
695
727
696
## Strings
@@ -737,7 +706,6 @@ test('Can remove a string from a union of strings', t => {
737
706
assert <DropString <b , ' hey' | ' there' >, never >(t );
738
707
assert <DropString <a , ' hi' | ' there' >, never >(t );
739
708
});
740
-
741
709
```
742
710
743
711
### StringEqual
@@ -752,7 +720,6 @@ test('Can check that two unions of strings are equal', t => {
752
720
assert <StringEqual <b , a >, True >(t );
753
721
assert <StringEqual <b , c >, False >(t );
754
722
});
755
-
756
723
```
757
724
758
725
### UnionContains
@@ -773,7 +740,6 @@ test('Can get the intersection of tuple values', t => {
773
740
assert <got , expected >(t );
774
741
assert <expected , got >(t );
775
742
});
776
-
777
743
```
778
744
779
745
### Length
@@ -789,7 +755,6 @@ test('Can get the length of a tuple', t => {
789
755
assert <gotX , 2 >(t );
790
756
assert <gotT , 4 >(t );
791
757
});
792
-
793
758
```
794
759
795
760
### UnionizeTuple
@@ -804,7 +769,6 @@ test('Can get a union of all values in tuple', t => {
804
769
assert <got , expected >(t );
805
770
assert <expected , got >(t );
806
771
});
807
-
808
772
```
809
773
810
774
## Numbers
@@ -816,7 +780,6 @@ test('Can add two numbers', t => {
816
780
type fifty = Add <12 , 38 >;
817
781
assert <fifty , 50 >(t );
818
782
});
819
-
820
783
```
821
784
822
785
### IsOne
@@ -828,7 +791,6 @@ test('Can check if a number is one', t => {
828
791
assert <notOne , False >(t );
829
792
assert <one , True >(t );
830
793
});
831
-
832
794
```
833
795
834
796
### IsZero
@@ -840,7 +802,6 @@ test('Can check if a number is zero', t => {
840
802
assert <notZero , False >(t );
841
803
assert <zero , True >(t );
842
804
});
843
-
844
805
```
845
806
846
807
### Next
@@ -856,7 +817,6 @@ test('Can check if two numbers are equal', t => {
856
817
assert <notEqual , False >(t );
857
818
assert <equal , True >(t );
858
819
});
859
-
860
820
```
861
821
862
822
### Numbers
@@ -870,7 +830,6 @@ test('Can get a number as a string', t => {
870
830
type str = NumberToString <22 >;
871
831
assert <str , ' 22' >(t );
872
832
});
873
-
874
833
```
875
834
876
835
### Prev
@@ -884,7 +843,6 @@ test('Can subtract two numbers', t => {
884
843
type ten = Sub <22 , 12 >;
885
844
assert <ten , 10 >(t );
886
845
});
887
-
888
846
```
889
847
890
848
## Conditionals
@@ -904,7 +862,6 @@ test('Conditions can be based on AND', t => {
904
862
assert <gotTF , string >(t );
905
863
assert <gotTT , number >(t );
906
864
});
907
-
908
865
```
909
866
910
867
### If
@@ -918,7 +875,6 @@ test('Can assign type conditionally', t => {
918
875
assert <gotF , string >(t );
919
876
assert <gotT , number >(t );
920
877
});
921
-
922
878
```
923
879
924
880
### Nand
@@ -930,7 +886,6 @@ test('Conditions can be based on NAND', t => {
930
886
assert <Nand <True , False >, True >(t );
931
887
assert <Nand <False , False >, True >(t );
932
888
});
933
-
934
889
```
935
890
936
891
### Not
@@ -944,7 +899,6 @@ test('Conditional logic can be inversed with NOT', t => {
944
899
assert <gotF , number >(t );
945
900
assert <gotT , string >(t );
946
901
});
947
-
948
902
```
949
903
950
904
### Or
@@ -962,7 +916,6 @@ test('Conditions can be based on OR', t => {
962
916
assert <gotTF , number >(t );
963
917
assert <gotTT , number >(t );
964
918
});
965
-
966
919
```
967
920
968
921
### Xor
@@ -974,7 +927,6 @@ test('Conditions can be based on XOR', t => {
974
927
assert <Xor <True , False >, True >(t );
975
928
assert <Xor <False , False >, False >(t );
976
929
});
977
-
978
930
```
979
931
980
932
## Predicates
@@ -1049,7 +1001,6 @@ test('Can check if an object contains a key', t => {
1049
1001
t .fail ();
1050
1002
}
1051
1003
});
1052
-
1053
1004
```
1054
1005
1055
1006
### objectKeys
@@ -1067,7 +1018,6 @@ test('Can get keys of an object', t => {
1067
1018
1068
1019
t .deepEqual (keys , [' a' , ' b' ]);
1069
1020
});
1070
-
1071
1021
```
1072
1022
1073
1023
### Readonly
@@ -1098,6 +1048,5 @@ test('Can generate a tagged object', t => {
1098
1048
assert <typeof expected , typeof got >(t );
1099
1049
1100
1050
});
1101
-
1102
1051
```
1103
1052
0 commit comments