Protected
isProtected
preprocessorsA list of preprocessors associated with the Builder
Protected
typeProtected
validatorsA list of validators associated with the Builder
Adds a preprocessor
to a preprocessors list
Adds a validator
to validators list.
Remove all preprocessors for this schema.
Remove all validators for this schema.
Protected
createProtected method used to create an new instance of the Builder
defined by the props
object. Should be used to instanticate new
builders to keep builder's immutability.
arbitrary props object
Generates a serializable object describing the defined schema
If set to false
, schema will be optional (null
or undefined
values
will be considered as valid).
Array of preprocessor functions
String id
of schema type, e.g. string',
numberor
object`.
Array of validator functions
Protected
prePerforms validion of the schema over object
. Basically runs
validators, preprocessors and checks for required (if schema is not optional).
Optional
context: ValidationContextOptional ValidationContext
settings.
Static
createGenerated using TypeDoc
Schema builder for functions. Allows to define a schema for a function. It can be: required or optional.
NOTE this class is exported only to give opportunity to extend it by inheriting. It is not recommended to create an instance of this class directly. Use () function instead.
Example
Example
See
func