UNPKG

itty-router

Version:

A tiny, zero-dependency router, designed to make beautiful APIs in any environment.

2 lines (1 loc) 260 B
const t=((t="text/plain; charset=utf-8",e)=>(n,s={})=>{if(void 0===n||n instanceof Response)return n;const o=new Response(e?.(n)??n,s.url?void 0:s);return o.headers.set("content-type",t),o})("application/json; charset=utf-8",JSON.stringify);export{t as json};