fix: align caret includePrerelease lower bounds by wayyoungboy · Pull Request #872 · npm/node-semver (original) (raw)

Summary

Root Cause

For exact 0.x caret ranges without an explicit prerelease, replaceCaret appended -0 to the lower bound when includePrerelease was enabled. That turned ^0.0.3 into >=0.0.3-0 <0.0.4-0, allowing 0.0.3-alpha while exact 1.x caret ranges kept >=1.2.3 and rejected 1.2.3-alpha.

Test Plan

Fixes #557