Repository navigation
Read, repair, check and merge JSON, and write YAML as ldo does - #3
Merged
Merged
Conversation
Added - A Json module, the twin of the ldo CLI's ldo json commands: ConvertFrom-LdoJson, Repair-LdoJson, Test-LdoJson, Get-LdoJsonValue and Merge-LdoJson. JSON is read as it was written (keys in order and case-sensitive, big numbers whole, strings never turned into dates), nearly JSON is repaired when asked with each fix logged, and documents merge deeply or as an RFC 7396 merge patch. - tests/shared: the cases ldo's tests run too, so the two agree exactly. - ConvertTo-LdoYaml -Indent. Fixed - ConvertTo-LdoYaml keeps a multi-line string's ending (|-, | or |+), where | added a line break to a string without one, and quotes what YAML 1.1 readers retype (12:30, 2026-09-24, 0x1F, .inf, y, N). Control characters inside quotes are escaped. Changed - ConvertTo-LdoYaml writes floats as Python does (1.0, 1.0e-07, .nan) and dates in ISO 8601.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Json module, the twin of the ldo CLI's
ldo jsoncommands, and aConvertTo-LdoYamlthat writes what ldo writes.ConvertFrom-LdoJson,Repair-LdoJson,Test-LdoJson,Get-LdoJsonValueandMerge-LdoJson: JSON read as it was written (keys in order and case-sensitive, big numbers whole, strings never turned into dates), nearly JSON repaired when asked with each fix logged, and a deep merge or an RFC 7396 merge patch.ConvertTo-LdoYamlkeeps a multi-line string's ending (|-,|,|+), quotes what YAML 1.1 readers retype (12:30,2026-09-24,0x1F), and writes floats and dates the same way every time. New-Indent.tests/sharedholds the cases ldo-cli's tests run too (copied from itstests/fakes/shared), so the two agree exactly.The version stays at 3.0.1 (already on the Gallery, so the publish skips); this goes out with the next release. See the CHANGELOG's Unreleased section.