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

x/valibot/src/index.ts>keyof

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

Creates a enum schema of object keys.

Type Parameters

TSchema extends ObjectSchema<any, any> | ObjectSchemaAsync<any, any>

Parameters

schema: TSchema

The object schema.

Returns

PicklistSchema<TupleOrNever<UnionToTuple<keyof TSchema["entries"]>>>

A enum schema.