Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
fix(versioning/swift): restore exact version support (renovatebot#27789)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored Mar 8, 2024
1 parent db85242 commit 09ea049
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/modules/versioning/swift/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('modules/versioning/swift/index', () => {

it.each`
version | range | expected
${'1.2.3'} | ${'1.2.3'} | ${true}
${'1.2.4'} | ${'..."1.2.4"'} | ${true}
${'v1.2.4'} | ${'..."1.2.4"'} | ${true}
${'1.2.4'} | ${'..."1.2.3"'} | ${false}
Expand Down
4 changes: 4 additions & 0 deletions lib/modules/versioning/swift/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function isLessThanRange(version: string, range: string): boolean {
}

function matches(version: string, range: string): boolean {
// Check if both are an exact version
if (valid(range) && version === range) {
return true;
}
const semverRange = toSemverRange(range);
return semverRange ? satisfies(version, semverRange) : false;
}
Expand Down

0 comments on commit 09ea049

Please sign in to comment.