Skip to main content
Home

Built and signed on GitHub Actions

The modular and type safe schema library for validating structural data 🤖

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (1.1.0)
f
_getStandardProps

Returns the Standard Schema properties.

f
any

Creates an any schema.

I
AnySchema

Any schema interface.

f
args

Creates a function arguments transformation action.

I
ArgsAction

Args action type.

I
ArgsActionAsync

Args action async type.

f
argsAsync

Creates a function arguments transformation action.

f
array

Creates an array schema.

f
arrayAsync

Creates an array schema.

T
ArrayInput

Array input type.

I
ArrayIssue

Array issue interface.

I
ArrayPathItem

Array path item interface.

T
ArrayRequirement

Array requirement type.

T
ArrayRequirementAsync

Array requirement async type.

I
f
assert

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

I
AwaitActionAsync

Await action async interface.

f
awaitAsync

Creates an await transformation action.

f
base64

Creates a Base64 validation action.

I
BaseMetadata

Base metadata interface.

I
BaseSchemaAsync

Base schema async interface.

I
I
BaseTransformationAsync

Base transformation async interface.

I
BaseValidationAsync

Base validation async interface.

f
bic

Creates a BIC validation action.

v
BIC_REGEX

BIC regex.

f
bigint

Creates a bigint schema.

I
BigintIssue

Bigint issue interface.

I
BigintSchema

Bigint schema interface.

f
blob

Creates a blob schema.

I
BlobIssue

Blob issue interface.

I
BlobSchema

Blob schema interface.

f
boolean

Creates a boolean schema.

I
BooleanIssue

Boolean issue interface.

I
BooleanSchema

Boolean schema interface.

I
Brand

Brand interface.

f
brand

Creates a brand transformation action.

I
BrandAction

Brand action interface.

T
BrandName

Brand name type.

v
BrandSymbol

Brand symbol.

f
bytes

Creates a bytes validation action.

f
check

Creates a check validation action.

f
checkAsync

Creates a check validation action.

I
CheckIssue

Check issue interface.

f
checkItems

Creates an check items validation action.

I
f
checkItemsAsync

Creates a check items validation action.

I
CheckItemsIssue

Check items issue interface.

T
Class

Class type.

f
config

Changes the local configuration of a schema.

T
ContentInput

Content input type.

T
ContentRequirement

Content requirement type.

f
creditCard

Creates a credit card validation action.

f
cuid2

Creates a Cuid2 validation action.

v
f
custom

Creates a custom schema.

f
customAsync

Creates a custom schema.

I
CustomIssue

Custom issue interface.

I
CustomSchemaAsync

Custom schema async interface.

f
date

Creates a date schema.

I
DateIssue

Date issue interface.

I
DateSchema

Date schema interface.

f
decimal

Creates a decimal validation action.

T
Default

Default type.

T
DefaultAsync

Default async type.

T
DefaultValue

Default value type.

f
deleteGlobalConfig

Deletes the global configuration.

f
deleteGlobalMessage

Deletes a global error message.

f
deleteSchemaMessage

Deletes a schema error message.

f
deleteSpecificMessage

Deletes a specific error message.

f
description

Creates a description metadata action.

I
DescriptionAction

Description action interface.

f
digits

Creates a digits validation action.

f
email

Creates an email validation action.

f
emoji

Creates an emoji validation action.

v
EMOJI_REGEX

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

f
empty

Creates an empty validation action.

I
EmptyAction

Empty action interface.

I
EmptyIssue

Empty issue interface.

f
endsWith

Creates an ends with validation action.

f
entries

Creates an entries validation action.

f
entriesFromList

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

f
entriesFromObjects

Creates a new object entries definition from existing object schemas.

T
EntriesInput

Entries input type.

I
Enum

Enum interface.

f
enum

Creates an enum schema.

f
enum_

Creates an enum schema.

I
EnumIssue

Enum issue interface.

T
EnumValues

Enum values type.

T
ErrorMessage

Error message type.

f
everyItem

Creates an every item validation action.

I
EveryItemIssue

