R/utils.R

Defines functions find_kf_type find_arg_type

find_kf_type <- function(x) {
  x <- stringr::str_extract(x, "[^_]+$")

  lookup <- list(
    string = "String",
    int = "Integer",
    float = "Float",
    bool = "Bool",
    metrics = "Metrics",
    uimeta = "UI_metadata"
  )

  lookup[[x]]
}

find_arg_type <- function(x) {
  x <- stringr::str_extract(x, "[^_]+$")

  ifelse(x %in% c("string", "int", "float", "bool"), "inputValue", "outputPath")
}
ndiquattro/kflow documentation built on Jan. 27, 2020, 4:19 p.m.