js: Convert _.find(a, …) to a.find(…).

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:
Anders Kaseorg
2020-02-07 20:31:13 -08:00
committed by Tim Abbott
parent cdd774b790
commit 336a279005
9 changed files with 16 additions and 30 deletions

View File

@@ -90,9 +90,7 @@ exports.update_message = function (submsg) {
message.submessages = [];
}
const existing = _.find(message.submessages, function (sm) {
return sm.id === submsg.id;
});
const existing = message.submessages.find(sm => sm.id === submsg.id);
if (existing !== undefined) {
blueslip.warn("Got submessage multiple times: " + submsg.id);