Skip to content

Commit

Permalink
fix: correct is_page check
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke committed Dec 11, 2023
1 parent 8165064 commit df80fac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
is_page <- function(x) {
is.null(page) || is.numeric(page) && length(page) == 1
}
is_page <- function(x) is.null(x) || is.numeric(x) && length(x) == 1

na_if_empty <- function(x) replace(x, x == "", NA_character_)

Expand Down
1 change: 0 additions & 1 deletion R/wb.R
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ wb_region <- function(region = "all", lang = "en") {
wb_country <- function(country = "all", lang = "en") {
stopifnot(is.character(country) && length(country) == 1)
lang <- match.arg(lang, c("en", "fr", "es", "ar", "zh"))
stopifnot(is_page(page))

resource <- sprintf("%s/country/%s", lang, country)
res <- worldbank(resource, \(resp) {
Expand Down

0 comments on commit df80fac

Please sign in to comment.