Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/valibot/src/methods/fallback/fallback.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.0/src/methods/fallback/fallback.ts";

Returns a fallback value when validating the passed schema failed.

Parameters

schema: TSchema

The schema to catch.

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

The fallback value.

Returns

The passed schema.