This repository has been archived by the owner on Nov 24, 2024. It is now read-only.
v3.0.0
Features
- New plugin: Function
- New plugin: Any
- Object.oneOf(): documentation
- Object.allOf(): documentation
Updates
Object.schema({ schema, returnErrors })
signature is nowObject.schema(schema, { returnErrors })
(old syntax is still accepted)
Breaking Changes
- All tests (and .custom()) must return either a boolean or a valid object { isValid, error }.
This allow returning custom error and argument to change the error message and be more strict about what is a succesful test.
If yourcustom()
call is returning something else (string, number ...) an error will be thrown.