createJSONString method

JSString createJSONString({
  1. int indent = 4,
  2. JSValuePointer? exception,
})

Creates a JavaScript string containing the JSON serialized representation of a JS value. indent The number of spaces to indent when nesting. If 0, the resulting JSON will not contains newlines. The size of the indent is clamped to 10 spaces. exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Implementation

JSString createJSONString({
  int indent = 4,
  JSValuePointer? exception,
}) {
  return JSString(JSValueRef.jSValueCreateJSONString(context.pointer, pointer,
      indent, (exception ?? JSValuePointer(nullptr)).pointer));
}