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

x/valibot/mod.ts>transformAsync

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

Adds an async transformation step to a schema, which is executed at the end of parsing and can change the output type.

Type Parameters

TSchema extends BaseSchema | BaseSchemaAsync
TOutput

Parameters

schema: TSchema

The schema to be used.

action: (input: Output<TSchema>, info: TransformInfo) => TOutput | Promise<TOutput>

The transformation action.

optional
pipe: PipeAsync<TOutput>

A validation pipe.

Returns

SchemaWithTransformAsync<TSchema, TOutput>

A transformed schema.

Adds an async transformation step to a schema, which is executed at the end of parsing and can change the output type.

Type Parameters

TSchema extends BaseSchema | BaseSchemaAsync
TOutput

Parameters

schema: TSchema

The schema to be used.

action: (input: Output<TSchema>, info: TransformInfo) => TOutput | Promise<TOutput>

The transformation action.

optional
validation: BaseSchema<TOutput> | BaseSchemaAsync<TOutput>

A validation schema.

Returns

SchemaWithTransformAsync<TSchema, TOutput>

A transformed schema.