Parse and compare generic version strings.
Does not assume any versioning scheme such as Semantic Versioning, but simply interprets sequences of digits and sequences of letters as parts, ignoring punctuation and whitespace.
Compares parts lexicographically, filling shorter versions with nil
.
Types are compared as int > nil > string
. That means that 2.1.0
is
greater than 2.1
, and 2.1
is greater than 2.1-alpha2
.
Parse and compare generic version strings. Does not assume any versioning scheme such as Semantic Versioning, but simply interprets sequences of digits and sequences of letters as parts, ignoring punctuation and whitespace. Compares parts lexicographically, filling shorter versions with `nil`. Types are compared as `int > nil > string`. That means that `2.1.0` is greater than `2.1`, and `2.1` is greater than `2.1-alpha2`.
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |