js: Convert _.map on jQuery collections to Array.from.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-02-07 17:24:21 -08:00 committed by Tim Abbott
parent 7b0dea0351
commit 2f314a0854
2 changed files with 5 additions and 8 deletions

View File

@ -887,7 +887,7 @@ exports.warn_if_mentioning_unsubscribed_user = function (mentioned) {
const error_area = $("#compose_invite_users");
const existing_invites_area = $('#compose_invite_users .compose_invite_user');
const existing_invites = _.map($(existing_invites_area), function (user_row) {
const existing_invites = Array.from($(existing_invites_area), user_row => {
return $(user_row).data('useremail');
});

View File

@ -169,13 +169,10 @@ function update_announce_stream_state() {
}
function get_principals() {
return _.map(
$("#stream_creation_form input:checkbox[name=user]:checked"),
function (elem) {
const label = $(elem).closest('.add-user-label');
return parseInt(label.attr('data-user-id'), 10);
}
);
return Array.from($("#stream_creation_form input:checkbox[name=user]:checked"), elem => {
const label = $(elem).closest(".add-user-label");
return parseInt(label.attr("data-user-id"), 10);
});
}
function create_stream() {