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

x/valibot/mod.ts>OptionalSchemaAsync

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Go to Latest
interface OptionalSchemaAsync
implements BaseSchemaAsync<Input<TWrapped> | undefined, TOutput>
Re-export
import { type OptionalSchemaAsync } from "https://deno.land/x/valibot@v0.30.0/mod.ts";

Optional schema async type.

Type Parameters

TWrapped extends BaseSchema | BaseSchemaAsync
optional
TDefault extends DefaultAsync<TWrapped> = undefined
optional
TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped> | Promise<Input<TWrapped>>) ? Output<TWrapped> : Output<TWrapped> | undefined

Properties

type: "optional"

The schema type.

wrapped: TWrapped

The wrapped schema.

default: TDefault

Returns the default value.