Skip to content

Commit

Permalink
🐫 make concise
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Patrick Kyle committed Feb 6, 2020
1 parent a0c2f7e commit 5ae7549
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/dash.R
Original file line number Diff line number Diff line change
Expand Up @@ -815,13 +815,13 @@ Dash <- R6::R6Class(
# specify a custom index string
# ------------------------------------------------------------------------
index_string = function(string) {
requiredKeys <- c("app_entry", "config", "scripts")
required_keys <- c("app_entry", "config", "scripts")

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

if (FALSE %in% checks) {
if (!all(keys_present)) {
stop(sprintf("Did you forget to include %s in your index string?",
paste(requiredKeys[!checks], collapse = ", ")))
paste(names(keys_present[keys_present==FALSE]), collapse = ", ")))
}
private$custom_index = string
},
Expand Down

0 comments on commit 5ae7549

Please sign in to comment.