From 88b2f89877e7193a5c40efa2482ba1b1bad6016b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 4 Aug 2026 20:38:43 +0300 Subject: [PATCH] indexof --- src/components/conversation/conversation.js | 2 +- src/modules/users.js | 6 +++--- src/services/file_type/file_type.service.js | 2 +- src/services/theme_data/css_utils.js | 2 +- test/e2e/runner.js | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 16a22caab..73aaa2358 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -309,7 +309,7 @@ const conversation = { (k) => this.getReplies(cur.id) .map((v) => v.id) - .indexOf(k.id) === -1, + .includes(k.id), ), this.conversation, ) diff --git a/src/modules/users.js b/src/modules/users.js index 8764efa96..0988b45c5 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -269,7 +269,7 @@ export const mutations = { state.currentUser.blockIds = blockIds }, addBlockId(state, blockId) { - if (state.currentUser.blockIds.indexOf(blockId) === -1) { + if (state.currentUser.blockIds.includes(blockId)) { state.currentUser.blockIds.push(blockId) } }, @@ -283,7 +283,7 @@ export const mutations = { state.currentUser.muteIdsMaxId = muteIdsMaxId }, addMuteId(state, muteId) { - if (state.currentUser.muteIds.indexOf(muteId) === -1) { + if (state.currentUser.muteIds.includes(muteId)) { state.currentUser.muteIds.push(muteId) } }, @@ -291,7 +291,7 @@ export const mutations = { state.currentUser.domainMutes = domainMutes }, addDomainMute(state, domain) { - if (state.currentUser.domainMutes.indexOf(domain) === -1) { + if (state.currentUser.domainMutes.includes(domain)) { state.currentUser.domainMutes.push(domain) } }, diff --git a/src/services/file_type/file_type.service.js b/src/services/file_type/file_type.service.js index 02f659eec..b6179cd81 100644 --- a/src/services/file_type/file_type.service.js +++ b/src/services/file_type/file_type.service.js @@ -43,7 +43,7 @@ export const fileTypeExt = (url) => { } export const fileMatchesSomeType = (types, file) => - types.some((type) => fileType(file.mimetype) === type) + types.includes(fileType(file.mimetype)) const fileTypeService = { fileType, diff --git a/src/services/theme_data/css_utils.js b/src/services/theme_data/css_utils.js index 990db652c..b728f68d2 100644 --- a/src/services/theme_data/css_utils.js +++ b/src/services/theme_data/css_utils.js @@ -165,7 +165,7 @@ export const getCssRules = (rules, debug) => header, directives, rule.component === 'Text' && - rule.state.indexOf('faint') < 0 && + !rule.state.includes('faint') && rule.directives.textNoCssColor !== 'yes' ? ' color: var(--text);' : '', diff --git a/test/e2e/runner.js b/test/e2e/runner.js index 33fcc322c..06cae7813 100644 --- a/test/e2e/runner.js +++ b/test/e2e/runner.js @@ -10,10 +10,10 @@ const server = require('../../build/dev-server.js') // For more information on Nightwatch's config file, see // http://nightwatchjs.org/guide#settings-file let opts = process.argv.slice(2) -if (opts.indexOf('--config') === -1) { +if (!opts.includes('--config')) { opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) } -if (opts.indexOf('--env') === -1) { +if (!opts.includes('--env')) { opts = opts.concat(['--env', 'chrome']) }