Repository navigation
fix(semver): handle major wildcards in <= and bounded wildcards in greater/lessThanRange - #7394
Open
helmipradita wants to merge 1 commit into
Open
helmipradita wants to merge 1 commit into
helmipradita wants to merge 1 commit into
Conversation
…eater/lessThanRange Refs denoland#7385
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7394 +/- ##
==========================================
- Coverage 95.04% 95.03% -0.02%
==========================================
Files 619 618 -1
Lines 52012 51762 -250
Branches 9450 9403 -47
==========================================
- Hits 49434 49190 -244
+ Misses 2031 2022 -9
- Partials 547 550 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Refs #7385
Description
In
@std/semver:semver/parse_range.ts,handleLessThanOrEqualOperatorwas missing amajorIsWildcardcheck (unlikehandleGreaterOrEqualOperatorand other handlers). As a result, parsing<=*,<=x, or<=Xcomputedmajor + 1onNaN, returning<NaN.0.0which caused subsequent comparisons likesatisfies()to fail withSyntaxError: Cannot compare against non-numbers. This addsif (majorIsWildcard) return [ALL];.semver/greater_than_range.tsandsemver/less_than_range.ts,comparatorSet.some(isWildcardComparator)caused both functions to immediately returnfalsewhenever any wildcard was present in a comparator set, even if another comparator explicitly bounded the set (e.g.greaterThanRange("2.0.3", "* <1.2.1")andlessThanRange("0.2.1", "* >2.1.0")). This filters wildcards out of the boundary check and returnsfalseonly if the set is purely wildcards.