Skip to main content

Module VersionCompare

Module VersionCompare 

Source
Expand description

Semantic version comparison utility.

CompareVersions parses two "major.minor.patch" strings and returns -1, 0, or 1 following the same contract as C’s strcmp so callers can use match on the result. Non-numeric segments are silently dropped.

Functions§

CompareVersions
Compare two semver strings. Returns 1 if v1 > v2, -1 if v1 < v2, 0 if equal.