Closed bwl21 closed 8 years ago
This would be a reasonable formatting option, but not the only or default behavior.
Perhaps an option called indentClose:true
? indentLast:true
?
I've added this feature as indentLast
for JavaScript, indent_last
for Ruby. You can try it out at http://phrogz.net/JS/NeatJSON/
By the way, in case you haven't tried it, you might also prefer the "short" formatting mode (maybe along with some object/array padding). That makes it even easier to see where objects end.
var obj = ["foo","bar",{"dogs":42,"piggies":0,"cats":7},{"jimmy":[1,2,3,4,5],"jammy":3.14159265358979,"hot":"pajammy"}];
neatJSON(obj,{ wrap:30, short:true, aligned:true, padding:1, aroundColon:1 });
// [ "foo",
// "bar",
// { "dogs" : 42,
// "piggies" : 0,
// "cats" : 7 },
// { "jimmy" : [ 1,2,3,4,5 ],
// "jammy" : 3.14159265358979,
// "hot" : "pajammy" } ]
Thanks. Cool to make it an option.
Would e easier to read if the closing angle bracket is adjusted to the content