Abstract
Protected
constructorProtected
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.
Abstract
clearRemove all preprocessors for this schema.
Remove all validators for this schema.
Protected
Abstract
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
Abstract
hasSet type of schema explicitly. notUsed
param is needed only for cas when JS is used. E.g. when you
can't call method like schema.hasType<Date>()
, so instead you can call schema.hasType(new Date())
with the same result.
Optional
notUsed: TGenerates 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
preAbstract
validatePerform schema validation on object
.
Object to validate
Optional
context: ValidationContextOptional ValidationContext
settings
Generated using TypeDoc
Base class for all schema builders. Provides basic functionality for schema building.
Note: this class is not intended to be used directly, use one of the subclasses instead.
Typeparam
TResult Type of the object that will be returned by
validate()
method.Typeparam
TRequired If
true
, object will be required. Iffalse
, object will be optional.