Skip to main content
Module

x/valibot/mod.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/mod.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.