increment
Increments a semantic version
Available since v1.9.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
version | string | The version to increment |
type | "major" | "minor" | "patch" | The increment type (‘major’, ‘minor’, ‘patch’) |
Returns
Section titled “Returns”string — Incremented version string
Examples
Section titled “Examples”Increment the patch version
Section titled “Increment the patch version”Bumps the patch number while keeping major and minor.
Increment the minor version
Section titled “Increment the minor version”Bumps the minor number and resets patch to 0.
Preserve the v prefix
Section titled “Preserve the v prefix”The v prefix is preserved if present in the input.
