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
importschemafrom"@primate/schema";importarrayfrom"@primate/schema/array";importfilefrom"@primate/schema/file";importnumberfrom"@primate/schema/number";importstringfrom"@primate/schema/string";// options:// coerce: accept string values as valid by trying to coerce them first to target type// strict: make sure all fields are presentconstform=schema({id: number,title: string,tags: array.of(string).min(2),content: file,},{coerce: true,strict: false});form.validate({id: "1",title: "foobar"});// -> success: returns validated fields, coerced to correct type if option// `coerce` was set to true// -> failure: throws, with validation errors
The text was updated successfully, but these errors were encountered:
General purpose validation module.
The text was updated successfully, but these errors were encountered: