R/sanitize_path.R

Defines functions sanitize_path

Documented in sanitize_path

#' making paths uniform
#' @param path path to be sanitized
#' @return sanitized path
#' @keywords internal
sanitize_path <- function(path){
  path <- stringr::str_replace(    path, "^ *", "")
  path <- ifelse( !grepl("^/", path),  paste0("/", path), path)
  return(path)
}
ropensci/robotstxt documentation built on Jan. 7, 2023, 12:37 p.m.