tcm-ts.txt / code
tcm . core . semver
Types
Parsed
Shared
VERSION
bumpVersion
compareVersions
compatRange
isExactVersion
meetsComparator
parse
partial
satisfies
tcmts.core.semver
Types
Parsed type
Shared
VERSION RegExp
bumpVersion (version: string, level: "major" | "minor" | "patch") => string The next version at a level: `1.2.3` → `2.0.0` (major), `1.3.0` (minor), `1.2.4` (patch).
compareVersions (a: string, b: string) => number Order versions: negative when `a` comes first. Prereleases come before their release.
compatRange (version: string) => string The range of versions semver says are compatible with `version`, as npm writes it: the major (`4` for 4.17.21), the minor below 1.0 (`0.3` for 0.3.7, `0.0.4` for 0.0.4), and the exact version for a prerelease or anything that isn't semver, which promise nothing. Applied to a range it returns the range.
isExactVersion (v: string) => boolean Whether `v` is an exact version (`2.1.3`, `3.0.0-rc.1`) rather than a range (`2`, `0.3`).
meetsComparator (version: string, comparator: string) => boolean
parse (v: string) => Parsed | undefined
partial (spec: string) => [string, string | undefined] | undefined `1.x`, `1.2`, `*` as the bounds they mean: [lowest allowed, first not allowed).
satisfies (version: string, range: string) => boolean Whether `version` is in npm range `range` (`^1.2.0`, `~1.2`, `>=2 <3`, `1.x`, `1 - 2`, `a || b`, `*`).