Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Validator<T>

A class to validate arbitrary data using functional rules.

Type parameters

  • T

Hierarchy

  • Validator

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Protected Readonly rules

Methods

isValid

  • isValid(data: unknown): Promise<boolean>
  • Returns true if the given data is valid and type aliases it as Valid.

    Parameters

    • data: unknown

    Returns Promise<boolean>

validate

  • validate(data: unknown): Promise<T>
  • Attempt to validate the input data. If it is valid, it is type aliased as Valid. If it is invalid, a ValidationError is thrown.

    Parameters

    • data: unknown

    Returns Promise<T>

Protected validateAndGetErrors

  • validateAndGetErrors(data: unknown): Promise<Messages>
  • Apply the validation rules to the data object and return any error messages.

    Parameters

    • data: unknown

    Returns Promise<Messages>

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.