mmjs-core
Version:
mmjs-core hooks component vue
2 lines (1 loc) • 524 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(t){if(!t)return t;if(!window){const i="http://localhost";return/^((https|http)?:)/i.test(t)?t:t.startsWith("/")?i+t:i+"/"+t}if(/^(https?:)?\/\//i.test(t))return t.replace(/^(https?:)?\/\//i,(i,o)=>o?i:window.location.protocol+"//");if(t.startsWith("/"))return window.location.origin+t;const n=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1);return window.location.origin+n+t}exports.normalizeURL=e;