egon-orm-workspace / egon-orm / EnumMapping
Type Alias: EnumMapping ​
ts
type EnumMapping =
| Readonly<Record<string, string>>
| Readonly<Record<string, number>>;Defined in: core/src/types/composite.ts:265
The mapping of t.enum({ ... }): each key is a value in TypeScript, each value what is stored. The stored values are all strings or all whole numbers.
Example ​
ts
import { type EnumMapping, t } from "egon-orm";
const levels = { low: 1, high: 2 } as const satisfies EnumMapping;
const level = t.enum(levels); // "low" | "high"
