Skip to content

docs: clarify prerelease precedence in comparisons - #947

Open
Doomguy-BFG9000 wants to merge 1 commit into
npm:mainfrom
Doomguy-BFG9000:docs/prerelease-comparison-options
Open

Doomguy-BFG9000 wants to merge 1 commit into
npm:mainfrom
Doomguy-BFG9000:docs/prerelease-comparison-options

Conversation

@Doomguy-BFG9000

Copy link
Copy Markdown

The comparison documentation did not explicitly say whether includePrerelease: false discards prerelease identifiers. This led to the expectation in #483 that lt('0.2.0-1', '0.2.0', { includePrerelease: false }) should return false.

Explain that comparisons use full SemVer precedence regardless of this option, show the reported example, and direct readers to range-matching functions for controlling prerelease admission. This documents existing behavior.

Refs #483.

Validation on Windows with Node.js 25.2.1:

  • npm test -- --jobs=2 passes, including coverage, ESLint and template-oss-check.
  • Eight public API assertions verify lt, compare and eq with both option values, plus the range-matching distinction.
  • git diff --check passes.

@Doomguy-BFG9000
Doomguy-BFG9000 requested a review from a team as a code owner November 6, 2026 05:42
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