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

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

The modular and type safe schema library for validating structural data 🤖
Go to Latest
function map
import { map } from "https://deno.land/x/valibot@v0.8.0/src/schemas/map/map.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.