extension PureYAML.Emitting.Dumper { /// Serializes a stream of documents. The stream path owns the document /// markers: it emits one `---` start per document and, when /// `explicitDocumentEnd` is set, one `...` end per document. Each document /// body is rendered marker-free so `explicitDocumentStart` and `canonical` /// cannot stack a second `---` onto the separator, which previously turned /// every document into two (an empty one plus the real one) on reparse. func dump(_ documents: [PureYAML.Stream.Document]) -> String { documents .map { document in let body = PureYAML.Emitting.exceedsNestingLimit(document.value) ? PureYAML.Emitting.nestingLimitDocument : documentBody(document.value) let end = options.explicitDocumentEnd ? "...\n" : "" return "---\n" + body + end } .joined() } }