R/assertions.R

Defines functions is_timeout is_flag is_string

is_string <- function(x) {
  is.character(x) && length(x) == 1 && !is.na(x)
}

is_flag <- function(x) {
  is.logical(x) && length(x) == 1 && !is.na(x)
}

is_timeout <- function(x) {
  is.numeric(x) && length(x) == 1 && !is.na(x) && x >= 0
}
gaborcsardi/filelock documentation built on Jan. 14, 2024, 4:01 a.m.