UNPKG

url-env

Version:
3 lines (2 loc) 435 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,e=typeof window<"u"?window.location.href:""){const n=r.find(t=>e.startsWith(t[0]));if(!n)throw new Error("No matching environment found.");return{pair:n,url:n[0],env:n[1]}}function i(r,e=typeof window<"u"?window.location.href:""){return o(Object.entries(r),e)}exports.fromArray=o;exports.fromObject=i; //# sourceMappingURL=url-env.cjs.js.map