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

x/valibot/src/schemas/optional/index.ts>OptionalSchemaAsync

The modular and type safe schema library for validating structural data 🤖
Go to Latest
type alias OptionalSchemaAsync
import { type OptionalSchemaAsync } from "https://deno.land/x/valibot@v0.24.0/src/schemas/optional/index.ts";

Optional schema async type.

Type Parameters

TWrapped extends BaseSchema | BaseSchemaAsync
optional
TDefault extends Input<TWrapped> | (() => Input<TWrapped> | Promise<Input<TWrapped> | undefined> | undefined) | undefined = undefined
optional
TOutput = Awaited<TDefault> extends Input<TWrapped> ? Output<TWrapped> : Output<TWrapped> | undefined
definition: BaseSchemaAsync<Input<TWrapped> | undefined, TOutput> & { type: "optional"; wrapped: TWrapped; default: TDefault; }