R/check_pattern.R

Defines functions check_pattern

check_pattern <- function(x) {
  if (!is.character(x) || length(x) != 1) {
    stop("`pattern` must be a single string", call. = FALSE)
  }

  if (is.na(x)) {
    stop("`pattern` can't be NA", call. = FALSE)
  }
}
csdaw/stringrb documentation built on Aug. 13, 2022, 10:55 p.m.