Skip to main content
Module

x/abstruct/mod.ts

Abstract structure for JavaScript data validation
Latest
import * as abstruct from "https://deno.land/x/abstruct@1.0.0/mod.ts";

Classes

And validator composer. It composes validators like Logical AND operator.

Base validator.

Count validator.

Empty validator. It checks the items is empty.

Enumerator validator.

Validator equivalent to strict equality(===) operator.

Result of Error API.

Fixed array validator. It checks each item passes each Validator.

Float validator.

Validator equivalent to greater than or equal(<=) operator.

Validator equivalent to greater than(<) operator.

Validator equivalent to strict inequality(!==) operator.

Validator for instance. It executes instanceof operator.

Integer validator.

Validator equivalent to in operator.

Item validator. It checks each item of items.

Validator equivalent to less than or equal to(>=) operator.

Validator equivalent to less than(>) operator.

Max count validator. It checks items count is less than or equal to limit.

Min count validator. It checks items count is greater than or equal to limit.

Negative number validator.

Non-Empty validator. It checks items is non-empty.

Non-negative number validator.

Non-positive number validator.

Validator for inversion.

Nullish(null or undefined) validator.

Result of OK API.

Optional object validator. It checks properties, but also passes if the property does not exist.

Or validator composer. It composes validators like Logical OR operator.

Validator for regex pattern.

Positive number validator.

Object properties validator.

Property key validator. It checks to pass all property key.

Property value validator. It checks to pass all property value.

Range validator.

Base validator for scalar.

Single validator. It checks items is single.

Validator for JavaScript data type. It executes typeof like operator. The difference with typeof operator is that "object" does not match null.

Unique validator. It checks the each item is unique.

Validation error.

Valid Date validator.

Variables

Bigint validator.

Boolean validator.

Empty validator. It checks the items is empty.

Factory for fixed array validator. It checks each item passes each Validator.

Float validator.

Integer validator.

Integer in the range -32768 ~ 32767 validator.

Integer in the range -2147483648 ~ 2147483647 validator.

Integer in the range -127 ~ 128 validator.

Factory for item validator. It checks each item of items.

Negative number validator.

Non-Empty validator. It checks items is non-empty.

Non-negative number validator.

Non-positive number validator.

Nullish(null or undefined) validator.

Number validator.

Factory for optional properties validator.

Positive number validator.

Factory for property key validator.

Factory for properties validator.

Factory for property value validator.

Single validator. It checks items is single.

String validator.

Symbol validator.

Integer in the range 0 ~ 65535 validator.

Integer in the range 0 ~ 4294967295 validator.

Integer in the range 0 ~ 255 validator.

Unique validator. It checks the each item is unique.

Valid Date validator.

Functions

Factory for validator composer like Logical AND. and composes multiple validators and creates a new validator. The composed validator executes the validator from left to right, just like the Logical AND operator. If the validation fails en route, the evaluation stops there.

Assert that the input passes validator.

Factory for range validator.

Factory for count validator. It checks count(size, length) of items.

Create validator from check function.

Create Validator from Validator.validate.

Factory for enumerator validator.

Validator factory equivalent to strict equality(===) operator.

Factory for validator equivalent to greater than(<) operator.

Factory for validator equivalent to greater than or equal(<=) operator.

Factory for existence of property validator.

Validator factory equivalent to the instanceof operator.

Crate validator lazily.

Factory for validator equivalent to less than(>) operator.

Factory for validator equivalent to less than or equal to (>=) operator.

Factory for max count validator. It checks items count is less than or equal to limit.

Factory for min count validator. It checks items count is greater than or equal to limit.

Factory for validator equivalent to strict inequality(!==) operator.

Factory for validator inversion.

Factory for validator composer like Logical OR.

Factory for regex pattern validator.

Validator factory for JavaScript data type. The difference with typeof operator is that "object" does not match null.

The validate executes the Validator and returns a Result type. If validation succeeds, it returns Ok. If it fails, it returns Err.

Interfaces

Assert options.

Binding message API.

Multiple assert options.

Single assert options.

Validate options.

Validation error options.

Validation failure.

Validator API.

Type Aliases

Constructor type.

Represent either success(Ok) or failure(Err).

String representation of JavaScript data type.