You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (str_detect(market, '^[[:alpha:]]{2}$')) {
stop('"market" must be an ISO 3166-1 alpha-2 country code')
}
Where the logical test needs to be negated, like so:
if (!str_detect(market, '^[[:alpha:]]{2}$')) {
stop('"market" must be an ISO 3166-1 alpha-2 country code')
}
Since it's now raising an error when market is indeed in the correct format.
The negated version of the check s is already correctly implemented in the following functions:
get_artist_albums()
get_artist_top_tracks()
Moreover, the search_spotify() ad validate_market() functions use a different approach, which I like even better tbh:
if (!is.null(market)) {
assertthat::assert_that(
str_detect(market, '^[[:alpha:]]{2}$'),
msg = "The parameter 'market' must be an ISO 3166-1 alpha-2 country code."
)
}
The text was updated successfully, but these errors were encountered:
These functions
that have the following check:
Where the logical test needs to be negated, like so:
Since it's now raising an error when market is indeed in the correct format.
The negated version of the check s is already correctly implemented in the following functions:
Moreover, the search_spotify() ad validate_market() functions use a different approach, which I like even better tbh:
The text was updated successfully, but these errors were encountered: