Skip to content

Commit

Permalink
fix: use reduce instead of Object.fromEntries to support old brow…
Browse files Browse the repository at this point in the history
…sers (#437)
  • Loading branch information
BPScott committed Jun 20, 2023
1 parent 8a11766 commit 095aa45
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ var options = {
ansiColors: {},
};
if (__resourceQuery) {
var overrides = Object.fromEntries(
new URLSearchParams(__resourceQuery.slice(1))
);
var params = Array.from(new URLSearchParams(__resourceQuery.slice(1)));
var overrides = params.reduce(function (memo, param) {
memo[param[0]] = param[1];
return memo;
}, {});

setOverrides(overrides);
}

Expand Down

0 comments on commit 095aa45

Please sign in to comment.