From ad605423b39ca16538be9a17a0509c891a9ac771 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Fri, 5 Oct 2018 13:48:32 +0200 Subject: [PATCH] refactor: newValue => toVersions --- lib/workers/repository/updates/generate.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/workers/repository/updates/generate.js b/lib/workers/repository/updates/generate.js index 92b9150ddf..af10baaf9d 100644 --- a/lib/workers/repository/updates/generate.js +++ b/lib/workers/repository/updates/generate.js @@ -13,22 +13,22 @@ function generateBranchConfig(branchUpgrades) { logger.debug(`hasGroupName: ${hasGroupName}`); // Use group settings only if multiple upgrades or lazy grouping is disabled const depNames = []; - const newValue = []; + const toVersions = []; branchUpgrades.forEach(upg => { if (!depNames.includes(upg.depName)) { depNames.push(upg.depName); } - if (!newValue.includes(upg.toVersion)) { - newValue.push(upg.toVersion); + if (!toVersions.includes(upg.toVersion)) { + toVersions.push(upg.toVersion); } }); const groupEligible = depNames.length > 1 || - newValue.length > 1 || + toVersions.length > 1 || branchUpgrades[0].lazyGrouping === false; if (branchUpgrades.length > 1 && !groupEligible) { // eslint-disable-next-line no-param-reassign - branchUpgrades[0].commitMessageExtra = `to v${newValue[0]}`; + branchUpgrades[0].commitMessageExtra = `to v${toVersions[0]}`; } logger.debug(`groupEligible: ${groupEligible}`); const useGroupSettings = hasGroupName && groupEligible; @@ -56,11 +56,11 @@ function generateBranchConfig(branchUpgrades) { (branchUpgrades[1].depName.startsWith('@types/') && branchUpgrades[1].depName.endsWith(branchUpgrades[0].depName))); // istanbul ignore else - if (newValue.length > 1 && !isTypesGroup) { - logger.debug({ newValue }); + if (toVersions.length > 1 && !isTypesGroup) { + logger.debug({ toVersions }); delete upgrade.commitMessageExtra; upgrade.recreateClosed = true; - } else if (semver.valid(newValue[0])) { + } else if (semver.valid(toVersions[0])) { upgrade.isRange = false; } // Use templates to generate strings -- GitLab