zafarkhaja / jsemver

Java implementation of the SemVer Specification
MIT License
429 stars 82 forks source link

wrong evaluation of expression #42

Closed RuedigerMoeller closed 1 year ago

RuedigerMoeller commented 6 years ago

boolean satisfies = Version.valueOf("15.6.1").satisfies(">=0.14.0 & <=15"); should return true http://jubianchi.github.io/semver-check/

loganvolkers commented 5 years ago

Try this library, it seems to be more full featured and might help you: https://github.com/vdurmont/semver4j

zafarkhaja commented 1 year ago

Hello @RuedigerMoeller! Sorry it took me this long to get back to you.

This is the intended behavior.

As per jsemver, partial versions, both as part of an expression or standalone, are just a shorthand for versions whose minor and/or patch versions are 0. So 15 in the expression above is translated to 15.0.0.

This may differ from other libraries, such as node-semver, which, I'm guessing, is the one that's being used by that application.

Hope this clears it up.