#include <v8-json.h>
Static Public Member Functions | |
static MaybeLocal< Value > | Parse (Local< Context > context, Local< String > json_string, std::optional< ScriptOriginOptions > origin_options=std::nullopt) |
static MaybeLocal< String > | Stringify (Local< Context > context, Local< Value > json_object, Local< String > gap=Local< String >()) |
A JSON Parser and Stringifier.
|
static |
Tries to parse the string |json_string| and returns it as value if successful.
the | context in which to parse and create the value. |
json_string | The string to parse. |
origin_options | Optional script origin options to use for error reporting. If not provided, error reporting will use default origin options or attempt to infer origin from the current stack. |
|
static |
Tries to stringify the JSON-serializable object |json_object| and returns it as string if successful.
json_object | The JSON-serializable object to stringify. |