Skip to main content
Module

x/valibot/mod.ts

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Go to Latest
import * as valibot from "https://deno.land/x/valibot@v0.21.0/mod.ts";

Classes

A Valibot error with useful information.

Variables

Brand symbol.

Cuid2 regex.

See variant

See variantAsync

Email regex.

Emoji regex.

v
enumType
deprecated

See picklist

v
enumTypeAsync
deprecated

See picklistAsync

IMEI regex.

v
intersection
deprecated

See intersect

IPv4 regex.

IPv6 regex.

ISO 8601 date regex.

ISO 8601 date-time regex.

ISO 8601 time regex.

ISO 8601 time with seconds regex.

ISO 8601 timestamp regex.

ISO 8601 week regex.

v
maxRange
deprecated

See maxValue

v
minRange
deprecated

See minValue

v
nativeEnum
deprecated

See enum_

v
nativeEnumAsync
deprecated

See enumAsync

v
nullType
deprecated

See null_

v
nullTypeAsync
deprecated

See nullAsync

ULID regex.

v
undefinedType
deprecated

See undefined_

See undefinedAsync

v
useDefault
deprecated

See withDefault

UUID regex.

v
voidType
deprecated

See void_

v
voidTypeAsync
deprecated

See voidAsync

Functions

Creates a any schema.

Creates an async any schema.

Creates a array schema.

Creates an async array schema.

Creates a bigint schema.

Creates an async bigint schema.

Creates a blob schema.

Creates an async blob schema.

Creates a boolean schema.

Creates an async boolean schema.

Brands the output type of a schema.

Creates a validation function that validates the byte length of a string.

Coerces the input of a schema to match the required type.

Coerces the input of a async schema to match the required type.

Creates a validation function that validates a Cuid2.

Creates a custom validation function.

Creates a async custom validation function.

Creates a date schema.

Creates an async date schema.

Creates a validation function that validates a email.

Creates a validation function that validates an emoji.

Creates a validation function that validates the end of a string.

Creates a enum schema.

Creates an async enum schema.

f
equal
deprecated

Creates a validation function that checks the value for equality.

Creates a validation function that validates the content of a string or array.

Executes the validation and transformation pipe.

Executes the async validation and transformation pipe.

Returns a fallback value when validating the passed schema failed.

Returns a fallback value when validating the passed schema failed.

Creates a validation function that validates whether a number is finite.

Flatten the error messages of a Vali error.

Returns the default value of the schema.

Returns error and pipe from dynamic arguments.

Returns the default value of the schema.

Returns the default values of the schema.

Returns the default values of the schema.

Returns the fallback value of the schema.

Returns the fallback value of the schema.

Returns the fallback values of the schema.

Returns the fallback values of the schema.

Returns the result object with issues.

Returns the result object with an output.

Returns the pipeline result object with issues.

Returns rest, error and pipe from dynamic arguments.

Returns the schema result object with issues.

Creates a validation function that validates an IMEI.

Creates a validation function that validates the content of a string or array.

Creates an instance schema.

Creates an async instance schema.

Creates a validation function that validates whether a number is an integer.

Creates an intersect schema.

Creates a validation function that validates an IPv4 or IPv6 address.

Creates a validation function that validates an IPv4 address.

Creates a validation function that validates an IPv6 address.

Checks if the input matches the scheme. By using a type predicate, this function can be used as a type guard.

Checks whether a string with numbers corresponds to the luhn algorithm.

Creates a validation function that validates a date.

Creates a validation function that validates a datetime.

Creates a validation function that validates a time.

Creates a validation function that validates a time with seconds.

Creates a validation function that validates a timestamp.

Creates a validation function that validates a week.

Creates a enum schema of object keys.

Creates a validation function that validates the length of a string or array.

Creates a literal schema.

Creates an async literal schema.

Creates a map schema.

Creates an async map schema.

Creates a validation function that validates the byte length of a string.

Creates a validation function that validates the length of a string or array.

Creates a validation function that validates the size of a map, set or blob.

Creates a validation function that validates the value of a string, number or date.

Merges the entries of multiple object schemas. Subsequent object entries overwrite the previous ones.

Merges the entries of multiple async object schemas. Subsequent object entries overwrite the previous ones.

