mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +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
@@ -75,7 +75,7 @@ function query_matches_string(query, source_str, split_char) {
|
||||
// account, there might be 2 attrs: their full name and their email.
|
||||
// * split_char is the separator for this syntax (e.g. ' ').
|
||||
exports.query_matches_source_attrs = (query, source, match_attrs, split_char) => {
|
||||
return _.any(match_attrs, function (attr) {
|
||||
return match_attrs.some(attr => {
|
||||
const source_str = source[attr].toLowerCase();
|
||||
return query_matches_string(query, source_str, split_char);
|
||||
});
|
||||
@@ -151,9 +151,7 @@ exports.sort_emojis = function (objs, query) {
|
||||
|
||||
function decent_match(name) {
|
||||
const pieces = name.toLowerCase().split('_');
|
||||
return _.any(pieces, (piece) => {
|
||||
return piece.startsWith(lowerQuery);
|
||||
});
|
||||
return pieces.some(piece => piece.startsWith(lowerQuery));
|
||||
}
|
||||
|
||||
const popular_set = new Set(exports.popular_emojis);
|
||||
|
||||
Reference in New Issue
Block a user