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

Sorting keys on multi-line object does not work without "short" #22

Closed Phrogz closed 7 years ago

Phrogz commented 7 years ago
// correct
neatJSON( {b:0,a:9,c:5}, {wrap:1, sort:true, short:true} );
// {"a":9,
//  "b":0,
//  "c":5}

// broken
neatJSON( {b:0,a:9,c:5}, {wrap:1, sort:true} );
// {
//   "b":0,
//   "a":9,
//   "c":5
// }

EXPECTED:

// {
//   "a":9,
//   "b":0,
//   "c":5
// }