eslint: Fix unicorn/prefer-set-has.

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-set-has.md

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-10-07 01:45:28 -07:00
committed by Tim Abbott
parent de791b82b6
commit b178fc6069
5 changed files with 17 additions and 17 deletions

View File

@@ -130,8 +130,8 @@ function get_messages_success(data, opts) {
// or convert the emails string to user IDs directly into the Filter code
// because doing so breaks the app in various modules that expect emails string.
function handle_operators_supporting_id_based_api(data) {
const operators_supporting_ids = ["pm-with"];
const operators_supporting_id = ["sender", "group-pm-with", "stream"];
const operators_supporting_ids = new Set(["pm-with"]);
const operators_supporting_id = new Set(["sender", "group-pm-with", "stream"]);
if (data.narrow === undefined) {
return data;
@@ -139,11 +139,11 @@ function handle_operators_supporting_id_based_api(data) {
data.narrow = JSON.parse(data.narrow);
data.narrow = data.narrow.map((filter) => {
if (operators_supporting_ids.includes(filter.operator)) {
if (operators_supporting_ids.has(filter.operator)) {
filter.operand = people.emails_strings_to_user_ids_array(filter.operand);
}
if (operators_supporting_id.includes(filter.operator)) {
if (operators_supporting_id.has(filter.operator)) {
if (filter.operator === "stream") {
const stream_id = stream_data.get_stream_id(filter.operand);
if (stream_id !== undefined) {