mirror of https://github.com/zulip/zulip.git
js: Convert _.findIndex(a, …) to a.findIndex(…).
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:
parent
336a279005
commit
b566d11d69
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue