import { z } from "zod"; export function zodEnumFromObjectKeys< TI extends Record, R extends string = TI extends Record ? R : never >(input: TI): z.ZodEnum<[R, ...R[]]> { const [firstKey, ...otherKeys] = Object.keys(input) as [R, ...R[]]; return z.enum([firstKey, ...otherKeys]); }