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', numberorobject`.
Array of validator functions
Protected prePerforms validation of the schema over object. Basically runs
validators, preprocessors and checks for required (if schema is not optional).
Optional context: ValidationContextOptional ValidationContext settings.
Generated using TypeDoc
Any schema builder class. Similar to the
anytype in TypeScript. Allows to define a schema foranyvalue. Use it when you don't know the type of the value.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
any()function instead.Example