UNPKG

itty-router

Version:

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

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