Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/valibot/mod.ts>variantAsync

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
function variantAsync
Re-export
import { variantAsync } from "https://deno.land/x/valibot@v0.35.0/mod.ts";

Creates a variant schema.

Type Parameters

TKey extends string
TOptions extends VariantOptionsAsync<TKey>

Parameters

key: TKey

The discriminator key.

options: TOptions

The variant options.

Returns

A variant schema.

Creates a variant schema.

Type Parameters

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

Parameters

key: TKey

The discriminator key.

options: TOptions

The variant options.

message: TMessage

The error message.