-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
featurea feature request or enhancementa feature request or enhancement
Description
Should the following code be wrapped up in an exported helper function?
Lines 236 to 237 in 37b07cb
if (any(names(enquos(...)) == "newdata")) | |
rlang::abort("Did you mean to use `new_data` instead of `newdata`?") |
It is used a couple of handfuls of times in this package along with other add-on packages.
newdata_abort <- function(...) {
if (any(names(rlang::enquos(...)) == "newdata"))
rlang::abort("Did you mean to use `new_data` instead of `newdata`?")
}
test <- function(...) {
newdata_abort(...)
list(...)
}
test(new_data = "hello")
#> $new_data
#> [1] "hello"
test(newdata = "hello")
#> Error: Did you mean to use `new_data` instead of `newdata`?
Created on 2021-07-03 by the reprex package (v2.0.0)
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement