File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 55# '
66# ' @param name Name of widget
77# ' @param npmPkg Optional \href{https://npmjs.com/}{NPM} package upon which this
8- # ' widget is based, as a two-element character vector of name and
9- # ' \href{https://docs.npmjs.com/files/package.json#dependencies}{version
10- # ' range}. If you specify this parameter the package will be added to the
8+ # ' widget is based, a named list with two elements: \code{ name} and
9+ # ' \href{https://docs.npmjs.com/files/package.json#dependencies}{version}. If
10+ # ' you specify this parameter the package will be added to the
1111# ' \code{dependency} section of the generated \code{package.json}.
1212# ' @param edit Automatically open the widget's JavaScript source file after
1313# ' creating the scaffolding.
@@ -41,7 +41,7 @@ toDepJSON <- function(npmPkg) {
4141 if (is.null(npmPkg )) {
4242 " "
4343 } else {
44- do.call( sprintf , as.list(c( ' "%s": "%s"' , npmPkg )) )
44+ sprintf( ' "%s": "%s"' , npmPkg $ name , npmPkg $ version )
4545 }
4646}
4747
You can’t perform that action at this time.
0 commit comments