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

x/valibot/src/index.ts>safeParserAsync

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

Returns a function that parses an unknown input based on a schema.

Type Parameters

TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>

Parameters

schema: TSchema

The schema to be used.

Returns

The parser function.

Returns a function that parses an unknown input based on a schema.

Type Parameters

TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>
TConfig extends Config<InferIssue<TSchema>> | undefined

Parameters

schema: TSchema

The schema to be used.

config: TConfig

The parser configuration.

Returns

The parser function.