Every item issue interface.

f
exactOptional

Creates an exact optional schema.

f
exactOptionalAsync

Creates an exact optional schema.

I
I
ExactOptionalSchemaAsync

Exact optional schema async interface.

f
excludes

Creates an excludes validation action.

I
ExcludesIssue

Excludes issue interface.

I
FailureDataset

Failure dataset interface.

T
Fallback

Fallback type.

f
fallback

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

T
FallbackAsync

Fallback async type.

f
fallbackAsync

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

f
file

Creates a file schema.

I
FileIssue

File issue interface.

I
FileSchema

File schema interface.

f
filterItems

Creates a filter items transformation action.

I
FilterItemsAction

Filter items action interface.

f
findItem

Creates a find item transformation action.

I
FindItemAction

Find item action interface.

f
finite

Creates a finite validation action.

T
FlatErrors

Flat errors type.

f
flatten

Flatten the error messages of issues.

I
Flavor

Flavor interface.

f
flavor

Creates a flavor transformation action.

I
FlavorAction

Flavor action interface.

T
FlavorName

Flavor name type.

v
FlavorSymbol

Flavor symbol.

f
forward

Forwards the issues of the passed validation action.

f
forwardAsync

Forwards the issues of the passed validation action.

f
function

Creates a function schema.

f
function_

Creates a function schema.

I
FunctionIssue

Function issue interface.

I
FunctionSchema

Function schema interface.

T
GenericIssue

Generic issue type.

T
GenericMetadata

Generic metadata type.

T
GenericPipeAction

Generic pipe action type.

T
GenericPipeActionAsync

Generic pipe action async type.

T
GenericPipeItem

Generic pipe item type.

T
GenericPipeItemAsync

Generic pipe item async type.

T
GenericSchema

Generic schema type.

T
GenericSchemaAsync

Generic schema async type.

T
GenericTransformation

Generic transformation type.

T
GenericTransformationAsync

Generic transformation async type.

T
GenericValidation

Generic validation type.

T
GenericValidationAsync

Generic validation async type.

f
getDefault

Returns the default value of the schema.

f
getDefaults

Returns the default values of the schema.

f
getDefaultsAsync

Returns the default values of the schema.

f
getDescription

Returns the description of the schema.

f
getDotPath

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

f
getFallback

Returns the fallback value of the schema.

f
getFallbacks

Returns the fallback values of the schema.

f
getFallbacksAsync

Returns the fallback values of the schema.

f
getGlobalConfig

Returns the global configuration.

f
getGlobalMessage

Returns a global error message.

f
getMetadata

Returns the metadata of a schema.

f
getSchemaMessage

Returns a schema error message.

f
getSpecificMessage

Returns a specific error message.

f
getTitle

Returns the title of the schema.

T
GlobalConfig

The global config type.

f
graphemes

Creates a graphemes validation action.

f
gtValue

Creates a greater than value validation action.

I
GtValueAction

Greater than value action type.

I
GtValueIssue

Greater than value issue type.

f
hash

Creates a hash validation action.

T
HashType

Hash type type.

f
hexadecimal

Creates a hexadecimal validation action.

f
hexColor

Creates a hex color validation action.

f
imei

Creates an IMEI validation action.

v
IMEI_REGEX

IMEI regex.

f
includes

Creates an includes validation action.

I
IncludesIssue

Includes issue interface.

T
InferDefault

Infer default type.

T
InferDefaults

Infer defaults type.

T
InferFallback

Infer fallback type.

T
InferFallbacks

Infer fallbacks type.

T
InferInput

Infer input type.

T
InferIssue

Infer issue type.

T
InferMetadata

Infer metadata type.

T
InferOutput

Infer output type.

f
instance

Creates an instance schema.

I
InstanceIssue

Instance issue interface.

I
InstanceSchema

Instance schema interface.

f
integer

Creates an integer validation action.

f
intersect

Creates an intersect schema.

f
intersectAsync

Creates an intersect schema.

I
IntersectIssue

Intersect issue interface.

