File: parseJSON.R

package info (click to toggle)
r-cran-jsonlite 1.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: ansic: 3,792; sh: 9; makefile: 6
file content (15 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
parseJSON <- function(txt, bigint_as_char = FALSE) {
  if(inherits(txt, "connection")){
    parse_con(txt, bigint_as_char)
  } else {
    parse_string(txt, bigint_as_char)
  }
}

#' @useDynLib jsonlite R_parse
parse_string <- function(txt, bigint_as_char){
  if (length(txt) > 1) {
    txt <- paste(txt, collapse = "\n")
  }
  .Call(R_parse, txt, bigint_as_char)
}