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

`trimTrailingZeros` with `short` removes opening bracket for wrapped arrays #33

Closed Phrogz closed 2 years ago

Phrogz commented 2 years ago
a = [1,2]
neatJSON(a,{ wrap:true, indent:"", decimals:3, trimTrailingZeros:true })
// [
// 1,
// 2
// ]

neatJSON(a,{ wrap:true, short:true, decimals:3, trimTrailingZeros:true });
// 1,
// 2]

Expected output:

[1,
 2]