export function escape_url_params(url: string): string { return url .split("/") .map((e) => (e.startsWith(":") ? `[${e.slice(1)}]` : e)) .filter((e) => e != "") .join("/"); } export function unescape_url_params(url: string): string { return url .split("/") .map((e) => (e.startsWith("[") ? `:${e.slice(1, e.length - 1)}` : e)) .join("/"); }