iterableToYaml static method

String iterableToYaml(
  1. String title,
  2. Iterable<LeakReport>? leaks, {
  3. String indent = '',
  4. required bool phasesAreTests,
})

Implementation

static String iterableToYaml(
  String title,
  Iterable<LeakReport>? leaks, {
  String indent = '',
  required bool phasesAreTests,
}) {
  if (leaks == null || leaks.isEmpty) return '';

  return '''$title:
$indent  total: ${leaks.length}
$indent  objects:
${leaks.map((e) => e.toYaml('$indent    ', phasesAreTests: phasesAreTests)).join()}
''';
}