- Type shortcuts now also include
String
,Number
,Boolean
andDate
. - The
custom
validator can now take an array of functions.
- Opt-in to
null
values using theallowNull
validator. - The object
allowUnknownKeys
validator has been deprecated in favour of the newunknownKeys
validator.
Version
>= 0.2.4 < 1.0.0
has a bug wherenull
is sometimes validated even when input is required. Version 1.0.0 fixes this and introduces the commonallowNull
validator to control the behaviour ofnull
values.
- Bug fixes and internal improvements.
type
andcustom
can now be used alongside each other.- Default functions and custom validators now also works synchronously.
- Strings now has an
enum
validator. - Changed license to MIT
- Improved this file with a TOC
- Added middleware for Connect/Express (from isvalid-express).
- It now catches more errors in schemas - such as wrong values on validators.
- Schema errors are now thrown as a
SchemaError
which contains schema that failed through theschema
property. - The library is now completely asynchronous - allowing for I/O while formalizing, validating and comparing.
- Formalizer is publicly exposed in order to pre-formalize schemas manually.
- Schemas are now formalized per demand. Large schemas are formalized by the validator as they are needed.
- ValidationErrors now contain the pre-formalized schema - for better identification by developer.
- Automatic parsing of ISO-8601 dates into Date - contributed by thom-nic.
- Errors are thrown if validators are used out of context.
- ValidationError now contains the
validator
property - specifying which validator actually failed. - You can now specify custom error messages using the
error
validator. Object
now supports theallowUnknownKeys
validator.