Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/valibot/src/index.ts

The modular and type safe schema library for validating structural data 🤖
Latest
import * as valibot from "https://deno.land/x/valibot@v1.0.0-beta.5/src/index.ts";

Classes

A Valibot error with useful information.

Variables

Base64 regex.

BIC regex.

Brand symbol.

Cuid2 regex.

Decimal regex.

Digits regex.

Email regex.

Emoji regex from emoji-regex-xs v1.0.0 (MIT license).

Hex color regex.

Hexadecimal regex.

IMEI regex.

IP regex.

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.

MAC regex.

MAC 48 bit regex.

MAC 64 bit regex.

Nano ID regex.

Octal regex.

ULID regex.

UUID regex.

Functions

Adds an issue to the dataset.

Returns the byte count of the input.

Returns the grapheme count of the input.

Returns the Standard Schema properties.

Returns the word count of the input.

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

Disallows inherited object properties and prevents object prototype pollution by disallowing certain keys.

Joins multiple expects values with the given separator.

Stringifies an unknown input to a literal or type string.

Creates an any schema.

Creates a function arguments transformation action.

Creates a function arguments transformation action.

Creates an array schema.

Creates an array schema.

Checks if the input matches the schema. As this is an assertion function, it can be used as a type guard.

Creates an await transformation action.

Creates a Base64 validation action.

Creates a BIC validation action.

Creates a bigint schema.

Creates a blob schema.

Creates a boolean schema.

Creates a brand transformation action.

Creates a bytes validation action.

Creates a check validation action.

Creates a check validation action.

Creates an check items validation action.

Creates a check items validation action.

Changes the local configuration of a schema.

Creates a credit card validation action.

Creates a Cuid2 validation action.

Creates a custom schema.

Creates a custom schema.

Creates a date schema.

Creates a decimal validation action.

Deletes the global configuration.

Deletes a global error message.

Deletes a schema error message.

Deletes a specific error message.

Creates a description metadata action.

Creates a digits validation action.

Creates an email validation action.

Creates an emoji validation action.

Creates an empty validation action.

Creates an ends with validation action.

Creates an object entries definition from a list of keys and a schema.

Creates an enum schema.

Creates an every item validation action.

Creates an excludes validation action.

Returns a fallback value as output if the input does not match the schema.

Returns a fallback value as output if the input does not match the schema.

Creates a file schema.

Creates a filter items transformation action.

Creates a find item transformation action.

Creates a finite validation action.

Flatten the error messages of issues.

Forwards the issues of the passed validation action.

Forwards the issues of the passed validation action.

Creates a function schema.

Returns the default value of the schema.

Returns the default values of the schema.

Returns the default values of the schema.

Creates and returns the dot path of an issue if possible.

Returns the fallback value of the schema.

Returns the fallback values of the schema.

Returns the fallback values of the schema.

Returns the global configuration.

Returns a global error message.

Returns a schema error message.

Returns a specific error message.

Creates a graphemes validation action.

Creates a hash validation action.

Creates a hexadecimal validation action.

Creates a hex color validation action.

Creates an IMEI validation action.

Creates an includes validation action.

Creates an instance schema.

Creates an integer validation action.

Creates an intersect schema.

Creates an intersect schema.

Creates an IP address validation action.

Creates an IPv4 address validation action.

Creates an IPv6 address validation action.

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

Creates an ISO date validation action.

Creates an ISO date time validation action.

A generic type guard to check the kind of an object.

A generic type guard to check the type of an object.

Creates an ISO time validation action.

Creates an ISO time second validation action.

Creates an ISO timestamp validation action.

Creates an ISO week validation action.

A type guard to check if an error is a ValiError.

Creates a picklist schema of object keys.

Creates a lazy schema.

Creates a lazy schema.

Creates a length validation action.

Creates a literal schema.

Creates a loose object schema.

Creates a loose object schema.

Creates a loose tuple schema.

Creates a loose tuple schema.

Creates a MAC address validation action.

Creates a 48-bit MAC address validation action.

Creates a 64-bit MAC address validation action.

Creates a map schema.

Creates a map schema.

Creates a map items transformation action.

Creates a max bytes validation action.

Creates a max graphemes validation action.

Creates a max length validation action.

Creates a max size validation action.

