-
Notifications
You must be signed in to change notification settings - Fork 543
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
A version range like >1.x.x+build
is valid, but >1.x+build
and >1+build
are not. The same can be observed when using a prerelease version instead of build metadata.
Expected Behavior
While the behavior is consistent with the BNF grammar in the readme, it is inconsistent with the expectation built up by every other aspect of the package that X-ranges and partial versions are equivalent. I expect that build metadata and prerelease would either be allowed with all versions, even partial ones, or not allowed with X-ranges.
Personally, I think build metadata should always be allowed as it is stripped off and ignored. However, I think prerelease should not be allowed with any partial or X-ranges because it isn't clear what one should even take that to mean. What versions should be matched by 2.x.x-rc
? (I am actually going to file a separate bug about that.)
Steps To Reproduce
As I am not a Node developer but rather a maintainer of a semver package for C# that needs to support npm style version ranges, I am using https://semver.npmjs.com/ to test. Simply put the listed versions into it.