Skip to content

Commit 1076bb3

Browse files
committed
Signal an error if npmPkgs missing names
1 parent 790c3fd commit 1076bb3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/scaffold.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ scaffoldReactWidget <- function(name, npmPkgs = NULL, edit = interactive()){
4444
toDepJSON <- function(npmPkgs) {
4545
if (is.null(npmPkgs)) {
4646
""
47+
} else if (!length(names(npmPkgs))) {
48+
stop("Must specify npm package names in the names attributes of npmPkgs")
4749
} else {
4850
paste0(sprintf('"%s": "%s"', names(npmPkgs), npmPkgs), collapse = ",\n")
4951
}

0 commit comments

Comments
 (0)