toJSON() without pretty print


#1

how to convert to json, but without pretty print formatting:

{{{ toJSON(my_items) }}}

#2

What is pretty print? toJSON method is convert the object to a JSON string that’s all.


#3

I didn’t want this:

JSON.stringify(obj, null, 4)

so I wrote my custom and it’s done:

View.global('to_JSON', (obj) => JSON.stringify(obj))