Validate, compare, sort, parse, and serialize Semantic Versioning (SemVer)
2.0.0 version strings, using XQuery.
SemVer rules are applied strictly, raising errors when version strings do
not conform to the spec.
version | 2.1.0 |
author | Joe Wicentowski |
Coerce a non-SemVer version string into SemVer version string and parse it as such
$version? | $version? |
Compare two versions (strictly)
$v1 | $v1 |
$v2 | $v2 |
Compare two versions (with an option to coerce invalid SemVer strings)
$v1 | $v1 |
$v2 | $v2 |
$coerce | $coerce |
Test if v1 is equal to v2
$v1 | $v1 |
$v2 | $v2 |
Test if v1 is the same or higher version than v2 (strictly)
$v1 | $v1 |
$v2 | $v2 |
Test if v1 is the same or higher version than v2
$v1 | $v1 |
$v2 | $v2 |
$coerce | $coerce |
Test if v1 is a higher version than v2 (strictly)
$v1 | $v1 |
$v2 | $v2 |
Test if v1 is a higher version than v2 (with an option to coerce invalid SemVer strings)
$v1 | $v1 |
$v2 | $v2 |
$coerce | $coerce |
Test if v1 is a lower version or the same version as v2 (strictly)
$v1 | $v1 |
$v2 | $v2 |
Test if v1 is a lower version or the same version as v2 (with an option to coerce invalid SemVer strings)
$v1 | $v1 |
$v2 | $v2 |
$coerce | $coerce |
Test if v1 is a lower version than v2 (strictly)
$v1 | $v1 |
$v2 | $v2 |
Test if v1 is a lower version than v2 (with an option to coerce invalid SemVer strings)
$v1 | $v1 |
$v2 | $v2 |
$coerce | $coerce |
Test if v1 is not equal to v2 (strictly)
$v1 | $v1 |
$v2 | $v2 |
Test if v1 is not equal to v2 (with an option to coerce invalid SemVer strings)
$v1 | $v1 |
$v2 | $v2 |
$coerce | $coerce |
Parse a SemVer version string (strictly)
$version | $version |
Parse a SemVer version string (with an option to coerce invalid SemVer strings)
$version | $version |
$coerce | $coerce |
Serialize a parsed SemVer string
$version | $version |
Serialize a SemVer string
$major | $major |
$minor | $minor |
$patch | $patch |
$pre-release* | $pre-release* |
$build-metadata* | $build-metadata* |
Sort SemVer strings (strictly)
$versions+ | $versions+ |
Sort SemVer strings (with an option to coerce invalid SemVer strings)
$versions+ | $versions+ |
$coerce | $coerce |
Validate whether a SemVer string conforms to the spec
$version | $version |