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

x/valibot/src/methods/index.ts>getDefaultsAsync

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

Returns the default values of the schema.

The difference to getDefaultAsync is that for objects and tuples without an explicit default value, this function recursively returns the default values of the subschemas instead of undefined.

Parameters

schema: TSchema

The schema to get the default values from.

Returns

The default values.