-
Notifications
You must be signed in to change notification settings - Fork 3
Print space after colon separator to match jq output #9
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
base: master
Are you sure you want to change the base?
Print space after colon separator to match jq output #9
Conversation
|
I see now that there is a printSpace, and it relies on fs.compact... is there a way to configure the package to print the space I want, without resorting to what is in this pull request? Thanks! |
|
Would be great to have that merged |
|
@nwidger could you give a look here? |
|
Agree that this formatting change should be made, but this PR as-is won't work as intended. For example: Before PR: {
"bar": [],
"foo":2
}After PR: {
"bar": [],
"foo": 2
}Notice the |
|
I'm looking more at this issue, it seems like the library actually used to handle this case correctly, but PR #8 broke it. Looking at that commit, it's not correct -- that added variable if !frame.inField() && inputIsObjectOrArray {
fs.printSpace(" ", false)
}so we always fail this if condition and never print that space. But simply undoing this commit, the issue goes away. This change must be a mistake written as-is, @nwidger thoughts on this? I do see the issue described in #7 (which spawned #8), I am trying to find a way to fix #7 without breaking other functionality like #8 did. |
This test should pass, but is failing, demonstrating the issue described in PR nwidger#9. A following commit will fix this test.
After this change what our package prints matches jq exactly. Thanks!