diff --git a/R/parse.R b/R/parse.R index d9e29e68..066f86c1 100644 --- a/R/parse.R +++ b/R/parse.R @@ -82,30 +82,33 @@ parse_connectapi_typed <- function(data, ptype, strict = FALSE) { } parse_connectapi <- function(data) { - purrr::list_rbind(purrr::map( - data, - function(x) { - tibble::as_tibble(purrr::map( - .x = x, - .f = function(y) { - if (is.list(y)) { - # empty list object gets null - prep <- purrr::pluck(y, .default = NULL) - } else { - # otherwise NA - prep <- purrr::pluck(y, .default = NA) - } - if (length(prep) > 1) { - prep <- list(prep) - } - return(prep) + tibble::as_tibble( + purrr::list_rbind( + purrr::map( + data, + function(x) { + tibble::as_tibble(purrr::map( + .x = x, + .f = function(y) { + if (is.list(y)) { + # empty list object gets null + prep <- purrr::pluck(y, .default = NULL) + } else { + # otherwise NA + prep <- purrr::pluck(y, .default = NA) + } + if (length(prep) > 1) { + prep <- list(prep) + } + return(prep) + } + )) } - )) - } - )) + ) + ) + ) } - coerce_fsbytes <- function(x, to, ...) { if (is.numeric(x)) { fs::as_fs_bytes(x)