R/staticimports.R

Defines functions walk map_chr is_string cat0

# Generated by staticimports; do not edit by hand.
# ======================================================================
# Imported from pkg:staticimports
# ======================================================================

cat0 <- function(..., sep = "") {
  cat(..., sep = sep)
}

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

map_chr <- function(.x, .f, ...) {
  if (is.character(.f)) {
    vapply(.x, `[[`, .f, ..., FUN.VALUE = NA_character_)
  } else {
    vapply(.x, .f, ..., FUN.VALUE = NA_character_)
  }
}

walk <- function(.x, .f, ...) {
  for (i in seq_along(.x)) {
    .f(.x[[i]], ...)
  }
  NULL
}
wch/staticimports documentation built on Jan. 13, 2024, 8:48 p.m.