Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When creating a new instance of the SemVer
class form a version string with a build, the build segment is included in the raw field.
Expected Behavior
The build segment should either be or not be part of the raw field, but not a mix of both.
Steps To Reproduce
Copy and run the following example code which should log true
but instead logs false
.
const { SemVer } = require("semver");
const freshInstance = new SemVer("1.0.0-rc.2+build.4");
const modifiedInstance = new SemVer("1.0.0-rc.1+build.4");
modifiedInstance.inc("prerelease", "rc");
console.log(freshInstance.raw === modifiedInstance.raw);
Environment
- yarn: 3.5.0
- Node: v16.19.1
- OS: Pop!Os 22.04
- semver: 7.5.1