refactor: use literals instead of new RegExp() where possible (#38458)

This commit is contained in:
Milan Burda 2023-05-30 10:53:11 +02:00 committed by GitHub
parent 0203bd3305
commit a6f7c7690d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -182,8 +182,7 @@ async function prepareAppVeyorImage (opts) {
if (ROLLER_BRANCH_PATTERN.test(branch)) {
useAppVeyorImage(branch, { ...opts, version: DEFAULT_BUILD_IMAGE, cloudId: DEFAULT_BUILD_CLOUD_ID });
} else {
// eslint-disable-next-line no-control-regex
const versionRegex = new RegExp('chromium_version\':\n +\'(.+?)\',', 'm');
const versionRegex = /chromium_version':\n +'(.+?)',/m;
const deps = fs.readFileSync(path.resolve(__dirname, '..', 'DEPS'), 'utf8');
const [, CHROMIUM_VERSION] = versionRegex.exec(deps);