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

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

The modular and type safe schema library for validating structural data 🤖
Go to Latest
function tuple
import { tuple } from "https://deno.land/x/valibot@v0.1.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 looseTuple. To return an issue for unknown items, use strictTuple. To include and validate unknown items, use tupleWithRest.

Parameters

items: TItems

The items schema.

Returns

TupleSchema<TItems, undefined>

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 looseTuple. To return an issue for unknown items, use strictTuple. To include and validate unknown items, use tupleWithRest.

Type Parameters

TItems extends TupleItems
TMessage extends ErrorMessage<TupleIssue> | undefined

Parameters

items: TItems

The items schema.

message: TMessage

The error message.