Skip to content
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

Newline in the output of json.stringify #2078

Closed
smimram opened this issue Nov 23, 2021 · 2 comments
Closed

Newline in the output of json.stringify #2078

smimram opened this issue Nov 23, 2021 · 2 comments
Assignees

Comments

@smimram
Copy link
Member

smimram commented Nov 23, 2021

The following

l = [("f", 1), ("b", 4)]
let json.stringify j = (l : [(string * int)] as json.object)

outputs

{ "f": 1, "b": 4
}

is there any good reason for the newline before the closing }?

@toots
Copy link
Member

toots commented Nov 23, 2021

No good reason that I know of. I think it's been like that for a while.

@smimram
Copy link
Member Author

smimram commented Dec 2, 2021

Note: it's to_string_pp in src/tools/json.ml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants