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

x/valibot/src/schemas/map/index.ts>map

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

Creates a map schema.

Type Parameters

TMapKey extends BaseSchema
TMapValue extends BaseSchema

Parameters

key: TMapKey

The key schema.

value: TMapValue

The value schema.

optional
pipe: Pipe<MapOutput<TMapKey, TMapValue>>

A validation and transformation pipe.

Creates a map schema.

Type Parameters

TMapKey extends BaseSchema
TMapValue extends BaseSchema

Parameters

key: TMapKey

The key schema.

value: TMapValue

The value schema.

optional
error: string

The error message.

optional
pipe: Pipe<MapOutput<TMapKey, TMapValue>>

A validation and transformation pipe.