Skip to content

Commit c2421b4

Browse files
committed
chore: don't do dumb things
Use existing methods where available
1 parent e102832 commit c2421b4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/base/leaderboard/goto.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ function load({ page, user } = {}) {
2424
}
2525

2626
function getData() {
27-
const o = {};
28-
const d = decodeURIComponent;
29-
location.search.substring(1).replace(/([^=&]+)=([^&]*)/g, (m, k, v) => {
30-
o[d(k)] = d(v);
31-
});
32-
return o;
27+
const params = new URLSearchParams(location.search);
28+
return Object.fromEntries(params.entries());
3329
}
3430

3531
function userLast() {

0 commit comments

Comments
 (0)