Skip to content

What should YAML.stringify(undefined) return? #187

Closed Answered by eemeli
eemeli asked this question in Q&A
Discussion options

You must be logged in to vote

I decided to go with undefined. That matches JSON.stringify(), and it's at least not wrong. I also added a new keepUndefined option, which keeps undefined values in mappings. That allows for local tags like !js/undefined to be used, should that be desirable.

Thank you everyone for your feedback!

Replies: 13 comments

Comment options

You must be logged in to vote
0 replies
Comment options

eemeli
Aug 28, 2020
Maintainer Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

eemeli
Aug 30, 2020
Maintainer Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

eemeli
Aug 31, 2020
Maintainer Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

eemeli
Sep 1, 2020
Maintainer Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

eemeli
Sep 9, 2020
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by eemeli
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #187 on December 14, 2020 21:55.