Clojure implementation of the Semantic Versioning 2.0.0 spec. Parse, validate, sort and modify semantic version strings.
Why do I copy the code into the project? Cannot find the library from clojars.org anymore. Please be aware that the copyright of this code belongs to owainlewis. You can access https://github.com/owainlewis/semver for more details.
Clojure implementation of the Semantic Versioning 2.0.0 spec. Parse, validate, sort and modify semantic version strings. Why do I copy the code into the project? Cannot find the library from clojars.org anymore. Please be aware that the copyright of this code belongs to owainlewis. You can access https://github.com/owainlewis/semver for more details.
(compare-strings v1 v2)
Compare two semantic version strings
Compare two semantic version strings
(equal? v1 v2)
Returns true if v1 is equal to v2 else false
Returns true if v1 is equal to v2 else false
(increment-major version)
Returns a copy of a given version with the major version incremented
Returns a copy of a given version with the major version incremented
(increment-minor version)
Returns a copy of the given version with the minor version incremented
Returns a copy of the given version with the minor version incremented
(increment-patch version)
Returns a copy of the given version with the patch version incremented
Returns a copy of the given version with the patch version incremented
(newer? v1 v2)
Returns true if v1 is newer than v2 else false
Returns true if v1 is newer than v2 else false
(older? v1 v2)
Returns true if v1 is older than v2 else false
Returns true if v1 is older than v2 else false
(parse version)
Parse a semantic version string returning nil if the input is invalid or a Version if the input is valid
Parse a semantic version string returning nil if the input is invalid or a Version if the input is valid
(render version)
Takes a semantic version type and renders it back as a string
Takes a semantic version type and renders it back as a string
(snapshot? version)
(sorted versions)
Given a list of semantic version strings, compare them and return them in sorted order with newest versions first
Given a list of semantic version strings, compare them and return them in sorted order with newest versions first
(transform modifier version)
Transform a version string by applying a modifier function This might typically be used to alter the version in some way like incrementing a version part or adding something to the metadata or pre-release parts Example: (transform "1.0.0" increment-major)
Transform a version string by applying a modifier function This might typically be used to alter the version in some way like incrementing a version part or adding something to the metadata or pre-release parts Example: (transform "1.0.0" increment-major)
(valid? version)
Returns true if an input string is a valid semantic version string
Returns true if an input string is a valid semantic version string
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close