Skip to content

Commit

Permalink
fix: unboxing family and given author names, closes #77
Browse files Browse the repository at this point in the history
  • Loading branch information
brycefrank committed Nov 2, 2024
1 parent 64dc1e9 commit 4f7517a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/json.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ authors_to_json <- function(authors) {

for(i in seq_along(authors)) {
author_parsed <- list(
given = paste(authors[[i]]$given, collapse = " "),
family = paste(authors[[i]]$family, collapse = " ")
given = jsonlite::unbox(paste(authors[[i]]$given, collapse = " ")),
family = jsonlite::unbox(paste(authors[[i]]$family, collapse = " "))
)

out[[i]] <- author_parsed
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-json.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ test_that("publication_to_json_runs", {
expect_equal(parsed$models_json[[1]][["model_type"]], jsonlite::unbox("site index"))

expect_true("taxa" %in% names(parsed$models_json[[1]][["descriptors"]]))
})
})

0 comments on commit 4f7517a

Please sign in to comment.