You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Worth calling out that the following is right when the version is actually valid 1.2.0, Requirement.buildNPM("1.2").isSatisfiedBy(new Semver("1.2.0", Semver.SemverType.NPM)); // true
but since the constructor of Semver can take 1.2 and Semver.SemverType.NPM, which produces the inconsistency.
And since isEquivalentTo is a public method - it might also be potentially wrong, depending on how do we treat the "1.2" and mode "NPM".
Thanks,
Ethan
The text was updated successfully, but these errors were encountered:
leaf94
changed the title
Inconsistent Semver and Requirement for NPM mode
Inconsistent isSatisfiedBy for NPM mode and potential incorrect isEquivalentTo for NPM mode
Sep 1, 2020
Worth calling out that the following is right when the version is actually valid
1.2.0
,Requirement.buildNPM("1.2").isSatisfiedBy(new Semver("1.2.0", Semver.SemverType.NPM)); // true
but since the constructor of Semver can take
1.2
andSemver.SemverType.NPM
, which produces the inconsistency.The real issue is the second one above as marked in the comment. Did a little debugging with source code, and seems that it failed at the final equality check,
at here: https://github.com/vdurmont/semver4j/blob/master/src/main/java/com/vdurmont/semver4j/Semver.java#L330.
And since
isEquivalentTo
is a public method - it might also be potentially wrong, depending on how do we treat the "1.2" and mode "NPM".Thanks,
Ethan
The text was updated successfully, but these errors were encountered: