1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/semver
2022-10-28 19:08:30 +03:00
..
compare.v
LICENSE.md
parse.v
range.v all: remove unnecessary IError() casts 2022-10-28 19:08:30 +03:00
README.md
semver_test.v
semver.v all: remove unnecessary IError() casts 2022-10-28 19:08:30 +03:00
util.v
v.mod V 0.3.1 2022-08-31 19:24:57 +03:00

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.