Skip to content

Commit 5ae7549

Browse files
author
Ryan Patrick Kyle
committed
🐫 make concise
1 parent a0c2f7e commit 5ae7549

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

R/dash.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,13 @@ Dash <- R6::R6Class(
815815
# specify a custom index string
816816
# ------------------------------------------------------------------------
817817
index_string = function(string) {
818-
requiredKeys <- c("app_entry", "config", "scripts")
818+
required_keys <- c("app_entry", "config", "scripts")
819819

820-
checks <- sapply(requiredKeys, function(x) grepl(x, string))
820+
keys_present <- vapply(required_keys, function(x) grepl(x, string), logical(1))
821821

822-
if (FALSE %in% checks) {
822+
if (!all(keys_present)) {
823823
stop(sprintf("Did you forget to include %s in your index string?",
824-
paste(requiredKeys[!checks], collapse = ", ")))
824+
paste(names(keys_present[keys_present==FALSE]), collapse = ", ")))
825825
}
826826
private$custom_index = string
827827
},

0 commit comments

Comments
 (0)