mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 21:48:30 +00:00
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:
committed by
Tim Abbott
parent
24d4ab327c
commit
e68595a3fc
@@ -405,7 +405,10 @@ function compute_summary_chart_data(time_series_data, num_steps, labels_) {
|
|||||||
values[labels.length - 1] += sum;
|
values[labels.length - 1] += sum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const total = values.reduce((a, b) => a + b, 0);
|
let total = 0;
|
||||||
|
for (const value of values) {
|
||||||
|
total += value;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
values,
|
values,
|
||||||
labels,
|
labels,
|
||||||
|
|||||||
@@ -594,12 +594,11 @@ exports.register_topic_handlers = function () {
|
|||||||
$("#topic_stream_edit_form_error").show();
|
$("#topic_stream_edit_form_error").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
const params = $("#move_topic_form")
|
const params = Object.fromEntries(
|
||||||
|
$("#move_topic_form")
|
||||||
.serializeArray()
|
.serializeArray()
|
||||||
.reduce((obj, item) => {
|
.map(({name, value}) => [name, value]),
|
||||||
obj[item.name] = item.value;
|
);
|
||||||
return obj;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
const {old_topic_name, select_stream_id} = params;
|
const {old_topic_name, select_stream_id} = params;
|
||||||
let {
|
let {
|
||||||
|
|||||||
Reference in New Issue
Block a user