mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-10 06:35:13 -05:00
19 lines
432 B
R
19 lines
432 B
R
#' @importFrom fastmap key_missing
|
|
#' @export
|
|
fastmap::key_missing
|
|
|
|
#' @importFrom fastmap is.key_missing
|
|
#' @export
|
|
fastmap::is.key_missing
|
|
|
|
|
|
validate_key <- function(key) {
|
|
if (!is.character(key) || length(key) != 1 || nchar(key) == 0) {
|
|
stop("Invalid key: key must be single non-empty string.")
|
|
}
|
|
if (grepl("[^a-z0-9]", key)) {
|
|
stop("Invalid key: ", key, ". Only lowercase letters and numbers are allowed.")
|
|
}
|
|
}
|
|
|