T
IntersectOptions

Intersect options type.

T
IntersectOptionsAsync

Intersect options async type.

I
IntersectSchema

Intersect schema interface.

I
IntersectSchemaAsync

Intersect schema async interface.

f
ip

Creates an IP address validation action.

v
IP_REGEX

IP regex.

f
ipv4

Creates an IPv4 address validation action.

v
IPV4_REGEX

IPv4 regex.

f
ipv6

Creates an IPv6 address validation action.

v
IPV6_REGEX

IPv6 regex.

f
is

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

v
ISO_DATE_REGEX

ISO 8601 date regex.

v
ISO_DATE_TIME_REGEX

ISO 8601 date-time regex.

v
ISO_TIME_REGEX

ISO 8601 time regex.

v
ISO_TIME_SECOND_REGEX

ISO 8601 time with seconds regex.

v
ISO_TIMESTAMP_REGEX

ISO 8601 timestamp regex.

v
ISO_WEEK_REGEX

ISO 8601 week regex.

f
isoDate

Creates an ISO date validation action.

f
isoDateTime

Creates an ISO date time validation action.

I
f
isOfKind

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

f
isOfType

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

f
isoTime

Creates an ISO time validation action.

f
isoTimeSecond

Creates an ISO time second validation action.

I
I
f
isoTimestamp

Creates an ISO timestamp validation action.

I
f
isoWeek

Creates an ISO week validation action.

T
IssueDotPath

Issue dot path type.

T
IssuePathItem

Issue path item type.

f
isValiError

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

f
keyof

Creates a picklist schema of object keys.

f
lazy

Creates a lazy schema.

f
lazyAsync

Creates a lazy schema.

I
LazySchema

Lazy schema interface.

I
LazySchemaAsync

Lazy schema async interface.

f
length

Creates a length validation action.

T
LengthInput

Length input type.

T
Literal

Literal type.

f
literal

Creates a literal schema.

I
LiteralIssue

Literal issue interface.

I
LiteralSchema

Literal schema interface.

f
looseObject

Creates a loose object schema.

f
looseObjectAsync

Creates a loose object schema.

I
LooseObjectIssue

Loose object issue interface.

I
f
looseTuple

Creates a loose tuple schema.

f
looseTupleAsync

Creates a loose tuple schema.

I
LooseTupleIssue

Loose tuple issue interface.

I
LooseTupleSchema

Loose tuple schema interface.

I
LooseTupleSchemaAsync

Loose tuple schema async interface.

f
ltValue

Creates a less than value validation action.

I
LtValueIssue

Less than value issue type.

f
mac

Creates a MAC address validation action.

f
mac48

Creates a 48-bit MAC address validation action.

v
MAC48_REGEX

MAC 48 bit regex.

I
I
Mac48Issue

48-bit MAC issue interface.

f
mac64

Creates a 64-bit MAC address validation action.

v
MAC64_REGEX

MAC 64 bit regex.

I
I
Mac64Issue

64-bit MAC issue interface.

v
MAC_REGEX

MAC regex.

f
map

Creates a map schema.

f
mapAsync

Creates a map schema.

I
MapIssue

Map issue interface.

f
mapItems

Creates a map items transformation action.

I
MapItemsAction

Map items action interface.

I
MapPathItem

Map path item interface.

f
maxBytes

Creates a max bytes validation action.

f
maxEntries

Creates a max entries validation action.

f
maxGraphemes

Creates a max graphemes validation action.

I
f
maxLength

Creates a max length validation action.

f
maxSize

Creates a max size validation action.

f
maxValue

Creates a max value validation action.

I
MaxValueIssue

Max value issue interface.

f
maxWords

Creates a max words validation action.

f
message

Changes the local message configuration of a schema.

f
metadata

Creates a custom metadata action.

I
MetadataAction

Metadata action interface.

f
mimeType

Creates a MIME type validation action.

f
minBytes

Creates a min bytes validation action.

f
minEntries

Creates a min entries validation action.

f
minGraphemes

Creates a min graphemes validation action.

