Skip to contents

Show whether a given semver is greater than a baseline version.

Usage

semver_gt(sv = get_default_odkc_version(), to = "1.5.0")

Arguments

sv

The semver to compare as character ("2023.5.1", "1.5.0", "1.5"), or numeric (1.5). The value is always parsed with semver::parse_semver(). Default: get_default_odkc_version().

to

The semver to compare to as string. Although semver can parse complete version strings, to is still parsed by parse_odkc_version() to ensure it is complete with major, minor, and patch version components.

Value

A boolean indicating whether the given semver sv is greater than the baseline semver to.

Examples

get_default_odkc_version() |> semver_gt("0.8.0")
#> [1] TRUE
"2024.1.1" |> semver_gt("2024.1.0")
#> [1] TRUE
"2024.1.1" |> semver_gt("2024.1.1")
#> [1] FALSE
"2024.1.1" |> semver_gt("2024.1.2")
#> [1] FALSE