encode static method

String encode(
  1. Map json, [
  2. int nestingLevel = 0
])

Encodes a Map<String, dynamic> as yaml similar to json.encode.

Implementation

static String encode(Map<dynamic, dynamic> json, [int nestingLevel = 0]) {
  return json.entries
      .map((entry) => _formatEntry(entry, nestingLevel))
      .join('\n');
}