Skip to content

Commit

Permalink
refactor: getCurrentVersion params
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Nov 23, 2021
1 parent 3898230 commit ff87759
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/workers/repository/process/lookup/current.ts
Expand Up @@ -2,16 +2,15 @@ import is from '@sindresorhus/is';
import { logger } from '../../../../logger';
import { regEx } from '../../../../util/regex';
import type { VersioningApi } from '../../../../versioning/types';
import type { LookupUpdateConfig } from './types';

export function getCurrentVersion(
config: LookupUpdateConfig,
currentValue: string,
lockedVersion: string,
versioning: VersioningApi,
rangeStrategy: string,
latestVersion: string,
allVersions: string[]
): string | null {
const { currentValue, lockedVersion } = config;
// istanbul ignore if
if (!is.string(currentValue)) {
return null;
Expand Down
6 changes: 4 additions & 2 deletions lib/workers/repository/process/lookup/index.ts
Expand Up @@ -170,14 +170,16 @@ export async function lookupUpdates(
.map((release) => release.version);
const currentVersion =
getCurrentVersion(
config,
currentValue,
lockedVersion,
versioning,
rangeStrategy,
latestVersion,
nonDeprecatedVersions
) ||
getCurrentVersion(
config,
currentValue,
lockedVersion,
versioning,
rangeStrategy,
latestVersion,
Expand Down

0 comments on commit ff87759

Please sign in to comment.