refactor(docs-infra): give more descriptive variable name (#34284)

Discussion:
https://github.com/angular/angular/pull/34213#discussion_r353249119

PR Close #34284
This commit is contained in:
George Kalpakas 2019-12-03 22:14:48 +02:00 committed by Andrew Kushnir
parent 8683c0335b
commit 2ecf9f3f2a
1 changed files with 5 additions and 6 deletions

View File

@ -286,13 +286,12 @@ class NgPackagesInstaller {
* @param {import('@yarnpkg/lockfile').LockFileObject} projectLockfile - The projects's parsed `yarn.lock`.
*/
_overwritePackageVersion(packageName, packageConfig, projectConfig, projectLockfile) {
const originalVersionRange = (projectConfig.dependencies || {})[packageName] ||
(projectConfig.devDependencies || {})[packageName];
const originalVersion =
(projectLockfile[`${packageName}@${originalVersionRange}`] || {}).version;
const projectVersionRange = (projectConfig.dependencies || {})[packageName] ||
(projectConfig.devDependencies || {})[packageName];
const projectVersion = (projectLockfile[`${packageName}@${projectVersionRange}`] || {}).version;
if (originalVersion !== undefined) {
const newVersion = `${originalVersion}+locally-overwritten-by-ngPackagesInstaller`;
if (projectVersion !== undefined) {
const newVersion = `${projectVersion}+locally-overwritten-by-ngPackagesInstaller`;
this._log(`Overwriting the version of '${packageName}': ${packageConfig.version} --> ${newVersion}`);
packageConfig.version = newVersion;
}