Skip to content

Commit 283a7dc

Browse files
authored
refactor: Rearrange const in the lookupUpdates function (#32974)
1 parent 1d3b857 commit 283a7dc

File tree

1 file changed

+5
-4
lines changed
  • lib/workers/repository/process/lookup

1 file changed

+5
-4
lines changed

lib/workers/repository/process/lookup/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ export async function lookupUpdates(
5959
config.versioning ??= getDefaultVersioning(config.datasource);
6060

6161
const versioningApi = allVersioning.get(config.versioning);
62-
const unconstrainedValue =
63-
!!config.lockedVersion && is.undefined(config.currentValue);
6462

6563
let dependency: ReleaseResult | null = null;
6664
const res: UpdateResult = {
@@ -124,10 +122,14 @@ export async function lookupUpdates(
124122
);
125123
}
126124
}
125+
127126
const isValid =
128127
is.string(compareValue) && versioningApi.isValid(compareValue);
129128

130-
if (unconstrainedValue || isValid) {
129+
const unconstrainedValue =
130+
!!config.lockedVersion && is.undefined(config.currentValue);
131+
132+
if (isValid || unconstrainedValue) {
131133
if (
132134
!config.updatePinnedDependencies &&
133135
// TODO #22198
@@ -752,7 +754,6 @@ export async function lookupUpdates(
752754
rollbackPrs: config.rollbackPrs,
753755
isVulnerabilityAlert: config.isVulnerabilityAlert,
754756
updatePinnedDependencies: config.updatePinnedDependencies,
755-
unconstrainedValue,
756757
err,
757758
},
758759
'lookupUpdates error',

0 commit comments

Comments
 (0)