Construct a Version from specific components.
If you wish to parse a string into a Version then please use [[fromSemver]].
The major version component.
The minor version component.
The patch version component.
A list of pre-release identifiers, if any
A list of build identifiers, if any
Static
fromConstruct a version from a semver 2 compliant string.
This function is intended for use with semver 2 compliant strings. Malformed strings may still parse correctly, but this result is not guaranteed.
A semver 2.0.0 compliant version string
A version object
Returns true if a given version is compatible with this one.
Compatibility is defined as having the same nonzero major version number, or if both major versions are zero, the same nonzero minor version number, or if both minor versions are zero, the same nonzero patch version number.
This implements the ^ operator in npm's semver package, with the exception of the prerelease exclusion rule.
The other version to test against
True if compatible
Returns true if this version has precedence over (is newer than) another version.
Precedence is defined as in the Semver 2 spec. This implements the > operator in npm's semver package, with the exception of the prerelease exclusion rule.
The other version to test against
True if this version has precedence over the other one
Tests if a given version is equivalent to this one.
Build and prerelease tags are ignored.
The other version to test against
True if the given version is equivalent
Tests if a given version is stable or a compatible prerelease for this version.
This implements the prerelease exclusion rule of NPM semver: a prerelease version can only pass this check if the major/minor/patch components of both versions are the same. Otherwise, the prerelease version always fails.
The other version to test against
True if the given version is either stable, or a prerelease in the same series as this one.
A representation of a semver 2 compliant version string