@@ -25,7 +25,7 @@ export const testSchemas = _tc => {
2525 t . assert ( ! s . bigint . validate ( new Date ( ) ) )
2626 } )
2727 t . group ( 'symbol' , ( ) => {
28- t . assert ( s . symbol . validate ( Symbol ( ) ) )
28+ t . assert ( s . symbol . validate ( Symbol ( 'random symbol' ) ) )
2929 // @ts -expect-error
3030 t . assert ( ! s . symbol . validate ( { } ) )
3131 // @ts -expect-error
@@ -45,15 +45,15 @@ export const testSchemas = _tc => {
4545 const myobject = s . object ( {
4646 num : s . number
4747 } )
48- const q = /** @type {number } */ ( /** @type {any } */ ( { num : 42 , x :9 } ) )
48+ const q = /** @type {number } */ ( /** @type {any } */ ( { num : 42 , x : 9 } ) )
4949 if ( myobject . check ( q ) ) {
5050 s . number . validate ( q )
5151 myobject . validate ( q )
5252 } else {
5353 // q is a number now
5454 s . number . validate ( q )
5555 }
56- t . assert ( myobject . check ( { num : 42 , x :9 } ) )
56+ t . assert ( myobject . check ( { num : 42 , x : 9 } ) )
5757 // @ts -expect-error
5858 t . assert ( ! myobject . validate ( undefined ) )
5959 // @ts -expect-error
@@ -92,7 +92,7 @@ export const testSchemas = _tc => {
9292 class BetterString extends String { }
9393 // @ts -expect-error
9494 t . assert ( ! s . string . validate ( new BetterString ( ) ) )
95- t . assert ( s . string . validate ( "hi" ) )
95+ t . assert ( s . string . validate ( 'hi' ) )
9696 // @ts -expect-error
9797 t . assert ( ! s . string . validate ( undefined ) )
9898 // @ts -expect-error
@@ -111,7 +111,7 @@ export const testSchemas = _tc => {
111111 {
112112 const mysimplearray = s . array ( s . object ( { } ) )
113113 // @ts -expect-error
114- if ( env . production ) t . fails ( ( ) => t . assert ( mysimplearray . ensure ( { x : 4 } ) ) )
114+ if ( env . production ) t . fails ( ( ) => t . assert ( mysimplearray . ensure ( { x : 4 } ) ) )
115115 mysimplearray . cast ( [ { } ] )
116116 }
117117 } )
@@ -132,7 +132,7 @@ export const testSchemas = _tc => {
132132 t . assert ( ! myintersectionNever . validate ( 42 ) )
133133 // @ts -expect-error
134134 t . assert ( ! myintersectionNever . validate ( 'str' ) )
135- const myintersection = s . intersect ( s . object ( { a : s . number } ) , s . object ( { b : s . number } ) )
135+ const myintersection = s . intersect ( s . object ( { a : s . number } ) , s . object ( { b : s . number } ) )
136136 t . assert ( myintersection . validate ( { a : 42 , b : 42 } ) )
137137 // @ts -expect-error
138138 t . assert ( ! myintersection . validate ( { a : 42 } ) )
@@ -208,12 +208,12 @@ export const testSchemas = _tc => {
208208 $fun . validate ( /** @param {number } n */ ( n ) => n ) // expected string result
209209 const $fun2 = s . lambda ( s . number , s . string , s . void )
210210 t . assert ( $fun2 . validate ( ( ) => '' ) )
211- t . assert ( $fun2 . validate ( /** @param {number } n */ ( n ) => n + '' ) )
211+ t . assert ( $fun2 . validate ( /** @param {number } n */ ( n ) => n + '' ) )
212212 t . assert ( $fun2 . validate ( /** @param {number } n */ ( n ) => n ) ) // this works now, because void is the absense of value
213213 const $fun3 = s . lambda ( s . number , s . undefined )
214214 // @ts -expect-error
215215 $fun3 . validate ( /** @param {number } n */ ( n ) => n ) // this doesn't work, because expected the literal undefined.
216216 // @ts -expect-error
217- t . assert ( ! $fun3 . validate ( /** @type {(a: number, b: number) => undefined } */ ( ( a , b ) => undefined ) ) ) // too many parameters
217+ t . assert ( ! $fun3 . validate ( /** @type {(a: number, b: number) => undefined } */ ( a , b ) => undefined ) ) // too many parameters
218218 } )
219219}
0 commit comments