mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: replace .indexOf() with .includes() (#39195)
This commit is contained in:
@@ -117,7 +117,7 @@ async function createRelease (branchToTarget, isBeta) {
|
||||
name: `electron ${newVersion}`,
|
||||
body: releaseBody,
|
||||
prerelease: releaseIsPrelease,
|
||||
target_commitish: newVersion.indexOf('nightly') !== -1 ? 'main' : branchToTarget
|
||||
target_commitish: newVersion.includes('nightly') ? 'main' : branchToTarget
|
||||
}).catch(err => {
|
||||
console.log(`${fail} Error creating new release: `, err);
|
||||
process.exit(1);
|
||||
|
||||
@@ -50,7 +50,7 @@ async function getDraftRelease (version, skipValidation) {
|
||||
if (!skipValidation) {
|
||||
failureCount = 0;
|
||||
check(drafts.length === 1, 'one draft exists', true);
|
||||
if (versionToCheck.indexOf('beta') > -1) {
|
||||
if (versionToCheck.includes('beta')) {
|
||||
check(draft.prerelease, 'draft is a prerelease');
|
||||
}
|
||||
check(draft.body.length > 50 && !draft.body.includes('(placeholder)'), 'draft has release notes');
|
||||
|
||||
Reference in New Issue
Block a user