export function readRoute()

in frontend/src/route.js [4:26]


export function readRoute() {
  // Reads all filters from current URL hash
  const hash = window.location.hash.substring(1);
  const pairs = hash.split("&");
  const out = {};
  pairs.forEach((pair) => {
    const [key, value] = pair.split("=");
    if (!key) {
      return;
    }
    out[decodeURIComponent(key)] = decodeURIComponent(value);
  });

  // Default values
  if (!out.revision) {
    out.revision = REV_LATEST;
  }
  if (!out.path) {
    out.path = "";
  }

  return out;
}