Skip to content

fix: preserve ranges with no matching versions when simplifying - #902

Open
jakezwang wants to merge 1 commit into
npm:mainfrom
jakezwang:fix-simplify-empty-match
Open

jakezwang wants to merge 1 commit into
npm:mainfrom
jakezwang:fix-simplify-empty-match

Conversation

@jakezwang

Copy link
Copy Markdown

When none of the supplied versions match, simplifyRange returns an empty string, which matches every stable version:

semver.simplifyRange(['1.0.0', '1.1.0'], '^2.0.0') // ''
semver.satisfies('1.0.0', '')                       // true

Preserve the original range when the matching set is empty. Regression tests cover string ranges, Range objects, and the null range <0.0.0-0.

Validation: npm test passes, including 100% coverage, ESLint, and template-oss-check.

References

The simplifyRange contract requires matching the same versions from the supplied list.

@jakezwang
jakezwang requested a review from a team as a code owner September 18, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant