Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comparisons do not consider build. #276

Closed
coreyfarrell opened this issue Apr 30, 2019 · 4 comments · Fixed by #277
Closed

comparisons do not consider build. #276

coreyfarrell opened this issue Apr 30, 2019 · 4 comments · Fixed by #277

Comments

@coreyfarrell
Copy link
Contributor

semver.gt('1.0.0+2', '1.0.0+1') returns false, I think this should return true. Similar issues occur with other comparisons, semver.eq says these are equal.

@isaacs
Copy link
Contributor

isaacs commented Apr 30, 2019

According to item 10 on the spec at https://semver.org, this behavior is required.

@isaacs isaacs closed this as completed Apr 30, 2019
@coreyfarrell
Copy link
Contributor Author

coreyfarrell commented May 1, 2019

Would you accept a semver.compareBuild function returning -1, 0 or 1 so build can be easily compared without breaking the spec?

Edit: This proposed function would use semver.compare first, only perform build comparison if the semver spec says the versions are equal.

@isaacs
Copy link
Contributor

isaacs commented May 1, 2019 via email

@coreyfarrell
Copy link
Contributor Author

What do you think the correct order of 1.0.0 and 1.0.0+0 should be? I think this is a difference from the prerelease sorting logic so I would put 1.0.0 before (less than) 1.0.0+0.

coreyfarrell added a commit to coreyfarrell/node-semver that referenced this issue May 2, 2019
stabbylambda pushed a commit to stabbylambda/node-semver that referenced this issue Nov 18, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants