UNPKG

express-zod-api

Version:

A Typescript framework to help you get an API server up and running with I/O schema validation and custom middlewares in minutes.

1 lines 553 B
import{F as e,U as t}from"./routing-walker-DjzH37jF.js";import*as n from"ramda";const r=e=>t(e)&&`or`in e,i=e=>t(e)&&`and`in e,a=e=>!i(e)&&!r(e),o=t=>{let o=n.filter(a,t),s=n.chain(n.prop(`and`),n.filter(i,t)),[c,l]=n.partition(a,s),u=n.concat(o,c),d=n.filter(r,t);return n.map(n.prop(`or`),n.concat(d,l)).reduce((t,r)=>e(t,n.map(e=>a(e)?[e]:e.and,r),([e,t])=>n.concat(e,t)),n.reject(n.isEmpty,[u]))},s=(e,t)=>i(e)?n.chain(e=>s(e,t),e.and):r(e)?n.chain(e=>s(e,t),e.or):e.type===t?[e.name]:[],c=(e,t)=>new Set(n.chain(e=>s(e,t),e));export{o as n,c as t};