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

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

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

Creates a record schema.

Type Parameters

TValue extends BaseSchema

Parameters

value: TValue

The value schema.

optional
pipe: Pipe<RecordOutput<StringSchema, TValue>>

A validation and transformation pipe.

Returns

RecordSchema<StringSchema, TValue>

A record schema.

Creates a record schema.

Type Parameters

TValue extends BaseSchema

Parameters

value: TValue

The value schema.

optional
message: ErrorMessage

The error message.

optional
pipe: Pipe<RecordOutput<StringSchema, TValue>>

A validation and transformation pipe.

Returns

RecordSchema<StringSchema, TValue>

A record schema.

Creates a record schema.

Type Parameters

TKey extends RecordKey
TValue extends BaseSchema

Parameters

key: TKey

The key schema.

value: TValue

The value schema.

optional
pipe: Pipe<RecordOutput<TKey, TValue>>

A validation and transformation pipe.

Returns

RecordSchema<TKey, TValue>

A record schema.

Creates a record schema.

Type Parameters

TKey extends RecordKey
TValue extends BaseSchema

Parameters

key: TKey

The key schema.

value: TValue

The value schema.

optional
message: ErrorMessage

The error message.

optional
pipe: Pipe<RecordOutput<TKey, TValue>>

A validation and transformation pipe.

Returns

RecordSchema<TKey, TValue>

A record schema.