Skip to main content
Module

x/abstruct/mod.ts

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

Classes

Result of Error API.

Result of OK API.

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

Validation error.

Validation failure.

Variables

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.

Factory for property key validator.

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.

Factory for object validator.

Factory for optional properties validator.

Positive number validator.

Single validator. It checks items is single.

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.

Factory for property value 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.

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.

Greedy assert options.

Lazy assert options.

Validate options.

Validation context API.

Validation error options.

Validator API.

Type Aliases

Constructor type.

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

String representation of JavaScript data type.