Skip to main content
zerotal

Documentation


Documentation / @zerotal/validator / runValidationAsync

Function: runValidationAsync()

runValidationAsync<S>(schema, input): Promise<ValidationOutcome<unknown>>

Defined in: validator/src/Validator.ts:300

Like runValidation() but also executes async rules (unique, exists, custom fn). Use this in validate() and FormRequest.validate() instead of runValidation() whenever the schema may contain DB-aware or custom async rules.

Type Parameters

S

S extends Schema

Parameters

schema

S

input

Record<string, unknown>

Returns

Promise<ValidationOutcome<unknown>>