You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validator.impl<S.LiteralType>(S.LiteralType,(schema)=>({validate: (input,options)=>{constvalue=schema.valueif(input===value){returnOk(inputasS.Literals)}if(options?.strict===false&&typeofvalue!=='string'){if(typeofvalue==='number'){constresult=parseNumberLiteral(input)if(result.isOk)returnresult}elseif(typeofvalue==='boolean'){constresult=parseBooleanLiteral(input)if(result.isOk)returnresult}}returnSchemaErr(`${input} is not a literal ${value}`)},}))
in non-strict mode, after parsing input to number or boolean, if should it compare the value and the parsing result?
The current implement of Literal validation is
in non-strict mode, after parsing input to
number
orboolean
, if should it compare thevalue
and the parsing result?Like this
The text was updated successfully, but these errors were encountered: