@jjdenhertog/plex-music-search
Version:
Library to find tracks in your Plex Library
10 lines (9 loc) • 400 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = getAPIUrl;
function getAPIUrl(uri, path) {
var url = new URL(uri);
if (!(url === null || url === void 0 ? void 0 : url.port))
throw new Error("The link to the Plex seems invalid. The port number might be missing");
return "".concat(url.protocol, "//").concat(url.host).concat(path);
}