From 80a34c20886e32604c2dcae4022eeed75e1830a4 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 8 Feb 2024 11:55:39 -0600 Subject: [PATCH] Polishing keydef data --- data-raw/keydef.R | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/data-raw/keydef.R b/data-raw/keydef.R index 2a86a74..c9cd906 100644 --- a/data-raw/keydef.R +++ b/data-raw/keydef.R @@ -5,18 +5,14 @@ lines <- readLines(url) first <- which(grepl("_keyDefinitions", lines)) last <- tail(which(grepl("^}", lines)), 1) - - ct <- V8::v8() - def <- paste(c("keydef = {", lines[(first + 1):last]), collapse = "\n") ct$eval(def) keydefs <- ct$get("keydef") usethis::use_data(keydefs, overwrite = TRUE, internal = TRUE) - tibble::enframe(keydef) |> - unnest_wider(value) |> + tidyr::unnest_wider(value) |> dplyr::arrange(keyCode) |> View()