personal web client for Bluesky
typescript solidjs bluesky atcute

refactor: decode it in one go instead

mary.my.id 7decbc73 ee041871

verified
Changed files
+3 -6
src
lib
navigation
+3 -6
src/lib/navigation/router.tsx
··· 360 360 }; 361 361 362 362 const matchRoute = (path: string): MatchedRoute | null => { 363 + path = decodeURIComponent(path); 364 + 363 365 for (let idx = 0, len = _routes!.length; idx < len; idx++) { 364 366 const route = _routes![idx]; 365 367 ··· 371 373 continue; 372 374 } 373 375 374 - const rawParams = match.groups!; 375 - const params: Record<string, string> = {}; 376 - 377 - for (const key in rawParams) { 378 - params[key] = decodeURIComponent(rawParams[key]); 379 - } 376 + const params = match.groups!; 380 377 381 378 if (validate && !validate(params)) { 382 379 continue;