I
f
minLength

Creates a min length validation action.

f
minSize

Creates a min size validation action.

f
minValue

Creates a min value validation action.

I
MinValueIssue

Min value issue interface.

f
minWords

Creates a min words validation action.

f
multipleOf

Creates a multiple of validation action.

f
nan

Creates a NaN schema.

I
NanIssue

NaN issue interface.

f
nanoid

Creates a Nano ID validation action.

I
NanSchema

NaN schema interface.

f
never

Creates a never schema.

I
NeverIssue

Never issue interface.

I
NeverSchema

Never schema interface.

f
nonEmpty

Creates a non-empty validation action.

I
NonEmptyAction

Non empty action interface.

I
NonEmptyIssue

Non empty issue interface.

f
nonNullable

Creates a non nullable schema.

f
nonNullableAsync

Creates a non nullable schema.

I
NonNullableIssue

Non nullable issue interface.

I
I
NonNullableSchemaAsync

Non nullable schema async interface.

f
nonNullish

Creates a non nullish schema.

f
nonNullishAsync

Creates a non nullish schema.

I
NonNullishIssue

Non nullish issue interface.

I
I
NonNullishSchemaAsync

Non nullish schema async interface.

f
nonOptional

Creates a non optional schema.

f
nonOptionalAsync

Creates a non optional schema.

I
NonOptionalIssue

Non optional issue interface.

I
I
NonOptionalSchemaAsync

Non optional schema async interface.

f
normalize

Creates a normalize transformation action.

I
NormalizeAction

Normalize action interface.

T
NormalizeForm

Normalize form type.

f
notBytes

Creates a not bytes validation action.

f
notEntries

Creates a not entries validation action.

f
notGraphemes

Creates a not graphemes validation action.

I
f
notLength

Creates a not length validation action.

f
notSize

Creates a not size validation action.

f
notValue

Creates a not value validation action.

I
NotValueIssue

Not value issue interface.

f
notValues

Creates a not values validation action.

f
notWords

Creates a not words validation action.

f
null

Creates a null schema.

f
null_

Creates a null schema.

f
nullable

Creates a nullable schema.

f
nullableAsync

Creates a nullable schema.

I
f
nullish

Creates a nullish schema.

f
nullishAsync

Creates a nullish schema.

I
I
NullIssue

Null issue interface.

I
NullSchema

Null schema interface.

f
number

Creates a number schema.

I
NumberIssue

Number issue interface.

I
NumberSchema

Number schema interface.

f
object

Creates an object schema.

f
objectAsync

Creates an object schema.

I
ObjectEntries

Object entries interface.

I
ObjectEntriesAsync

Object entries async interface.

I
ObjectIssue

Object issue interface.

T
ObjectKeys

Object keys type.

I
ObjectPathItem

Object path item interface.

I
f
objectWithRest

Creates an object with rest schema.

f
objectWithRestAsync

Creates an object with rest schema.

I
ObjectWithRestIssue

Object with rest issue interface.

I
f
octal

Creates an octal validation action.

v
f
omit

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

f
optional

Creates an optional schema.

f
optionalAsync

Creates an optional schema.

I
T
OutputDataset

Output dataset type.

f
parse

Parses an unknown input based on a schema.

f
parseAsync

Parses an unknown input based on a schema.

f
parseJson

Creates a parse JSON transformation action.

I
ParseJsonAction

Parse JSON action interface.

I
ParseJsonConfig

Parse JSON config interface.

I
ParseJsonIssue

Parse JSON issue interface.

I
Parser

The parser interface.

f
parser

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

I
ParserAsync

The parser async interface.

f
parserAsync

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

f
partial

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

f
partialAsync

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

f
partialCheck

Creates a partial check validation action.

f
partialCheckAsync

Creates a partial check validation action.

I
PartialCheckIssue

Partial check issue interface.

I
PartialDataset

Partial dataset interface.

f
pick

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

f
picklist

Creates a picklist schema.

I
PicklistIssue

Picklist issue interface.

T
PicklistOptions

