UNPKG

514 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.getURL = void 0;
4function getURL(base, url) {
5 if (!(base === null || base === void 0 ? void 0 : base.startsWith('http://')) && !(base === null || base === void 0 ? void 0 : base.startsWith('https://'))) {
6 base = 'http://' + base;
7 }
8 try {
9 return new URL(url, base).href;
10 }
11 catch (e) {
12 console.debug(e);
13 return '';
14 }
15}
16exports.getURL = getURL;
17//# sourceMappingURL=url.js.map
\No newline at end of file