-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty map values are round-tripped to null
#366
Comments
I've debugged a little and I believe I found the culprit: yaml/src/schema/common/null.ts Lines 11 to 12 in 7998a95
When the null tag is stringified, it checks if the source contains something that would be parsed as |
Wow, that was fast -- thanks a lot! |
You're right, that shouldn't have been happening. The test in stringify was wrong, as it didn't recognise |
How is the release schedule? |
There's no schedule as such. I'll try and roll out a new release within a week or two; there are a few other fixes I'd like to include. |
Okay, thanks again! |
Description: Empty map values are not round-tripped correctly.
To reproduce:
Versions:
yaml
: 2.0.0-10Additional context
Thanks a lot for this awesome library! I'm using it to edit around in docker-compose files, where the pattern
is quite common. These are currently round-tripped to
If there is more content after the
volumes
block, it's getting worse, where thisis round-tripped to this:
There are other minor offenders to round-tripping (like a tiny bit of whitespace preservation here and there), but this is the only offender that is very visible. I can probably refer to the CST for my use-cases, but this might be something you want to look at.
The text was updated successfully, but these errors were encountered: