mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
js: Convert _.any(a, …), _.some(a, …) to a.some(…).
And convert the corresponding function expressions to arrow style while we’re here. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
2285ee922e
commit
70ff164f89
@@ -362,19 +362,19 @@ Filter.prototype = {
|
||||
},
|
||||
|
||||
has_negated_operand: function (operator, operand) {
|
||||
return _.any(this._operators, function (elem) {
|
||||
return elem.negated && (elem.operator === operator && elem.operand === operand);
|
||||
});
|
||||
return this._operators.some(
|
||||
elem => elem.negated && (elem.operator === operator && elem.operand === operand)
|
||||
);
|
||||
},
|
||||
|
||||
has_operand: function (operator, operand) {
|
||||
return _.any(this._operators, function (elem) {
|
||||
return !elem.negated && (elem.operator === operator && elem.operand === operand);
|
||||
});
|
||||
return this._operators.some(
|
||||
elem => !elem.negated && (elem.operator === operator && elem.operand === operand)
|
||||
);
|
||||
},
|
||||
|
||||
has_operator: function (operator) {
|
||||
return _.any(this._operators, function (elem) {
|
||||
return this._operators.some(elem => {
|
||||
if (elem.negated && !['search', 'has'].includes(elem.operator)) {
|
||||
return false;
|
||||
}
|
||||
@@ -474,7 +474,7 @@ Filter.prototype = {
|
||||
return Filter.term_type(term) === 'pm-with';
|
||||
};
|
||||
|
||||
if (!_.any(terms, is_pm_with)) {
|
||||
if (!terms.some(is_pm_with)) {
|
||||
return terms;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user