dx: leave "/" unencoded in query strings, for readability

Massimo Melina committed Jan 18, 2025 at 15:06 UTC 22e5793afd63f2008f524a113fd19e2b694e63f4
1 file changed +1 -1
shared/index.ts
+1 -1
@@ -51,7 +51,7 @@ function getScriptAttr(k: string) {
51 }
52
53 export function buildUrlQueryString(params: Dict) { // not using URLSearchParams.toString as it doesn't work on firefox50
54 - return '?' + Object.entries(params).filter(pair => pair[1] !== undefined).map(pair => pair.map(encodeURIComponent).join('=') ).join('&')
54 + return '?' + Object.entries(params).filter(pair => pair[1] !== undefined).map(pair => pair.map(x => encodeURIComponent(x).replaceAll('%2F','/')).join('=') ).join('&')
55 }
56
57 export function domOn<K extends keyof WindowEventMap>(eventName: K, cb: (ev: WindowEventMap[K]) => void, { target=window }={}) {