Skip to content

fix: handle exact prereleases in subset - #946

Open
reggi wants to merge 1 commit into
mainfrom
fix/subset-prerelease
Open

reggi wants to merge 1 commit into
mainfrom
fix/subset-prerelease

Conversation

@reggi

@reggi reggi commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Check exact prerelease versions against lower and upper bounds using comparator semantics rather than isolated range prerelease gating.
  • Match exact versions against the complete superset comparator set to preserve explicit prerelease opt-in.
  • Add coverage for incorrect containment, valid containment, empty ranges, and explicit prerelease options.

For example, subset(">=1.0.0 1.2.3-alpha.1", ">=2") now correctly returns false instead of treating the first range as empty.

Validation

  • Confirmed three new cases fail before the fix and pass afterward.
  • npm test -- --no-coverage test/ranges/subset.js
  • npm run lint
  • npm exec -- template-oss-check
  • git diff --check

Check exact versions against bounds using comparator semantics and preserve the full superset comparator context when matching prereleases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 34cbaa3d-051d-453c-abb0-5d7451a48a7b
@reggi
reggi requested a review from a team as a code owner November 5, 2026 19:55
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.

2 participants