Skip to content

Commit

Permalink
Support for logical.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Jul 26, 2024
1 parent afceceb commit e8283f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ validate_property <- function(name, value, validator) {
if (!is.numeric(value) || length(value) != 1) {
stop(sprintf("Property '%s' must be a single numeric value", name), call. = FALSE)
}
} else if (identical(validator, logical) || identical(validator, "logical")) {
if (!is.logical(value)) {
stop(sprintf("Property '%s' must be a logical value", name), call. = FALSE)
}
} else if (is.function(validator)) {
tryCatch({
if (!validator(value)) {
Expand Down

0 comments on commit e8283f2

Please sign in to comment.