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

x/valibot/src/utils/entriesFromList/index.ts>entriesFromList

The modular and type safe schema library for validating structural data 🤖
Latest
function entriesFromList
import { entriesFromList } from "https://deno.land/x/valibot@v1.0.0-beta.1-i18n/src/utils/entriesFromList/index.ts";

Creates an object entries definition from a list of keys and a schema.

Type Parameters

TList extends readonly (string | number | symbol)[]
TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>

Parameters

list: TList

A list of keys.

schema: TSchema

The schema of the keys.

Returns

Record<TList[number], TSchema>

The object entries.