Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function init (initialUrl) {
const vurl = virtualUrl(initialUrl || window.location.href);
window.onpopstate = () => {
let url = window.location.href;
if(window.location.href.indexOf('#') > -1) {
url = window.location.hash.substr(1);
}
Router.navigate(url, true, true);
};
if (!RoutePattern.fromString(routes.home.pattern).matches(vurl.pathname)) {
Router.navigate(vurl.original, false, false, true, true);
} else {
setUrl(vurl.original, true);
routes.home.handler(vurl.searchObject);
}
}
function init (initialUrl) {
const vurl = virtualUrl(initialUrl || window.location.href);
window.onpopstate = () => {
let url = window.location.href;
if(window.location.href.indexOf('#') > -1) {
url = window.location.hash.substr(1);
}
Router.navigate(url, true, true);
};
if (!RoutePattern.fromString(routes.home.pattern).matches(vurl.pathname)) {
Router.navigate(vurl.original, false, false, true, true);
} else {
setUrl(vurl.original, true);
routes.home.handler(vurl.searchObject);
}
}