1
0
Fork 0

fix: delimit output documents

This commit is contained in:
ssube 2019-06-24 23:02:28 -05:00
parent 2bd60c8f6c
commit 79c7e71796
1 changed files with 8 additions and 3 deletions

View File

@ -5,9 +5,14 @@ import { Parser } from 'src/parser';
export class YamlParser implements Parser {
dump(...data: Array<any>): string {
return safeDump(data, {
schema: CONFIG_SCHEMA,
});
const docs: Array<any> = [];
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<any> {