chore: Use .includes and .startsWith, not .indexOf (#7936)

Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
This commit is contained in:
Neil Fraser
2024-03-15 00:03:55 +01:00
committed by GitHub
parent 81e2203f7f
commit 0ecbcde9fc
42 changed files with 62 additions and 64 deletions

View File

@@ -131,7 +131,7 @@ function updateBetaVersion(done) {
const latestBetaVersion = execSync('npm show blockly version --tag beta').toString().trim();
while (!isValid) {
newVersion = readlineSync.question(`What is the new beta version? (latest beta version: ${latestBetaVersion})`);
const existsOnNpm = blocklyVersions.indexOf(newVersion) > -1;
const existsOnNpm = blocklyVersions.includes(newVersion);
const isFormatted = newVersion.search(re) > -1;
if (!existsOnNpm && isFormatted) {
isValid = true;