Test JSON.minify()
test #1
// this is a JSON file with comments { "foo": "bar", // this is cool "bar": [ "baz", "bum", "zam" ], /* the rest of this document is just fluff in case you are interested. */ "something": 10, "else": 20 } /* NOTE: You can easily strip the whitespace and comments from such a file with the JSON.minify() project hosted here on github at http://github.com/getify/JSON.minify */
result #1
test #2
{"/*":"*/","//":"",/*"//"*/"/*/":// "//"}
result #2
test #3
/* this is a multi line comment */{ "foo" : "bar/*"// something , "b\"az":/* something else */"blah" }
result #3
test #4
{"foo": "ba\"r//", "bar\\": "b\\\"a/*z", "baz\\\\": /* yay */ "fo\\\\\"*/o" }
result #4