serialize function

String serialize(
  1. Object? object, [
  2. JsonSerializerOptions? options
])

Serializes the given object to a JSON string.

Optionally, you can provide options to customize the serialization process. Returns the JSON string representation of the object.

Implementation

String serialize(Object? object, [JsonSerializerOptions? options]) {
  return JsonSerializer.serialize(object, options);
}