workery
Version:
Modern web framework for building APIs on Cloudflare Workers.
2 lines (1 loc) • 766 B
JavaScript
import{z as n}from"zod";function e(n){try{return n instanceof Array?n.map((n=>JSON.parse(n))):JSON.parse(n)}catch(e){return n}}function r(e){return e instanceof n.ZodNumber||e instanceof n.ZodBoolean||e instanceof n.ZodArray&&r(e._def.type)||e instanceof n.ZodOptional&&r(e._def.innerType)||e instanceof n.ZodDefault&&r(e._def.innerType)||e instanceof n.ZodNativeEnum&&!!Object.values(e._def.values).find((n=>String(n)!==n))}function t(){let n;const e=new Promise((e=>n=e));return[n,n=>{e.then(n)}]}function o(n,e){return console.error(e),new Response("Internal Server Error",{status:500})}function a(n){return e=>({...n,...e})}class i{}export{i as Of,o as baseExceptionHandler,a as createObjectPartial,t as createResolveLater,r as isJsonCoercible,e as jsonCoerce};