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

x/valibot/src/schemas/tuple/index.ts>tupleAsync

The modular and type safe schema library for validating structural data 🤖
Go to Latest
function tupleAsync
import { tupleAsync } from "https://deno.land/x/valibot@v0.2.0-to-json-schema/src/schemas/tuple/index.ts";

Creates a tuple schema.

Hint: This schema removes unknown items. The output will only include the items you specify. To include unknown items, use looseTupleAsync. To return an issue for unknown items, use strictTupleAsync. To include and validate unknown items, use tupleWithRestAsync.

Parameters

items: TItems

The items schema.

Returns

A tuple schema.

Creates a tuple schema.

Hint: This schema removes unknown items. The output will only include the items you specify. To include unknown items, use looseTupleAsync. To return an issue for unknown items, use strictTupleAsync. To include and validate unknown items, use tupleWithRestAsync.

Type Parameters

TItems extends TupleItemsAsync
TMessage extends ErrorMessage<TupleIssue> | undefined

Parameters

items: TItems

The items schema.

message: TMessage

The error message.