eslint: Fix unicorn/no-array-callback-reference.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-01-22 17:36:54 -08:00
committed by Tim Abbott
parent 552f4e3d22
commit 6cd694b8e3
29 changed files with 89 additions and 93 deletions

View File

@@ -35,14 +35,17 @@ exports.get_filtered_items = (value, list, opts) => {
if (!opts.filter) {
if (get_item) {
return list.map(get_item);
return list.map((key) => get_item(key));
}
return [...list];
}
if (opts.filter.filterer) {
if (get_item) {
return opts.filter.filterer(list.map(get_item), value);
return opts.filter.filterer(
list.map((key) => get_item(key)),
value,
);
}
return opts.filter.filterer(list, value);
}
@@ -62,7 +65,7 @@ exports.get_filtered_items = (value, list, opts) => {
return result;
}
return list.filter(predicate);
return list.filter((item) => predicate(item));
};
exports.alphabetic_sort = (prop) =>