Skip to content

Commit

Permalink
refactor: pass versioning to getCurrentVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Feb 18, 2021
1 parent 54d82d2 commit 22b4fad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/workers/repository/process/lookup/current.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { LookupUpdateConfig } from './common';

export function getCurrentVersion(
config: LookupUpdateConfig,
versioning: allVersioning.VersioningApi,
rangeStrategy: string,
latestVersion: string,
allVersions: string[]
): string | null {
const { currentValue, lockedVersion } = config;
const versioning = allVersioning.get(config.versioning);
if (versioning.isVersion(currentValue)) {
return currentValue;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/workers/repository/process/lookup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ export async function lookupUpdates(
const currentVersion =
getCurrentVersion(
config,
versioning,
rangeStrategy,
latestVersion,
nonDeprecatedVersions
) ||
getCurrentVersion(
config,
versioning,
rangeStrategy,
latestVersion,
allVersions.map((v) => v.version)
Expand Down

0 comments on commit 22b4fad

Please sign in to comment.