CustomValidators: TCustomValidator<unknown, unknown, unknown>[]
Description: string
Sample: any
_cast(_ctx: IValidatorContext<unknown, unknown>): Promise<void> | void
_custom<Return>(validator: TCustomValidator<any, any, Return>,isDefault?: boolean,)
_isPlainObject(value: any)
_toJSON(_ctx?: IJSONSchemaContext): IValidatorJSONSchema
_toSample(_ctx?: ISampleDataContext): Input | Value<Input>
_toStatic(_ctx?: IStaticContext): BaseValidator<Shape, Input, Output>
_validate(ctx: IValidatorContext): Promise<IValidatorContext>
Adds a stop point to the validation if there was an error occured on the current validator.
custom<Return>(validator: TCustomValidator<Input, Output, Return>)
Provide a custom method for validation.
Get default validator options
sample(sample: any)
Add a sample for the Sample data.
setOptions(options: Partial<TBaseValidatorOptions>)
Change the validator's default options
test(input?: any,ctx?: IValidationContext,)
Tries to execute the validation chain and returns a boolean value based on the result.
Adds a stop point to the validation if there was an error occured on the current validator.
toJSON(options?: IJSONSchemaOptions)
Generates a JSON schema based on your validation schema.
toSample(options?: ISampleDataOptions)
Generates a Sample data based on your validation schema.
toStatic(options?: IStaticOptions)
Converts the runtime context into a static validator.
try(input?: any,ctx?: IValidationContext,)
Tries to execute the validation chain and if there is an error, it will not be thrown but instead will be returned.
validate(input?: any,ctx?: IValidationContext,): Promise<Output>
Executes the validation chain.
createFactory<T,A extends unknown[],>(cls: new (...args: A) => T): (...args: A) => T
resolveErrorMessage(message: TErrorMessage | undefined,defaultMessage: string,)
resolveValidator<V extends BaseValidator>(validator: any): V
resolveValidator<V extends BaseValidator>(validator: any,silent: false,): V
resolveValidator<V extends BaseValidator>(validator: any,silent: true,): V | null