Creates a max value validation action.

Creates a max words validation action.

Creates a custom metadata action.

Creates a MIME type validation action.

Creates a min bytes validation action.

Creates a min graphemes validation action.

Creates a min length validation action.

Creates a min size validation action.

Creates a min value validation action.

Creates a min words validation action.

Creates a multiple of validation action.

Creates a NaN schema.

Creates a Nano ID validation action.

Creates a never schema.

Creates a non-empty validation action.

Creates a non nullable schema.

Creates a non nullable schema.

Creates a non nullish schema.

Creates a non nullish schema.

Creates a non optional schema.

Creates a non optional schema.

Creates a normalize transformation action.

Creates a not bytes validation action.

Creates a not graphemes validation action.

Creates a not length validation action.

Creates a not size validation action.

Creates a not value validation action.

Creates a not words validation action.

Creates a null schema.

Creates a nullable schema.

Creates a nullable schema.

Creates a nullish schema.

Creates a nullish schema.

Creates a number schema.

Creates an object schema.

Creates an object schema.

Creates an object with rest schema.

Creates an object with rest schema.

Creates an octal validation action.

Creates a modified copy of an object schema that does not contain the selected entries.

Creates a optional schema.

Creates an optional schema.

Parses an unknown input based on a schema.

Parses an unknown input based on a schema.

Returns a function that parses an unknown input based on a schema.

Returns a function that parses an unknown input based on a schema.

Creates a modified copy of an object schema that marks all entries as optional.

Creates a modified copy of an object schema that marks all entries as optional.

Creates a partial check validation action.

Creates a partial check validation action.

Creates a modified copy of an object schema that contains only the selected entries.

Creates a picklist schema.

Adds a pipeline to a schema, that can validate and transform its input.

Adds a pipeline to a schema, that can validate and transform its input.

Creates a promise schema.

Creates a raw check validation action.

Creates a raw check validation action.

Creates a raw transformation action.

Creates a raw transformation action.

Creates a readonly transformation action.

Creates a record schema.

Creates a record schema.

Creates a reduce items transformation action.

Creates a regex validation action.

Creates a modified copy of an object schema that marks all entries as required.

Creates a modified copy of an object schema that marks all entries as required.

Creates a function return transformation action.

Creates a function arguments transformation action.

Creates a safe integer validation action.

Parses an unknown input based on a schema.

Parses an unknown input based on a schema.

Returns a function that parses an unknown input based on a schema.

Returns a function that parses an unknown input based on a schema.

Creates a set schema.

Creates a set schema.

Sets the global configuration.

Sets a global error message.

Sets a schema error message.

Sets a specific error message.

Creates a size validation action.

Creates a some item validation action.

Creates a sort items transformation action.

Creates a starts with validation action.

Creates a strict object schema.

Creates a strict object schema.

Creates a strict tuple schema.

Creates a strict tuple schema.

Creates a string schema.

Creates a symbol schema.

Creates a title metadata action.

Creates a to lower case transformation action.

Creates a to max value transformation action.

Creates a to min value transformation action.

Creates a to upper case transformation action.

Creates a custom transformation action.

Creates a custom transformation action.

Creates a trim transformation action.

Creates a trim end transformation action.

Creates a trim start transformation action.

Creates a tuple schema.

Creates a tuple schema.

Creates a tuple with rest schema.

Creates a tuple with rest schema.

Creates an ULID validation action.

Creates an undefined schema.

Creates a undefinedable schema.

Creates an undefinedable schema.

Creates an union schema.

Creates an union schema.

Creates a unknown schema.

Unwraps the wrapped schema.

Creates an URL validation action.

Creates an UUID validation action.

Creates a value validation action.

Creates a variant schema.

Creates a variant schema.

Creates a void schema.

Creates a words validation action.

Interfaces

Any schema type.

Args action type.

Args action async type.

Array issue type.

Array path item type.

Array schema type.

Array schema type.

Await action async type.

Base64 action type.

Base64 issue type.

Base issue type.

Base metadata type.

Base schema type.

Base schema async type.

Base transformation type.

Base transformation async type.

Base validation type.

Base validation async type.

BIC action type.

BIC issue type.

Bigint issue type.

Bigint schema type.

Blob issue type.

Blob schema type.

Boolean issue type.

Boolean schema type.

Brand type.

Brand action type.

Bytes action type.

Bytes issue type.

Check action type.

Check action async type.

Check issue type.

Check items action type.

Check items action async type.

Check items issue type.

Config type.

Credit card action type.

Credit card issue type.

Cuid2 action type.

Cuid2 issue type.

Custom issue type.

Custom schema type.

Custom schema async type.

Date issue type.

Date schema type.

Decimal action type.

Decimal issue type.

Description action type.

Digits action type.

Digits issue type.

Email action type.

Email issue type.

Emoji action type.

Emoji issue type.

Empty action type.

Empty issue type.

Ends with action type.

Ends with issue type.

Enum type.

Enum issue type.

Enum schema type.

Every item action type.

Every item issue type.

Excludes action type.

Excludes issue type.

Failure dataset type.

File issue type.

File schema type.

Filter items action type.

Find item action type.

Finite action type.

Finite issue type.

Function issue type.

Function schema type.

Generic issue type.

Generic metadata type.

Generic schema type.

Generic schema async type.

Generic transformation type.

Generic transformation async type.

Generic validation type.

Generic validation async type.

Graphemes action type.

Graphemes issue type.

Hash action type.

Hash issue type.

Hexadecimal action type.

Hexadecimal issue type.

Hex color action type.

Hex color issue type.

IMEI action type.

IMEI issue type.

Includes action type.

Includes issue type.

Instance issue type.

Instance schema type.

Integer action type.

Integer issue type.

Intersect issue type.

Intersect schema type.

Intersect schema async type.

IP action type.

IP issue type.

IPv4 action type.

IPv4 issue type.

IPv6 action type.

IPv6 issue type.

ISO date action type.

ISO date issue type.

ISO date time action type.

ISO date time issue type.

ISO time action type.

ISO time issue type.

ISO time second action type.

ISO time second issue type.

ISO timestamp action type.

ISO timestamp issue type.

ISO week action type.

ISO week issue type.

Lazy schema type.

Lazy schema async type.

Length action type.

Length issue type.

Literal issue type.

Literal schema type.

Loose object issue type.

Loose object schema type.

Object schema async type.

Loose tuple issue type.

Loose tuple schema type.

Loose tuple schema async type.

48-bit MAC action type.

48-bit MAC issue type.

64-bit MAC action type.

64-bit MAC issue type.

MAC action type.

MAC issue type.

Map issue type.

Map items action type.

Map path item type.

Map schema type.

Map schema async type.

Max bytes action type.

Max bytes issue type.

Max graphemes action type.

Max graphemes issue type.

Max length action type.

Max length issue type.

Max size action type.

Max size issue type.

Max value action type.

Max value issue type.

Max words action type.

Max words issue type.

Metadata action type.

MIME type action type.

MIME type issue type.

Min bytes action type.

Min bytes issue type.

Min graphemes action type.

Min graphemes issue type.

Min length action type.

Min length issue type.

Min size action type.

Min size issue type.

Min value action type.

Min value issue type.

Min words action type.

Min words issue type.

Multiple of action type.

Multiple of issue type.

NaN issue type.

Nano ID action type.

Nano ID issue type.

NaN schema type.

Never issue type.

Never schema type.

Non empty action type.

Non empty issue type.

Non nullable issue type.

Non nullable schema type.

Non nullable schema async type.

Non nullish issue type.

Non nullish schema type.

Non nullish schema async type.

Non optional issue type.

Non optional schema type.

Non optional schema async type.

Normalize action type.

Not bytes action type.

Not bytes issue type.

Not graphemes action type.

Not graphemes issue type.

Not length action type.

Not length issue type.

Not size action type.

Not size issue type.

Not value action type.

Not value issue type.

Not words action type.

Not words issue type.

Nullable schema type.

Nullable schema async type.

Nullish schema type.

Nullish schema async type.

Null issue type.

Null schema type.

Number issue type.

Number schema type.

Object entries type.

Object entries async type.

Object issue type.

Object path item type.

Object schema type.

Object schema async type.

Object with rest issue type.

Object with rest schema type.

Object schema async type.

Octal action type.

Octal issue type.

Optional schema type.

Optional schema async type.

The parser type.

The parser async type.

Partial check action type.

Partial check action async type.

