R/utils.R

Defines functions normalize_to_linear_easing `%||%`

#' The `NULL` coalescing operator
#'
#' @noRd
`%||%` <- function(x, y) {
  if (is.null(x)) y else x
}

normalize_to_linear_easing <- function(easing_fn) {

  if (is.null(easing_fn)) {
    easing_fn <- linear()
  } else {
    if (easing_fn == "linear") {
      easing_fn <- linear()
    }
  }

  easing_fn
}

Try the omsvg package in your browser

Any scripts or data that you put into this service are public.

omsvg documentation built on Feb. 10, 2021, 5:10 p.m.