1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/semver
Alexander Medvednikov e407579e99 V 0.4
2023-07-01 13:50:33 +03:00
..
compare.v semver: refactor, simplify, fix typo (#18272) 2023-05-27 01:57:02 +03:00
LICENSE.md
parse.v checker: check option fn returning error (fix #17423) (#17438) 2023-03-02 15:49:50 +02:00
range.v toml, semver: minor optimization of conditions (#18299) 2023-05-30 14:24:27 +02:00
README.md docs: adding skeleton README.md files for all vlib modules (#13034) 2022-01-05 18:06:08 +02:00
semver_test.v
semver.v semver: refactor, simplify, fix typo (#18272) 2023-05-27 01:57:02 +03:00
util.v semver: refactor, simplify, fix typo (#18272) 2023-05-27 01:57:02 +03:00
v.mod V 0.4 2023-07-01 13:50:33 +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.