eslint: Fix unicorn/no-reduce.

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/no-reduce.md

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-10-07 03:18:05 -07:00
committed by Tim Abbott
parent 24d4ab327c
commit e68595a3fc
2 changed files with 9 additions and 7 deletions

View File

@@ -594,12 +594,11 @@ exports.register_topic_handlers = function () {
$("#topic_stream_edit_form_error").show();
}
const params = $("#move_topic_form")
.serializeArray()
.reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
const params = Object.fromEntries(
$("#move_topic_form")
.serializeArray()
.map(({name, value}) => [name, value]),
);
const {old_topic_name, select_stream_id} = params;
let {