Phrogz / NeatJSON

Pretty-print your JSON in Ruby, JS, or Lua with more power than JSON.stringify or JSON.pretty_generate
http://phrogz.net/JS/NeatJSON
MIT License
108 stars 19 forks source link

Wrong output for short:true with specific array of hashes #2

Closed Phrogz closed 9 years ago

Phrogz commented 9 years ago
o = { a:[ {x:"foo",y:"jim"}, {x:"bar",y:"jam"} ] }
puts JSON.neat_generate o, wrap:true, short:true

Expected output:

{"a":[{"x":"foo",
       "y":"jim"},
      {"x":"bar",
       "y":"jam"}]}

Actual output:

{"a":[{"x":"foo",
     [ "y":"jim"},
      {"x":"bar",
       "y":"jam"}]}