Module

x/jtd_type/mod.ts>Enum

A Novel implementation of JTD (RFC 8927) in typescript
Latest
function Enum
import { Enum } from "https://dotland.deno.dev/x/jtd_type@2.2.0/mod.ts";

Creates an enum JTD Schema

Type Parameters

E extends string
optional
O extends JtdShared = { nullable: undefined; metadata: undefined; }

Parameters

values: Narrow<E[]>

The Possible Enum values (Must be unique)

optional
opts: Narrow<O>

Options for the schema