Skip to main content
Module

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

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