Creates a validation function that validates the MIME type of a file.

Creates a validation function that validates the byte length of a string.

Creates a validation function that validates the length of a string or array.

Creates a validation function that validates the size of a map, set or blob.

Creates a validation function that validates the value of a string, number or date.

Creates a validation function that validates whether a number is a multiple.

Creates a NaN schema.

Creates an async NaN schema.

Creates a never schema.

Creates an async never schema.

Creates a non nullable schema.

Creates an async non nullable schema.

Creates a non nullish schema.

Creates an async non nullish schema.

Creates a non optional schema.

Creates an async non optional schema.

Creates a validation function that validates the byte length of a string.

Creates a validation function that validates the length of a string or array.

Creates a validation function that validates the size of a map, set or blob.

Creates a validation function that validates the value of a string or number.

Creates a null schema.

Creates a nullable schema.

Creates an async nullable schema.

Creates an async null schema.

Creates a nullish schema.

Creates an async nullish schema.

Creates a number schema.

Creates an async number schema.

Creates an object schema.

Creates an async object schema.

Creates an object schema that contains not the selected keys of an existing schema.

Creates an async object schema that contains only the selected keys of an existing schema.

Creates a optional schema.

Creates an async optional schema.

Parses unknown input based on a schema.

Parses unknown input based on a schema.

Creates an object schema consisting of all properties of an existing object schema set to optional.

Creates an async object schema consisting of all properties of an existing object schema set to optional.

f
passthrough
deprecated

Creates an object schema that passes unknown keys.

f
passthroughAsync
deprecated

Creates an object schema that passes unknown keys.

Creates an object schema that contains only the selected keys of an existing schema.

Creates an async object schema that contains only the selected keys of an existing schema.

Creates a picklist schema.

Creates an async picklist schema.

Creates a record schema.

Creates an async record schema.

Creates a recursive schema.

Creates an async recursive schema.

Creates a validation function that validates a string with a regex.

Creates an object schema consisting of all properties of an existing object schema set to none optional.

Creates an async object schema consisting of all properties of an existing object schema set to none optional.

Creates a validation function that validates whether a number is a safe integer.

Parses unknown input based on a schema.

Parses unknown input based on a schema.

Creates a set schema.

Creates an async set schema.

Creates a validation function that validates the size of a map, set or blob.

Creates a special schema.

Creates an async special schema.

Creates a validation function that validates the start of a string.

f
strict
deprecated

Creates a strict object schema that throws an error if an input contains unknown keys.

f
strictAsync
deprecated

Creates a strict async object schema that throws an error if an input contains unknown keys.

Creates a string schema.

Creates an async string schema.

f
strip
deprecated

Creates an object schema that strips unknown keys.

f
stripAsync
deprecated

Creates an object schema that strips unknown keys.

Creates a symbol schema.

Creates an async symbol schema.

Creates a custom transformation function.

Creates a async custom transformation function.

Creates a transformation function that converts all the alphabetic characters in a string to lowercase.

Creates a transformation function that sets a string, number or date to a maximum value.

Creates a transformation function that sets a string, number or date to a minimum value.

Creates a transformation function that removes the leading and trailing white space and line terminator characters from a string.

Creates a transformation function that removes the trailing white space and line terminator characters from a string.

Creates a transformation function that removes the leading white space and line terminator characters from a string.

Creates a transformation function that converts all the alphabetic characters in a string to uppercase.

Adds a transformation step to a schema, which is executed at the end of parsing and can change the output type.

Adds an async transformation step to a schema, which is executed at the end of parsing and can change the output type.

Creates a tuple schema.

Creates an async tuple schema.

Creates a validation function that validates a ULID.

Creates a undefined schema.

Creates an async undefined schema.

Creates a union schema.

Creates an async union schema.

Creates a unknown schema.

Creates an async unknown schema.

Unwraps the wrapped schema.

Creates a validation function that validates a URL.

Creates a validation function that validates a UUID.

Creates a validation function that validates the value of a string or number.

Creates a variant (aka discriminated union) schema.

Creates an async variant (aka discriminated union) schema.

Creates a void schema.

Creates an async void schema.

f
withDefault
deprecated

Passes a default value to a schema in case of an undefined input.

Type Aliases

Parse result type.

