R/destructure.R

Defines functions destructure.numeric_version destructure.default destructure

destructure <- function(object) {
  UseMethod("destructure")
}

#' @export
destructure.default <- function(object) {
  object
}

#' @export
destructure.numeric_version <- function(object) {
  unclass(object)[[1L]]
}

Try the dotty package in your browser

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

dotty documentation built on Sept. 14, 2024, 9:09 a.m.