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

x/valibot/src/schemas/variant/index.ts>VariantSchema

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Go to Latest
interface VariantSchema
implements BaseSchema<Input<TOptions[number]>, TOutput>
import { type VariantSchema } from "https://deno.land/x/valibot@v0.30.0/src/schemas/variant/index.ts";

Variant schema type.

Type Parameters

TKey extends string
TOptions extends VariantOptions<TKey>
optional
TOutput = Output<TOptions[number]>

Properties

type: "variant"

The schema type.

key: TKey

The discriminator key.

options: TOptions

The variant options.

message: ErrorMessage | undefined

The error message.

pipe: Pipe<Output<TOptions[number]>> | undefined

The validation and transformation pipeline.