Skip to main content
Module

x/valibot/mod.ts>fallback

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Go to Latest
function fallback
import { fallback } from "https://deno.land/x/valibot@v0.13.1/mod.ts";

Returns a fallback value when validating the passed schema failed.

Type Parameters

TSchema extends BaseSchema

Parameters

schema: TSchema

The schema to catch.

value: Output<TSchema> | ((info: FallbackInfo) => Output<TSchema>)

The fallback value.

Returns

The passed schema.