jsStringify function

String? jsStringify(
  1. Object? v
)

JSON.stringify(v), or null where JavaScript returns undefined.

Key order follows JavaScript's own-property order: array-index keys ascending first, then the other keys in insertion order (the order jsonDecode keeps).

Implementation

String? jsStringify(Object? v) {
  final sb = StringBuffer();
  return _writeJson(sb, v) ? sb.toString() : null;
}