v/vlib/semver
Tim Basel 9d0a5942ac
builtin: change IError `msg` and `code` to methods + fix vlib, add a deprecation notice for the old usages (#13041)
2022-02-11 15:52:33 +02:00
..
LICENSE.md all: add #pkgconfig directive using the new vlib modules (#6673) 2020-10-26 18:05:18 +01:00
README.md
compare.v
parse.v
range.v
semver.v builtin: change IError `msg` and `code` to methods + fix vlib, add a deprecation notice for the old usages (#13041) 2022-02-11 15:52:33 +02:00
semver_test.v
util.v
v.mod

README.md

Description:

semver is a library for processing versions, that use the semver format.

Examples:

import semver

fn main() {
	ver1 := semver.from('1.2.4') or {
		println('Invalid version')
		return
	}
	ver2 := semver.from('2.3.4') or {
		println('Invalid version')
		return
	}
	println(ver1.gt(ver2))
	println(ver2.gt(ver1))
	println(ver1.satisfies('>=1.1.0 <2.0.0'))
	println(ver2.satisfies('>=1.1.0 <2.0.0'))
	println(ver2.satisfies('>=1.1.0 <2.0.0 || >2.2.0'))
}
false
true
true
false
true

For more details see semver.v file.