UNPKG

url-env

Version:
21 lines (20 loc) 441 B
function t(o, r = typeof window < "u" ? window.location.href : "") { const n = o.find( (e) => r.startsWith(e[0]) ); if (!n) throw new Error("No matching environment found."); return { pair: n, url: n[0], env: n[1] }; } function i(o, r = typeof window < "u" ? window.location.href : "") { return t(Object.entries(o), r); } export { t as fromArray, i as fromObject }; //# sourceMappingURL=url-env.es.js.map