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

Hash plus short formatting plus wrapping values incorrect. #1

Closed Phrogz closed 9 years ago

Phrogz commented 9 years ago
o = {hooo:42,whee:%w[yaaa oooo booy],zoop:"whoop"}
puts JSON.neat_generate(o,wrap:20,short:true)

Expected output:

{"hooo":42,
 "whee":["yaaa",
         "oooo",
         "booy"],
 "zoop":"whoop"}

Actual output:

{"hooo":42,
 "whee":["yaaa",
 "oooo",
 "booy"],
 "zoop":"whoop"}