Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Parsing and comparing of semantic versions (SemVer)
Functions
Returns true if the string can be parsed as SemVer.
Compare two SemVers.
Returns difference between two SemVers by the release type,
or undefined if the SemVers are the same.
Returns true if both SemVers are equivalent.
Format a SemVer object into a string.
Formats the SemVerrange into a string.
Greater than or equal to comparison for two SemVers.
Greater than comparison for two SemVers.
Check if the SemVer is greater than the range.
Returns the new SemVer resulting from an increment by release type.
Does a deep check on the object to determine if its a valid range.
Checks to see if value is a valid SemVer object. It does a check into each field including prerelease and build.
Less than or equal to comparison for two SemVers.
Less than comparison for two SemVers.
Check if the SemVer is less than the range.
Returns the highest SemVer in the list that satisfies the range, or undefined
if none of them do.
Returns the lowest SemVer in the list that satisfies the range, or undefined if
none of them do.
Not equal comparison for two SemVers.
Attempt to parse a string as a semantic version, returning a SemVer object.
Parses a range string into a Range object.
The ranges intersect every range of AND comparators intersects with a least one range of OR ranges.
Test to see if the SemVer satisfies the range.
Returns the parsed SemVer, or undefined if it's not valid.
Parses the given range string and returns a Range object. If the range string
is invalid, undefined is returned.
Interfaces
Options for increment.
- build: string
The build metadata of the new version.
- prerelease: string
The pre-release of the new version.
Type Aliases
SemVer comparison operators.
A type representing a semantic version range. The ranges consist of a nested array, which represents a set of OR comparisons while the inner array represents AND comparisons.
| "major"
| "premajor"
| "minor"
| "preminor"
| "patch"
| "prepatch"
| "prerelease"
The possible release types are used as an operator for the increment function and as a result of the difference function.
Add Package
deno add jsr:@std/semver
Import symbol
import * as mod from "@std/semver";
Import directly with a jsr specifier
import * as mod from "jsr:@std/semver";