From 79c7e7179618528122bd68fce153094a96081ee3 Mon Sep 17 00:00:00 2001 From: ssube Date: Mon, 24 Jun 2019 23:02:28 -0500 Subject: [PATCH] fix: delimit output documents --- src/parser/YamlParser.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/parser/YamlParser.ts b/src/parser/YamlParser.ts index 883359c..3e9a2e3 100644 --- a/src/parser/YamlParser.ts +++ b/src/parser/YamlParser.ts @@ -5,9 +5,14 @@ import { Parser } from 'src/parser'; export class YamlParser implements Parser { dump(...data: Array): string { - return safeDump(data, { - schema: CONFIG_SCHEMA, - }); + const docs: Array = []; + for (const doc of data) { + const part = safeDump(doc, { + schema: CONFIG_SCHEMA, + }); + docs.push(part); + } + return docs.join('\n---\n\n'); } parse(body: string): Array {