UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

27 lines 862 B
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { unrecognized } from "./unrecognized.js"; export function inboundSchema(enumObj) { const options = Object.values(enumObj); return z.union([ ...options.map(x => z.literal(x)), z.string().transform(x => unrecognized(x)), ]); } export function inboundSchemaInt(enumObj) { // For numeric enums, Object.values returns both numbers and string keys const options = Object.values(enumObj).filter(v => typeof v === "number"); return z.union([ ...options.map(x => z.literal(x)), z.number().int().transform(x => unrecognized(x)), ]); } export function outboundSchema(_) { return z.string(); } export function outboundSchemaInt(_) { return z.number().int(); } //# sourceMappingURL=enums.js.map