src/library/pkgdepends/R/versions.R

version_satisfies <- function(ver, op, cond) {
  ver <- package_version(ver)
  switch(
    op,
    "<"  = ver <  cond,
    "<=" = ver <= cond,
    "==" = ver == cond,
    ">=" = ver >= cond,
    ">"  = ver >  cond,
    "!=" = ver != cond
  )
}
r-lib/pak documentation built on Nov. 9, 2024, 2:34 a.m.