parse_json_or_empty: Parse a JSON, but force a NULL or empty string to be...

View source: R/utils.R

parse_json_or_emptyR Documentation

Parse a JSON, but force a NULL or empty string to be interpreted as an empty list

Description

Since jsonlite::fromJSON(NULL) and jsonlite::fromJSON("") return errors, this function will force a NULL or empty string to be interpreted as list(). Otherwise, the output of this function is identical to fromJSON.

Usage

parse_json_or_empty(json, ...)

Arguments

json

character to be interpreted as a JSON

...

additional arguments passed to fromJSON

Value

list


lambdr documentation built on Nov. 25, 2023, 5:08 p.m.