Skip to content

Commit

Permalink
refactor: Rearrange const in the lookupUpdates function (#32974)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov authored Dec 8, 2024
1 parent 1d3b857 commit 283a7dc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/workers/repository/process/lookup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export async function lookupUpdates(
config.versioning ??= getDefaultVersioning(config.datasource);

const versioningApi = allVersioning.get(config.versioning);
const unconstrainedValue =
!!config.lockedVersion && is.undefined(config.currentValue);

let dependency: ReleaseResult | null = null;
const res: UpdateResult = {
Expand Down Expand Up @@ -124,10 +122,14 @@ export async function lookupUpdates(
);
}
}

const isValid =
is.string(compareValue) && versioningApi.isValid(compareValue);

if (unconstrainedValue || isValid) {
const unconstrainedValue =
!!config.lockedVersion && is.undefined(config.currentValue);

if (isValid || unconstrainedValue) {
if (
!config.updatePinnedDependencies &&
// TODO #22198
Expand Down Expand Up @@ -752,7 +754,6 @@ export async function lookupUpdates(
rollbackPrs: config.rollbackPrs,
isVulnerabilityAlert: config.isVulnerabilityAlert,
updatePinnedDependencies: config.updatePinnedDependencies,
unconstrainedValue,
err,
},
'lookupUpdates error',
Expand Down

0 comments on commit 283a7dc

Please sign in to comment.