next Patch
Increments the version by its PATCH number. When the version is pre-release, the PATCH number will not be incremented, only the pre-release identifier will be removed.
When the preRelease parameter is set, a pre-release version will be produced from the next PATCH version. The value of preRelease will be the first pre-release identifier of the new version.
Returns a new version while the original remains unchanged.
Samples
import io.github.z4kn4fein.semver.Inc
import io.github.z4kn4fein.semver.LooseVersionSerializer
import io.github.z4kn4fein.semver.Version
import io.github.z4kn4fein.semver.VersionSerializer
import io.github.z4kn4fein.semver.constraints.toConstraint
import io.github.z4kn4fein.semver.inc
import io.github.z4kn4fein.semver.nextMajor
import io.github.z4kn4fein.semver.nextMinor
import io.github.z4kn4fein.semver.nextPatch
import io.github.z4kn4fein.semver.nextPreRelease
import io.github.z4kn4fein.semver.satisfies
import io.github.z4kn4fein.semver.satisfiesAll
import io.github.z4kn4fein.semver.satisfiesAny
import io.github.z4kn4fein.semver.toVersion
import io.github.z4kn4fein.semver.toVersionOrNull
import io.github.z4kn4fein.semver.withoutSuffixes
import kotlinx.serialization.json.Json
fun main() {
//sampleStart
val version = "1.0.0-alpha.1".toVersion()
println(version.nextPatch())
println(version.nextPatch(preRelease = ""))
println(version.nextPatch(preRelease = "alpha"))
println(version.nextPatch(preRelease = "SNAPSHOT"))
//sampleEnd
}