Is the key order of the keys in YAML input preserved when doing parse / modification / stringify? #608
Unanswered
vadimkantorov
asked this question in
Q&A
Replies: 1 comment
-
Yes, mapping order should be retained. If you find a case where it does not, please file an issue with steps to repeat. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If I understand correctly, the modern Object implementations in JavaScript preserve insertion order of the string keys, so it might work (depending on the inner impl of YAML parser).
Is it actually working with this package?
My usecase is some parsing / editing / stringification of frontmatter yamls in source-controlled files (git-stored markdown blog pages with frontmatters), so I'm caring about as exact match as possible during parse-string roundtrip - at least for unmodified entries.
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions