From b566d11d69b2d0dc59ac27c39084c4b8858bf33a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 7 Feb 2020 20:32:25 -0800 Subject: [PATCH] =?UTF-8?q?js:=20Convert=20=5F.findIndex(a,=20=E2=80=A6)?= =?UTF-8?q?=20to=20a.findIndex(=E2=80=A6).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And convert the corresponding function expressions to arrow style while we’re here. Signed-off-by: Anders Kaseorg --- frontend_tests/zjsunit/index.js | 4 +--- static/js/subs.js | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend_tests/zjsunit/index.js b/frontend_tests/zjsunit/index.js index 0d8618415b..9535b30bcd 100644 --- a/frontend_tests/zjsunit/index.js +++ b/frontend_tests/zjsunit/index.js @@ -79,9 +79,7 @@ global.read_fixture_data = (fn) => { function short_tb(tb) { const lines = tb.split('\n'); - const i = _.findIndex(lines, (line) => { - return line.includes('run_test') || line.includes('run_one_module'); - }); + const i = lines.findIndex(line => line.includes('run_test') || line.includes('run_one_module')); if (i === -1) { return tb; diff --git a/static/js/subs.js b/static/js/subs.js index 78d6447499..fdd8b8a9a3 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -104,9 +104,9 @@ exports.toggle_pin_to_top_stream = function (sub) { }; exports.maybe_update_realm_default_stream_name = function (stream_id, new_name) { - const idx = _.findIndex(page_params.realm_default_streams, function (stream) { - return stream.stream_id === stream_id; - }); + const idx = page_params.realm_default_streams.findIndex( + stream => stream.stream_id === stream_id + ); if (idx === -1) { return; }