R/chk.R

Defines functions chk_interval_regex chk_time_regex

chk_time_regex <- function(x, x_name = NULL) {
  if (vld_time_regex(x)) {
    return(invisible())
  }
  if (is.null(x_name)) x_name <- deparse_backtick_chk(substitute(x))
  abort_chk(x_name, " must be a time regular expression.")
}

chk_interval_regex <- function(x, x_name = NULL) {
  if (vld_interval_regex(x)) {
    return(invisible())
  }
  if (is.null(x_name)) x_name <- deparse_backtick_chk(substitute(x))
  abort_chk(x_name, " must be an interval regular expression.")
}
poissonconsulting/openinghours documentation built on July 28, 2020, 4:36 p.m.