v/vlib/semver
2024-06-04 13:21:47 +03:00
..
compare.v all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
LICENSE.md
parse.v builtin: update last_index_u8, deprecate index_u8_last string methods, make consistent with last_index (#21604) 2024-06-04 13:21:47 +03:00
range.v all: unwrap const() blocks 2023-11-25 10:02:51 +03:00
README.md doc: update trim_doc_node_description, make module readmes more uniform (#20792) 2024-02-12 12:38:47 +02:00
semver.v all: fix typos (#21089) 2024-03-25 12:18:27 +02:00
semver_test.v all: unwrap const() blocks 2023-11-25 10:02:51 +03:00
util.v all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
v.mod V 0.4.6 2024-05-20 21:06:54 +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.