mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user