Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
fix: ObjectWriter now writes proper YAML without inlining anything
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Oct 9, 2018
1 parent 0d22e2b commit a98b859
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/ObjectWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export class ObjectWriter<T extends Obj = Obj> extends AbstractReadWriter {
//tslint:disable:no-unbound-method no-magic-numbers
switch (this.format) {
case ObjectWriterFormat.YAML:
return YAML.stringify.bind(YAML);
return (v$: T) => YAML.stringify(v$, Number.MAX_VALUE, 2);
default:
return (v: T) => JSON.stringify(v, null, 2);
return (v$: T) => JSON.stringify(v$, null, 2);
}
//tslint:enable:no-unbound-method no-magic-numbers
}
Expand Down
3 changes: 2 additions & 1 deletion test/commands/copy-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ describe('copy-files', () => {
break;
case '.yml':
case '.yaml':
contents = YAML.stringify(cfg);
//tslint:disable-next-line:no-magic-numbers
contents = YAML.stringify(cfg, Number.MAX_VALUE, 2);
break;
default:
throw new Error('Test error: invalid format');
Expand Down

0 comments on commit a98b859

Please sign in to comment.