-
If I have the object: {
name: 'myName'
freeText: 'this is my free text'
} and strinfigy it ( name: myName
freeText: >
this is my free text |
Beta Was this translation helpful? Give feedback.
Answered by
eemeli
Mar 3, 2022
Replies: 1 comment
-
Yes. You'll need to first construct a Document from your JS value, and then set the type of the appropriate node. This is how it looks like with import { Document } from 'yaml'
const doc = new Document({ name: 'myName', freeText: 'this is my free text\n' })
doc.get('freeText', true).type = 'BLOCK_FOLDED'
doc.toString() name: myName
freeText: >
this is my free text |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kirdock
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. You'll need to first construct a Document from your JS value, and then set the type of the appropriate node. This is how it looks like with
yaml@next
: