Skip to content

Commit

Permalink
fix(versioning/swift): restore exact version support (#27789)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed 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
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
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.