node-semver
node-semver copied to clipboard
[BUG] Inconsistent behaviour of caret versions with includePrerelease
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
The behaviour of satisfies when using a caret range with includePrerease: true seems to depend on whether a major version number is present:
> semver.satisfies('0.0.3-alpha', '^0.0.3', {includePrerelease: true})
true
> semver.satisfies('0.2.3-alpha', '^0.2.3', {includePrerelease: true})
true
> semver.satisfies('1.2.3-alpha', '^1.2.3', {includePrerelease: true})
false
Expected Behavior
I'd expect the above calls to all return false, for consistency with the reasoning in #409
Steps To Reproduce
No response
Environment
- semver: 7.5.0
- npm: 8.5.1
- Node: 12.22.9
- OS: Ubuntu 22.04.2