Abstract
Static
anyStatic
arrayStatic
booleanStatic
constantReturn a constant validator that checks that the value is one of a set of given values.
Rest
...allowedValues: Tthe values that are considered valid. can be numbers, strings, booleans, null
, or undefined
Static
jsonStatic
numberStatic
objectCreate a validator that checks that the value is an object with a given shape.
By default the object is not allowed to have keys other than what are specified.
Call allowUnknownKeys(true)
on the returned object validator to allow the object to have keys that are not
specified which are not validated.
validation to apply to each key in the object
Static
orCombine a list of validators to produce a new validator that passes if any of the given validators pass
Rest
...validators: T | [T]validators to combine into an OR expression validator
Static
stringStatic
tupleCreate a validator that checks that the given value is a tuple of values that match the given validators.
Rest
...validators: T | [T]list of validators that the items in the tuple should match in order
Generated using TypeDoc
The default export of the jointz library that exposes static methods for constructing validators.