Any schema type.

Any schema type.

Array path item type.

Array schema type.

Array schema async type.

Base schema type.

Base schema async type.

Base transformation type.

Base transformation async type.

Base validation type.

Base validation async type.

Bigint schema type.

Bigint schema async type.

Blob schema type.

Blob schema async type.

Boolean schema type.

Boolean schema async type.

Brand type.

Brand name type.

Bytes validation type.

Class enum type.

Cuid2 validation type.

Custom validation type.

Custom validation async type.

Date schema type.

Date schema async type.

Default value type.

Default values type.

Email validation type.

Emoji validation type.

Ends with validation type.

Enum type.

Native enum schema type.

Native enum schema async type.

Equal validation type.

Error message type.

Excludes validation type.

Fallback info type.

Fallback value type.

Fallback values type.

Finite validation type.

Flat errors type.

IMEI validation type.

Includes validation type.

Input inference type.

Instance schema type.

Instance schema type.

Integer validation type.

Intersect options type.

Intersect schema type.

IPv4 validation type.

IPv6 validation type.

IP validation type.

ISO date time validation type.

ISO date validation type.

ISO time second validation type.

ISO timestamp validation type.

ISO time validation type.

ISO week validation type.

Issue type.

Issue origin type.

Issue reason type.

Issues type.

Length validation type.

Literal type.

Literal schema type.

Literal schema async type.

Map input inference type.

Map output inference type.

Map path item type.

Map schema type.

Map schema async type.

Max bytes validation type.

Max length validation type.

Max size validation type.

Max value validation type.

MIME type validation type.

Min bytes validation type.

Min length validation type.

Min size validation type.

Min value validation type.

Multiple of validation type.

NaN schema type.

NaN schema async type.

Never schema type.

Never schema async type.

Non nullable type.

Non nullable schema type.

Non nullable schema async type.

Non nullish type.

Non nullish schema type.

Non nullish schema async type.

Non optional type.

Non optional schema type.

Non optional schema async type.

Not bytes validation type.

Not length validation type.

Not size validation type.

Not value validation type.

Nullable schema type.

Nullable schema async type.

Nullish schema type.

Nullish schema async type.

Null schema type.

Null schema async type.

Number schema type.

Number schema async type.

Object entries type.

Object entries async type.

Object input inference type.

Object output inference type.

Object path item type.

Object schema type.

Object schema async type.

Optional schema type.

Optional schema async type.

Output inference type.

Parse info type.

Partial object entries type.

Partial object entries async type.

Path item type.

Picklist options type.

Picklist schema type.

Picklist schema async type.

Pipe type.

Pipe async type.

Pipe info type.

Pipe result type.

Record input inference type.

Record key type.

Record key type.

Record output inference type.

Record path item type.

Record schema type.

Record schema async type.

Recursive schema type.

Recursive schema async type.

Regex validation type.

Resolve object type.

Safe integer validation type.

Safe parse result type.

Schema with brand type.

Schema with fallback type.

Schema with fallback async type.

Schema with maybe default type.

Schema with maybe default async type.

Schema with maybe fallback type.

Schema with maybe fallback async type.

Schema with transform type.

Schema with transform async type.

Set output inference type.

Set output inference type.

Set path item type.

Set schema type.

Set schema async type.

Size validation type.

Special schema type.

Special schema async type.

Starts with validation type.

String schema type.

String schema async type.

Symbol schema type.

Symbol schema async type.

To custom transformation type.

To custom transformation async type.

To lower case transformation type.

To max value transformation type.

To min value transformation type.

To trimmed end transformation type.

To trimmed start transformation type.

To trimmed transformation type.

To upper case transformation type.

Tuple input inference type.

Tuple shape type.

Tuple shape async type.

Tuple with rest output inference type.

Tuple path item type.

Tuple schema type.

Tuple schema async type.

ULID validation type.

Undefined schema type.

Undefined schema async type.

Union options type.

Union options async type.

Union schema type.

Union schema async type.

Unknown schema type.

Unknown schema async type.

URL validation type.

UUID validation type.

Value validation type.

Variant option type.

Variant option async type.

Variant options type.

Variant options async type.

Variant schema type.

Variant schema async type.

Void schema type.

Void schema async type.