Skip to content

Commit

Permalink
Fix null input parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeLydeamore committed May 29, 2024
1 parent b70a676 commit 7057628
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ rsconnect/
.Rproj.user
docs

.Rprofile
.Rprofile
inst/doc
6 changes: 6 additions & 0 deletions R/util.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
restify_vector <- function(input, name = NULL) {
if (is.null(input)) {
return(NULL)
}
if (is.null(name)) {
name <- deparse(substitute(input))
}
input <- sapply(input, function(s) {
gsub(" ", "%20", s)
})
string <- paste0("&", name, "=")

paste0(input, collapse=string)
Expand Down

0 comments on commit 7057628

Please sign in to comment.