@@ -815,15 +815,7 @@ Dash <- R6::R6Class(
815
815
# specify a custom index string
816
816
# ------------------------------------------------------------------------
817
817
index_string = function (string ) {
818
- required_keys <- c(" app_entry" , " config" , " scripts" )
819
-
820
- keys_present <- vapply(required_keys , function (x ) grepl(x , string ), logical (1 ))
821
-
822
- if (! all(keys_present )) {
823
- stop(sprintf(" Did you forget to include %s in your index string?" ,
824
- paste(names(keys_present [keys_present == FALSE ]), collapse = " , " )))
825
- }
826
- private $ custom_index <- string
818
+ private $ custom_index <- validate_keys(string )
827
819
},
828
820
829
821
# ------------------------------------------------------------------------
@@ -838,14 +830,7 @@ Dash <- R6::R6Class(
838
830
template = sub(key , kwargs [[name ]], template )
839
831
}
840
832
841
- required_keys <- c(" app_entry" , " config" , " scripts" )
842
-
843
- checks <- sapply(requiredKeys , function (x ) grepl(x , names(kwargs )))
844
-
845
- if (FALSE %in% checks ) {
846
- stop(sprintf(" Did you forget to include %s in your index string?" ,
847
- paste(requiredKeys [! checks ], collapse = " , " )))
848
- }
833
+ validate_keys(names(kwargs ))
849
834
850
835
private $ template_index <- template
851
836
},
0 commit comments