Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/tools/release/deps.ts>semver.increment

A modern runtime for JavaScript and TypeScript.
Latest
function semver.increment
import { semver } from "https://deno.land/x/deno@v1.41.0/tools/release/deps.ts";
const { increment } = semver;

Returns the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid.

premajor in one call will bump the version up to the next major version and down to a prerelease of that major version. preminor, and prepatch work the same way.

If called from a non-prerelease version, the prerelease will work the same as prepatch. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it.

If the original version has build metadata and the metadata parameter is undefined, then it will be unchanged.

Parameters

version: string | SemVer
release: ReleaseType
optional
options: Options
optional
identifier: string
optional
metadata: string

Returns

string | null