@@ -204,31 +204,31 @@ export const testSchemas = _tc => {
204204 s . number . validate ( known )
205205 // @ts -expect-error
206206 s . number . validate ( unknown )
207- const f = s . lambda ( s . number , s . void ) . ensure ( ( _x ) => { } )
207+ const f = s . lambda ( s . number , s . $ void) . ensure ( ( _x ) => { } )
208208 // should match a function with more parameters
209- t . assert ( s . lambda ( s . number , s . string , s . void ) . validate ( f ) )
209+ t . assert ( s . lambda ( s . number , s . string , s . $ void) . validate ( f ) )
210210 // should still not match a different function
211211 // @ts -expect-error
212- s . lambda ( s . string , s . void ) . validate ( f )
213- const x = s . object ( { f : s . lambda ( s . string , s . void ) , n : s . number } ) . ensure ( { f : ( ) => { } , n : 99 } )
212+ s . lambda ( s . string , s . $ void) . validate ( f )
213+ const x = s . object ( { f : s . lambda ( s . string , s . $ void) , n : s . number } ) . ensure ( { f : ( ) => { } , n : 99 } )
214214 t . assert ( x . n === 99 )
215215 s . lambda ( ) . cast ( ( ) => { } )
216216 } )
217217 t . group ( 'lambda' , ( ) => {
218218 const $fun = s . lambda ( s . number , s . string , s . string )
219219 t . assert ( $fun . validate ( ( ) => '' ) )
220- t . assert ( $fun . validate ( /** @param {number } n */ ( n ) => '' ) )
220+ t . assert ( $fun . validate ( /** @param {number } _n */ ( _n ) => '' ) )
221221 // @ts -expect-error
222222 $fun . validate ( /** @param {number } n */ ( n ) => n ) // expected string result
223- const $fun2 = s . lambda ( s . number , s . string , s . void )
223+ const $fun2 = s . lambda ( s . number , s . string , s . $ void)
224224 t . assert ( $fun2 . validate ( ( ) => '' ) )
225225 t . assert ( $fun2 . validate ( /** @param {number } n */ ( n ) => n + '' ) )
226226 t . assert ( $fun2 . validate ( /** @param {number } n */ ( n ) => n ) ) // this works now, because void is the absense of value
227227 const $fun3 = s . lambda ( s . number , s . undefined )
228228 // @ts -expect-error
229229 $fun3 . validate ( /** @param {number } n */ ( n ) => n ) // this doesn't work, because expected the literal undefined.
230230 // @ts -expect-error
231- t . assert ( ! $fun3 . validate ( /** @type {(a: number, b: number) => undefined } */ ( a , b ) => undefined ) ) // too many parameters
231+ t . assert ( ! $fun3 . validate ( /** @type {(a: number, b: number) => undefined } */ ( _a , _b ) => undefined ) ) // too many parameters
232232 } )
233233}
234234
0 commit comments