Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Differentiate on metadata, addresses #56
In prior behavior, this library would say that versions
1.0+abc
and1.0+def
are equal, which can be an issue when checking which version should be used, such as in hashicorp/terraform#20814An open question here is if this library means to say that
1.0+abc
and1.0+def
are equivalent -- I am inclined to say not, but I am interested in prior decisions/data on this.This PR repurposes
comparePrereleases
to check metadata (not just pre-release), and since that function does its own equality check, removes some of the pre-comparisons that were made (ex. checking if prerelease was "" before calling this compare).comparePrereleases
and what it calls,comparePart
, do the work of comparing strings for 1/0/-1.Open to discussion on what user expected behavior is here!