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 🤖
Go to Latest
interface VariantSchema
implements BaseSchema<InferInput<TOptions[number]>, InferOutput<TOptions[number]>, VariantIssue | InferVariantIssue<TOptions>>
import { type VariantSchema } from "https://deno.land/x/valibot@v1.0.0-beta.4/src/schemas/variant/index.ts";

Variant schema type.

Type Parameters

TKey extends string
TOptions extends VariantOptions<TKey>
TMessage extends ErrorMessage<VariantIssue> | undefined

Properties

readonly
type: "variant"

The schema type.

readonly
reference: variant

The schema reference.

readonly
expects: "Object"

The expected property.

readonly
key: TKey

The discriminator key.

readonly
options: TOptions

The variant options.

readonly
message: TMessage

The error message.