Semver strings (with optional v/V prefix) are sorted numerically;
"latest" is always placed at the end regardless of position in the input.
Usage
config_sort_versions(versions)
Arguments
- versions
(character(n))
Vector of unique version strings (e.g. c("v1.2.3", "latest")) — typically
from unlist()ing the versions list-col.
Value
Sorted character vector with "latest" last.
Examples
config_sort_versions(c("v2.0.0", "v1.0.0", "latest"))
#> [1] "v1.0.0" "v2.0.0" "latest"
config_sort_versions(c("latest", "v1.2.3"))
#> [1] "v1.2.3" "latest"
config_sort_versions(c("v1.0.0", "v10.0.0", "v2.0.0"))
#> [1] "v1.0.0" "v2.0.0" "v10.0.0"