Partial check issue type.

Partial dataset type.

Picklist issue type.

Picklist schema type.

Promise issue type.

Promise schema type.

Raw check action type.

Raw check action async type.

Raw check issue type.

Raw transform action type.

Raw transform action async type.

Raw transform issue type.

Readonly action type.

Record issue type.

Record schema type.

Record schema async type.

Reduce items action type.

Regex action type.

Regex issue type.

Returns action type.

Returns action async type.

Safe integer action type.

Safe integer issue type.

The safe parser type.

The safe parser async type.

Set issue type.

Set path item type.

Set schema type.

Set schema async type.

Size action type.

Size issue type.

Some item action type.

Some item issue type.

Sort items action type.

The result interface if validation fails.

The Standard Schema properties interface.

The result interface if validation succeeds.

Starts with action type.

Starts with issue type.

Strict object issue type.

Strict object schema type.

Strict object schema async type.

Strict tuple issue type.

Strict tuple schema type.

Strict tuple schema async type.

String issue type.

String schema type.

Success dataset type.

Symbol issue type.

Symbol schema type.

Title action type.

To lower case action type.

To max value action type.

To min value action type.

To upper case action type.

Transform action type.

Transform action async type.

Trim action type.

Trim end action type.

Trim start action type.

Tuple issue type.

Tuple schema type.

Tuple schema async type.

Tuple with rest issue type.

Tuple with rest schema type.

Tuple with rest schema async type.

ULID action type.

ULID issue type.

Undefinedable schema type.

Undefinedable schema async type.

Undefined issue type.

Undefined schema type.

Union issue type.

Union schema type.

Union schema async type.

Unknown dataset type.

Unknown path item type.

Unknown schema type.

URL action type.

URL issue type.

UUID action type.

UUID issue type.

Value action type.

Value issue type.

Variant issue type.

Variant option schema type.

Variant option schema async type.

Variant schema type.

Variant schema async type.

Void issue type.

Void schema type.

Words action type.

Words issue type.

Type Aliases

Array input type.

Array requirement type.

Array requirement async type.

Brand name type.

Class type.

Content input type.

Content requirement type.

Deeply picks N specific keys.

Default type.

Default async type.

Default value type.

Error message type.

Fallback type.

Fallback async type.

Extracts first tuple item.

Flat errors type.

The global config type.

Hash type type.

Infer default type.

Infer defaults type.

Infer fallback type.

Infer fallbacks type.

Infer input type.

Infer intersect input type.

Infer intersect output type.

Infer issue type.

Infer map input type.

Infer map output type.

Infer non nullable input type.

Infer non nullable issue type.

Infer non nullable output type.

Infer non nullish input type.

Infer non nullish issue type.

Infer non nullish output type.

Infer non optional input type.

Infer non optional issue type.

Infer non optional output type.

Infer nullable output type.

Infer nullish output type.

Infer object input type.

Infer object issue type.

Infer object output type.

Infer optional output type.

Infer output type.

Infer record input type.

Infer record output type.

Infer set input type.

Infer set output type.

Infer tuple input type.

Infer tuple issue type.

Infer tuple output type.

Infer undefinedable output type.

Infer variant issue type.

Intersect options type.

Intersect options async type.

Issue dot path type.

Issue path item type.

Extracts last tuple item.

Length input type.

Literal type.

Marks specific keys as optional.

Constructs a type that is maybe a promise.

Constructs a type that is maybe readonly.

Extracts null from a type.

Extracts null and undefined from a type.

Extracts undefined from a type.

Normalize form type.

Object keys type.

Output dataset type.

Extracts tuples with path keys.

Picklist options type.

Pipe action type.

Pipe action async type.

Pipe item type.

Pipe item async type.

Prettifies a type for better readability.

Safe parse result type.

Schema with fallback type.

Schema with fallback async type.

Schema with omit type.

Schema without pipe type.

Schema with partial type.

Schema with partial type.

Schema with pick type.

Schema with pipe type.

Schema with pipe async type.

Schema with required type.

Schema with required type.

Size input type.

The result interface of the validate function.

Tuple items type.

Tuple items async type.

Union options type.

Union options async type.

Converts union to intersection type.

Converts union to tuple type.

Value input type.

Variant options type.

Variant options async type.