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

x/valibot/mod.ts>OptionalSchema

The modular and type safe schema library for validating structural data 🤖
Go to Latest
type alias OptionalSchema
Re-export
import { type OptionalSchema } from "https://deno.land/x/valibot@v0.24.0/mod.ts";

Optional schema type.

Type Parameters

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