UNPKG

@prostory/mountain

Version:

Yet another HTTP/2 server and client.

3 lines (2 loc) 484 B
import{constants as t}from"http2";const H=H=>{var T,r;return new URL((null!==(T=H.origin)&&void 0!==T?T:H[t.HTTP2_HEADER_SCHEME]+"://"+(null!==(r=H[t.HTTP2_HEADER_AUTHORITY])&&void 0!==r?r:H[t.HTTP2_HEADER_HOST]))+H[t.HTTP2_HEADER_PATH])},T=t=>(t=>t.startsWith("/")?t:"/"+t)((t=>t.endsWith("/")?t.slice(0,t.length-1):t)(t)),r=t=>{let H=t.startsWith("^")?t:`^${t}`;return H.endsWith("$")?H:`${H}$`};export{r as addBounds,H as createUrl,T as normalize}; //# sourceMappingURL=url.js.map