@@ -934,7 +934,7 @@ Deno.test("isOneOf<T>", async (t) => {
934934 await assertSnapshot ( t , isOneOf ( [ isNumber , isString , isBoolean ] ) . name ) ;
935935 } ) ;
936936 await t . step ( "returns proper type predicate" , ( ) => {
937- const preds = [ isNumber , isString , isBoolean ] ;
937+ const preds = [ isNumber , isString , isBoolean ] as const ;
938938 const a : unknown = [ 0 , "a" , true ] ;
939939 if ( isOneOf ( preds ) ( a ) ) {
940940 assertType < Equal < typeof a , number | string | boolean > > ( true ) ;
@@ -945,20 +945,20 @@ Deno.test("isOneOf<T>", async (t) => {
945945 const isBar = isObjectOf ( { foo : isString , bar : isNumber } ) ;
946946 type Foo = PredicateType < typeof isFoo > ;
947947 type Bar = PredicateType < typeof isBar > ;
948- const preds = [ isFoo , isBar ] ;
948+ const preds = [ isFoo , isBar ] as const ;
949949 const a : unknown = [ 0 , "a" , true ] ;
950950 if ( isOneOf ( preds ) ( a ) ) {
951951 assertType < Equal < typeof a , Foo | Bar > > ( true ) ;
952952 }
953953 } ) ;
954954 await t . step ( "returns true on one of T" , ( ) => {
955- const preds = [ isNumber , isString , isBoolean ] ;
955+ const preds = [ isNumber , isString , isBoolean ] as const ;
956956 assertEquals ( isOneOf ( preds ) ( 0 ) , true ) ;
957957 assertEquals ( isOneOf ( preds ) ( "a" ) , true ) ;
958958 assertEquals ( isOneOf ( preds ) ( true ) , true ) ;
959959 } ) ;
960960 await t . step ( "returns false on non of T" , async ( t ) => {
961- const preds = [ isNumber , isString , isBoolean ] ;
961+ const preds = [ isNumber , isString , isBoolean ] as const ;
962962 await testWithExamples ( t , isOneOf ( preds ) , {
963963 excludeExamples : [ "number" , "string" , "boolean" ] ,
964964 } ) ;
@@ -979,7 +979,7 @@ Deno.test("isAllOf<T>", async (t) => {
979979 const preds = [
980980 is . ObjectOf ( { a : is . Number } ) ,
981981 is . ObjectOf ( { b : is . String } ) ,
982- ] ;
982+ ] as const ;
983983 const a : unknown = { a : 0 , b : "a" } ;
984984 if ( isAllOf ( preds ) ( a ) ) {
985985 assertType < Equal < typeof a , { a : number } & { b : string } > > ( true ) ;
@@ -989,14 +989,14 @@ Deno.test("isAllOf<T>", async (t) => {
989989 const preds = [
990990 is . ObjectOf ( { a : is . Number } ) ,
991991 is . ObjectOf ( { b : is . String } ) ,
992- ] ;
992+ ] as const ;
993993 assertEquals ( isAllOf ( preds ) ( { a : 0 , b : "a" } ) , true ) ;
994994 } ) ;
995995 await t . step ( "returns false on non of T" , async ( t ) => {
996996 const preds = [
997997 is . ObjectOf ( { a : is . Number } ) ,
998998 is . ObjectOf ( { b : is . String } ) ,
999- ] ;
999+ ] as const ;
10001000 assertEquals (
10011001 isAllOf ( preds ) ( { a : 0 , b : 0 } ) ,
10021002 false ,
0 commit comments