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

x/valibot/mod.ts>entriesFromList

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
function entriesFromList
import { entriesFromList } from "https://deno.land/x/valibot@v1.0.0-beta.2-to-json-schema/mod.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.