UNPKG

molstar

Version:

A comprehensive macromolecular library.

21 lines (20 loc) 792 B
"use strict"; /** * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.urlCombine = exports.urlQueryParameter = void 0; function urlQueryParameter(id) { if (typeof window === 'undefined') return undefined; var a = new RegExp("".concat(id, "=([^&#=]*)")); var m = a.exec(window.location.search); return m ? decodeURIComponent(m[1]) : undefined; } exports.urlQueryParameter = urlQueryParameter; function urlCombine(base, query) { return "".concat(base).concat(base[base.length - 1] === '/' || query[0] === '/' ? '' : '/').concat(query); } exports.urlCombine = urlCombine;