Closed timreichen closed 1 month ago
IMO, increment()
should just have two arguments: version
and release
. Maybe an options argument at most. @kt3k?
I'm not in favor.
Without prerelease
option, the release type of premajor
, preminor
, prepatch
doesn't make sense. (You can't increment from 0.1.0
to 1.0.0-rc.1
, for example, without prerelease
option).
Oh, I see—my misunderstanding. I think we should at least put these two arguments into an optional last argument to adhere to our style guide.
Is your feature request related to a problem? Please describe.
increment()
has four arguments (two required, two optional). That is more than the style guide suggests.buildmetadata
just seem to replace the semver build property.prerelease
as a string kinda breaks the established pattern of prerelease being an(string|number)[]
array and needs to be parsed insideincrement()
. It doesn't seem very intuitive, how that argument works in combination withReturnType
and existingversion.prerelease
. This is why the majority of the jsdoc description tries to explain that.Describe the solution you'd like
buildmetadata
argument, asversion.build
can be set outside theincrement()
function.prerelease
argument, asversion.prerelease
can be set outside theincrement()
function.Describe alternatives you've considered
Leave as is.