Skip to content

Commit

Permalink
feat: add "release" inc type
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Dec 11, 2024
1 parent f9db45b commit 15e504b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/semver.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ class SemVer {
inc (release, identifier, identifierBase) {
const inferredIdentifier = identifier || this.prerelease[0] || undefined
switch (release) {
case 'release':
if (this.prerelease.length === 0) {
throw new Error(`version ${this.raw} is not a prerelease`)
}
this.prerelease.length = 0
break
case 'premajor':
if (this.minor || this.patch || this.prerelease.length === 0) {
this.prerelease.length = 0
Expand Down

0 comments on commit 15e504b

Please sign in to comment.