-
Following the docs, I have this code snippet which is showing an error in
Error:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
That would be because I would recommend reviewing the relevant docs section: https://eemeli.org/yaml/#parsing-yaml. If some part of that is not clear, please do say so, and hopefully we can improve the documentation. It might also be a good idea to play around with the Node.js interactive shell to see what the data looks like at each stage? |
Beta Was this translation helpful? Give feedback.
That would be because
compose()
returns a generator of parsed AST nodes, and you're looking for a single CST document. You probably want to iterate on theparse()
results until you find one.I would recommend reviewing the relevant docs section: https://eemeli.org/yaml/#parsing-yaml. If some part of that is not clear, please do say so, and hopefully we can improve the documentation. It might also be a good idea to play around with the Node.js interactive shell to see what the data looks like at each stage?