Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #904
outside() was taking the comparators with the highest and lowest versions as the edges of each set, which breaks when a set has more than one bound on the same side, like
>1.0.0 >=2.0.0 <3.0.0where it used>1.0.0as the lower edge.Now it picks the edges by operator instead, the tightest
>/>=bound on one side and the tightest</<=on the other, and when two bounds are at the same version it takes the exclusive one. Doing it this way also shows when a set cant match anything, like>=2.0.0 <1.0.0, so a set like that is skipped instead of deciding the result for the whole range. That fixesgtr('3.0.0', '>=2.0.0 <1.0.0 || 1.x')which returned false. If every set is like that it still returns false like before.Prerelease handling is the same as before,
gtr('0.7.2-beta', '0.7.x')is still true.i checked it against a brute force answer on about 97k random version/range pairs without prereleases, 7.8.5 got 13k of them wrong and this gets none. Added fixtures for both directions, the
>/>=tie, and sets that cant match anything. Tests pass with coverage still at 100% and lint is clean.