Skip to content

Commit a30ed2b

Browse files
committed
dashboard: remove our intoObject and use Object.fromEntries
1 parent 86e4009 commit a30ed2b

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

dashboard/assets/scripts/dashboard.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,23 +122,12 @@ function regExpEscape(s) {
122122
return escaped;
123123
}
124124

125-
/**
126-
* [[1, 2], [3, 4]] -> {1: 2, 3: 4}
127-
*/
128-
function intoObject(arr) {
129-
const obj = {};
130-
arr.forEach((e) => {
131-
obj[e[0]] = e[1];
132-
});
133-
return obj;
134-
}
135-
136125
function getQueryArgs() {
137126
const pairs = location.search.replace("?", "").split("&");
138127
if (pairs === "") {
139128
return {};
140129
}
141-
return intoObject(pairs.map((e) => split(e, "=", 1)));
130+
return Object.fromEntries(pairs.map((e) => split(e, "=", 1)));
142131
}
143132

144133
function addAnyChangeListener(elem, func) {

0 commit comments

Comments
 (0)