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

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

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

Coerces the input of a scheme to match the required type.

Parameters

schema: TSchema

The affected scheme.

action: (value: unknown) => Input<TSchema>

The coerceation action.

Returns

The passed schema.