jsonToYaml function Null safety

String jsonToYaml(
  1. dynamic json
)

Implementation

String jsonToYaml(dynamic json) {
  final buffer = StringBuffer();

  if (json is Map<String, dynamic>) {
    _writeMap(json, buffer: buffer);
  } else if (json is List<dynamic>) {
    _writeList(json, buffer: buffer);
  } else {
    throw ArgumentError();
  }

  return buffer.toString();
}