Picklist options type.

I
PicklistSchema

Picklist schema interface.

f
pipe

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

T
PipeAction

Pipe action type.

T
PipeActionAsync

Pipe action async type.

f
pipeAsync

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

T
PipeItem

Pipe item type.

T
PipeItemAsync

Pipe item async type.

f
promise

Creates a promise schema.

I
PromiseIssue

Promise issue interface.

I
PromiseSchema

Promise schema interface.

f
rawCheck

Creates a raw check validation action.

I
RawCheckAction

Raw check action interface.

I
RawCheckActionAsync

Raw check action async interface.

f
rawCheckAsync

Creates a raw check validation action.

I
RawCheckIssue

Raw check issue interface.

f
rawTransform

Creates a raw transformation action.

I
RawTransformAction

Raw transform action interface.

I
RawTransformActionAsync

Raw transform action async interface.

f
rawTransformAsync

Creates a raw transformation action.

I
RawTransformIssue

Raw transform issue interface.

f
readonly

Creates a readonly transformation action.

I
ReadonlyAction

Readonly action interface.

f
record

Creates a record schema.

f
recordAsync

Creates a record schema.

I
RecordIssue

Record issue interface.

I
f
reduceItems

Creates a reduce items transformation action.

I
ReduceItemsAction

Reduce items action interface.

f
regex

Creates a regex validation action.

f
required

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

f
requiredAsync

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

f
returns

Creates a function return transformation action.

I
ReturnsAction

Returns action type.

I
ReturnsActionAsync

Returns action async type.

f
returnsAsync

Creates a function arguments transformation action.

f
rfcEmail

Creates a RFC email validation action.

f
safeInteger

Creates a safe integer validation action.

I
f
safeParse

Parses an unknown input based on a schema.

f
safeParseAsync

Parses an unknown input based on a schema.

I
SafeParser

The safe parser interface.

f
safeParser

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

I
SafeParserAsync

The safe parser async interface.

f
safeParserAsync

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

T
SafeParseResult

Safe parse result type.

T
SchemaWithFallback

Schema with fallback type.

T
SchemaWithFallbackAsync

Schema with fallback async type.

T
SchemaWithOmit

Schema with omit type.

T
SchemaWithoutPipe

Schema without pipe type.

T
SchemaWithPartial

Schema with partial type.

T
SchemaWithPartialAsync

Schema with partial type.

T
SchemaWithPick

Schema with pick type.

T
SchemaWithPipe

Schema with pipe type.

T
SchemaWithPipeAsync

Schema with pipe async type.

T
SchemaWithRequired

Schema with required type.

T
SchemaWithRequiredAsync

Schema with required type.

f
set

Creates a set schema.

f
setAsync

Creates a set schema.

f
setGlobalConfig

Sets the global configuration.

f
setGlobalMessage

Sets a global error message.

I
SetIssue

Set issue interface.

I
SetPathItem

Set path item interface.

I
f
setSchemaMessage

Sets a schema error message.

f
setSpecificMessage

Sets a specific error message.

f
size

Creates a size validation action.

T
SizeInput

Size input type.

f
slug

Creates a slug validation action.

v
SLUG_REGEX

Slug regex.

f
someItem

Creates a some item validation action.

I
SomeItemIssue

Some item issue interface.

f
sortItems

Creates a sort items transformation action.

I
SortItemsAction

Sort items action interface.

I
StandardProps

The Standard Schema properties interface.

f
startsWith

Creates a starts with validation action.

f
strictObject

Creates a strict object schema.

f
strictObjectAsync

Creates a strict object schema.

I
StrictObjectIssue

Strict object issue interface.

I
I
StrictObjectSchemaAsync

Strict object schema async interface.

f
strictTuple

Creates a strict tuple schema.

f
strictTupleAsync

Creates a strict tuple schema.

I
StrictTupleIssue

Strict tuple issue interface.

I
StrictTupleSchema

Strict tuple schema interface.

I
StrictTupleSchemaAsync

Strict tuple schema async interface.

f
string

Creates a string schema.

