-
Notifications
You must be signed in to change notification settings - Fork 517
Closed
Labels
Bugthing that needs fixingthing that needs fixing
Description
What / Why
Given an identifier I want to increment a prerelease version.
Current Behavior
Given an 'invalid' identifier, inc()
will produce an invalid semver
.
Steps to Reproduce
const identifier = 'hotfix/410';
const incremented = inc(parse('0.0.1'), 'prerelease', identifier);
console.log(!!valid(incremented));
// => false
Expected Behavior
The documentation of inc()
specifies this:
Return the version incremented by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if it's not valid
In the case above inc()
is not returning null, even though the resulting version is not a valid semver.
Either the documentation needs to be changed to 'or null if the ReleaseType is not valid' or inc()
needs to check the validity of the semver
before returning it.
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixing