Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

eslint: Fix unicorn/class-reference-in-static-methods.

Anders Kaseorga0dbfd686ea2
diff --git a/web/src/filter.ts b/web/src/filter.ts
index a9bbc6d8c71..e04758c6001 100644
--- a/web/src/filter.ts
+++ b/web/src/filter.ts
@@ -493,7 +493,7 @@ export class Filter {
negated = true;
operator = operator.slice(1);
}
- operand = Filter.decodeOperand(parts.join(":"), operator);
+ operand = this.decodeOperand(parts.join(":"), operator);
// Resolve a user-entered channel name to its id. A purely
// numeric operand is taken to be a stream id already.
@@ -634,12 +634,12 @@ export class Filter {
};
}
- potential_narrow_term = Filter.canonicalize_term(potential_narrow_term);
+ potential_narrow_term = this.canonicalize_term(potential_narrow_term);
} catch {
return undefined;
}
- if (!Filter.is_valid_canonical_term(potential_narrow_term)) {
+ if (!this.is_valid_canonical_term(potential_narrow_term)) {
return undefined;
}
@@ -729,7 +729,7 @@ export class Filter {
return term.operand;
}
const operator = filter_util.canonicalize_operator(term.operator);
- const operand = is_operator_suggestion ? "" : Filter.encodeOperand(term.operand);
+ const operand = is_operator_suggestion ? "" : this.encodeOperand(term.operand);
return sign + operator + ":" + operand;
});
return term_strings.join(" ");
@@ -944,7 +944,7 @@ export class Filter {
content: this.describe_channels_operator(term.negated ?? false, term.operand),
};
}
- const prefix_for_operator = Filter.operator_to_prefix(term.operator, term.negated);
+ const prefix_for_operator = this.operator_to_prefix(term.operator, term.negated);
if (prefix_for_operator !== "") {
if (term.operator === "channel") {
const stream = stream_data.get_sub_by_id_string(term.operand);
@@ -1010,7 +1010,7 @@ export class Filter {
is_operator_suggestion: boolean,
): string {
return render_search_description({
- parts: Filter.parts_for_describe(terms, is_operator_suggestion),
+ parts: this.parts_for_describe(terms, is_operator_suggestion),
});
}
@@ -1065,17 +1065,14 @@ export class Filter {
const adjusted_terms = [];
let terms_changed = false;
- const adjusted_narrow_containing_with = Filter.ensure_channel_topic_terms(
- raw_terms,
- message,
- );
+ const adjusted_narrow_containing_with = this.ensure_channel_topic_terms(raw_terms, message);
if (adjusted_narrow_containing_with !== undefined) {
return adjusted_narrow_containing_with;
}
for (const term of raw_terms) {
- const adjusted_term = Filter.canonicalize_term(term);
+ const adjusted_term = this.canonicalize_term(term);
if (
adjusted_term.operator === "channel" &&
term.operand !== message.stream_id.toString()