f
stringifyJson

Creates a stringify JSON transformation action.

I
StringifyJsonAction

Stringify JSON action interface.

I
StringifyJsonConfig

Stringify JSON config interface.

I
StringifyJsonIssue

Stringify JSON issue interface.

I
StringIssue

String issue interface.

I
StringSchema

String schema interface.

I
SuccessDataset

Success dataset interface.

f
summarize

Summarize the error messages of issues in a pretty-printable multi-line string.

f
symbol

Creates a symbol schema.

I
SymbolIssue

Symbol issue interface.

I
SymbolSchema

Symbol schema interface.

f
title

Creates a title metadata action.

I
TitleAction

Title action interface.

f
toLowerCase

Creates a to lower case transformation action.

I
ToLowerCaseAction

To lower case action interface.

f
toMaxValue

Creates a to max value transformation action.

I
ToMaxValueAction

To max value action interface.

f
toMinValue

Creates a to min value transformation action.

I
ToMinValueAction

To min value action interface.

f
toUpperCase

Creates a to upper case transformation action.

I
ToUpperCaseAction

To upper case action interface.

f
transform

Creates a custom transformation action.

I
TransformAction

Transform action interface.

I
TransformActionAsync

Transform action async interface.

f
transformAsync

Creates a custom transformation action.

f
trim

Creates a trim transformation action.

I
TrimAction

Trim action interface.

f
trimEnd

Creates a trim end transformation action.

I
TrimEndAction

Trim end action interface.

f
trimStart

Creates a trim start transformation action.

I
TrimStartAction

Trim start action interface.

f
tuple

Creates a tuple schema.

f
tupleAsync

Creates a tuple schema.

I
TupleIssue

Tuple issue interface.

T
TupleItems

Tuple items type.

T
TupleItemsAsync

Tuple items async type.

I
TupleSchemaAsync

Tuple schema async interface.

f
tupleWithRest

Creates a tuple with rest schema.

f
tupleWithRestAsync

Creates a tuple with rest schema.

I
TupleWithRestIssue

Tuple with rest issue interface.

I
I
TupleWithRestSchemaAsync

Tuple with rest schema async interface.

f
ulid

Creates an ULID validation action.

v
ULID_REGEX

ULID regex.

f
undefined

Creates an undefined schema.

f
undefined_

Creates an undefined schema.

f
undefinedable

Creates an undefinedable schema.

f
undefinedableAsync

Creates an undefinedable schema.

I
I
UndefinedableSchemaAsync

Undefinedable schema async interface.

I
UndefinedIssue

Undefined issue interface.

I
UndefinedSchema

Undefined schema interface.

f
union

Creates an union schema.

f
unionAsync

Creates an union schema.

I
UnionIssue

Union issue interface.

T
UnionOptions

Union options type.

T
UnionOptionsAsync

Union options async type.

I
UnionSchema

Union schema interface.

I
UnionSchemaAsync

Union schema async interface.

f
unknown

Creates a unknown schema.

I
UnknownDataset

Unknown dataset interface.

I
UnknownPathItem

Unknown path item interface.

I
UnknownSchema

Unknown schema interface.

f
unwrap

Unwraps the wrapped schema.

f
url

Creates an URL validation action.

f
uuid

Creates an UUID validation action.

v
UUID_REGEX

UUID regex.

c
ValiError

A Valibot error with useful information.

f
value

Creates a value validation action.

T
ValueInput

Value input type.

I
ValueIssue

Value issue interface.

f
values

Creates a values validation action.

f
variant

Creates a variant schema.

f
variantAsync

Creates a variant schema.

I
VariantIssue

Variant issue interface.

T
VariantOptions

Variant options type.

T
VariantOptionsAsync

Variant options async type.

f
void

Creates a void schema.

f
void_

Creates a void schema.

I
VoidIssue

Void issue interface.

I
VoidSchema

Void schema interface.

f
words

Creates a words validation action.

T
NanoIDAction

Nano ID action type.

T
NanoIDIssue

Nano ID issue type.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.