// Loaded from https://raw.githubusercontent.com/colinhacks/zod/654680afc2ede388e71e09104eac5a0088fe3207/deno/lib/types/nativeEnum.ts import { ZodTypes } from "../ZodTypes.ts"; import { ZodType, ZodTypeDef } from "./base.ts"; export interface ZodNativeEnumDef extends ZodTypeDef { t: ZodTypes.nativeEnum; values: T; } type EnumLike = { [k: string]: string | number; [nu: number]: string }; export class ZodNativeEnum extends ZodType< T[keyof T], ZodNativeEnumDef > { toJSON = () => this._def; static create = (values: T): ZodNativeEnum => { return new ZodNativeEnum({ t: ZodTypes.nativeEnum, values: values, }); }; }