Skip to content

Commit

Permalink
Merge pull request #1303 from aeternity/feature/fix-semver-check
Browse files Browse the repository at this point in the history
fix(semverSatisfies): ignore build number
  • Loading branch information
mradkov authored Oct 19, 2021
2 parents e155025 + c3cce0a commit 3121885
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/semver-satisfies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function (version: string, geVersion: string, ltVersion: string): boolean {
const getComponents = (v: string): number[] => v
.split('-')[0].split('.').map(i => +i)
.split(/[-+]/)[0].split('.').map(i => +i)

const versionComponents = getComponents(version)
const geComponents = getComponents(geVersion)
Expand Down
2 changes: 2 additions & 0 deletions test/unit/semver-satisfies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ describe('semverSatisfies', () => {
expect(semverSatisfies('1.9.0', '2.0.0', '3.0.0')).to.equal(false)
expect(semverSatisfies('1.9.0', '2.0.0', '3.0.0')).to.equal(false)
expect(semverSatisfies('5.0.0', '3.0.0', '5.0.0')).to.equal(false)
expect(semverSatisfies('6.0.0-rc4', '6.0.0', '7.0.0')).to.equal(true)
expect(semverSatisfies('6.3.0+2.0f7ce80e', '6.0.0', '7.0.0')).to.equal(true)
})
})

0 comments on commit 3121885

Please sign in to comment.