Semantic Version
Function | Description | Meta |
---|---|---|
semver.compare |
Compares valid SemVer formatted version strings. Arguments: Returns:a (string)first version string b (string)second version string result (number)
| v0.22.0 SDK-dependent |
semver.is_valid |
Validates that the input is a valid SemVer string. Arguments: Returns:vsn (any)input to validate result (boolean)
| v0.22.0 SDK-dependent |
Example of semver.is_valid
The result := semver.is_valid(vsn)
function checks to see if a version
string is of the form: MAJOR.MINOR.PATCH[-PRERELEASE][+METADATA]
, where
items in square braces are optional elements.
warning
When working with Go-style semantic versions, remember to remove the
leading v
character, or the semver string will be marked as invalid!
data.json
"{}"
input.json
"{}"
package semverisvalid
leadingV := semver.is_valid("v1.1.12-rc1+foo")
valid := semver.is_valid("1.1.12-rc1+foo")