Skip to content

Commit e9f1a4a

Browse files
committed
use ... in fload() instead of explicit headers argument
1 parent bc373d0 commit e9f1a4a

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

ChangeLog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2020-12-07 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* R/fload.R (fload): Use ... instead of explicit header argument
4+
* R/utils.R (.prep_input): Support ... use
5+
* man/fparse.Rd: Document ... use
6+
17
2020-12-04 Dirk Eddelbuettel <edd@debian.org>
28

39
* DESCRIPTION (Version, Date): Roll version and date
@@ -32,7 +38,7 @@
3238
2020-10-28 Dirk Eddelbuettel <edd@debian.org>
3339

3440
* DESCRIPTION (Version, Date): Roll version and date
35-
or
41+
3642
* inst/tinytest/test_misc.R: Expand test coverage
3743
* src/internal-utils.cpp: Mark one line #nocov
3844
* R/init.R (.onAttach): Mark six lines #nocov

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ Suggests: bit64, tinytest
1919
URL: https://github.com/eddelbuettel/rcppsimdjson/
2020
BugReports: https://github.com/eddelbuettel/rcppsimdjson/issues
2121
RoxygenNote: 7.1.1
22-
Encoding: UTF-8
22+
Encoding: UTF-8

R/fload.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
#' @param compressed_download Whether to request server-side compression on
1717
#' the downloaded document, default: \code{FALSE}
1818
#'
19-
#' @param headers Optional header content which can used to pass an API token,
20-
#' default is query \code{getOption} for key \sQuote{RcppSimdJson.header} with
21-
#' fallback of \code{NULL}
19+
#' @param ... Optional arguments which can be use \emph{e.g.} to pass additional
20+
#' header settings
2221
#'
2322
#' @examples
2423
#' # load JSON files ===========================================================
@@ -68,7 +67,7 @@ fload <- function(json,
6867
temp_dir = tempdir(),
6968
keep_temp_files = FALSE,
7069
compressed_download = FALSE,
71-
headers = getOption("RcppSimdJson.header", default = NULL)) {
70+
...) {
7271
# validate arguments =======================================================
7372
if (!.is_valid_json_arg(json)) {
7473
stop("`json=` must be a non-empty character vector, raw vector, or a list containing raw vectors.")
@@ -162,7 +161,7 @@ fload <- function(json,
162161
temp_dir = temp_dir,
163162
compressed_download = compressed_download,
164163
verbose = verbose,
165-
headers = headers)
164+
...)
166165
if (!keep_temp_files) {
167166
on.exit(unlink(diagnosis$input[diagnosis$is_from_url]), add = TRUE)
168167
}

R/utils.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
temp_dir,
1818
compressed_download,
1919
verbose,
20-
headers = NULL) {
20+
headers = NULL,
21+
...) {
2122
input[!is.na(input)] <- path.expand(input[!is.na(input)])
2223
diagnosis <- .diagnose_input(input)
2324
.headers <- headers

man/fparse.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)