Skip to main content
Module

x/valibot/mod.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.13.1/mod.ts";

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

Type Parameters

TSchema extends BaseSchema

Parameters

schema: TSchema

The affected schema.

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

The coerceation action.

Returns

The passed schema.