Skip to content

API reference > @kontsedal/olas-core > Validator

Validator type ​

Checks one value: null when it passes, a message or FormIssue[] when it fails, returned at once or as a promise. signal aborts when a newer run supersedes this one and on dispose, so an async validator can cancel its request.

Signature:

typescript
type Validator<T> = (value: T, signal: AbortSignal) => ValidatorResult | Promise<ValidatorResult>;

References: ValidatorResult

Released under the MIT License.