Describe the bug
The library adds an additional newline after an empty value and a newline
To Reproduce
import { parseDocument } from 'yaml';
import { createPatch } from 'diff';
const yaml = `
map:
item:
anothermap:
anotheritem:
`;
const document = parseDocument(yaml);
const result = document.toString();
const patch = createPatch('output', yaml, result);
console.log(patch);
Output:
Index: output
===================================================================
--- output
+++ output
@@ -1,7 +1,8 @@
-
map:
item:
+
anothermap:
anotheritem:
+
Expected behaviour
Expected output:
Index: output
===================================================================
--- output
+++ output
Versions (please complete the following information):
- Environment: Node v16.16.0
yaml: 2.2.2
Describe the bug
The library adds an additional newline after an empty value and a newline
To Reproduce
Output:
Expected behaviour
Expected output:
Versions (please complete the following information):
yaml: 2.2.2