Is there a reason for adding an extra \n when parsing an empty hash?
json is not adding it and it creates some issues when diff-ing pretty jsons generated with json and yajl-ruby.
[1]pry(main)> require 'yajl/json_gem'
true
[2]pry(main)> JSON.pretty_generate(a: {})
"{\n \"a\": {\n\n }\n}"
[3]pry(main)> require 'json'
true
[4]pry(main)> JSON.pretty_generate(a: {})
"{\n \"a\": {\n }\n}"
Is there a reason for adding an extra
\nwhen parsing an empty hash?jsonis not adding it and it creates some issues when diff-ing pretty jsons generated withjsonandyajl-ruby.