molstar
Version:
A comprehensive macromolecular library.
16 lines (15 loc) • 587 B
JavaScript
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
export 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;
}
export function urlCombine(base, query) {
return "".concat(base).concat(base[base.length - 1] === '/' || query[0] === '/' ? '' : '/').concat(query);
}