Skip to content

Commit

Permalink
Don't use Object.fromEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
moroshko committed Aug 3, 2020
1 parent 11e9876 commit f5640cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/processors.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ const processorsMap = new fdir()

fs.writeFileSync(
path.resolve(__dirname, "../src/processors/processors.json"),
JSON.stringify(processorsMap, null, 2)
JSON.stringify(processorsMap, null, 2) + "\n"
);
5 changes: 4 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ function sortObjectKeysByValue(obj, mapValue = (value) => value) {
: 1;
});

return Object.fromEntries(entries);
return entries.reduce((acc, [key, value]) => {
acc[key] = value;
return acc;
}, {});
}

module.exports = {
Expand Down

0 comments on commit f5640cd

Please sign in to comment.