I was looking for JSON minifier libraries and this came up in my search. I tried it but surprisingly it wasn't working for some trivial JSON such as this:
{"a": 5}
The result it produces is still with a whitespace:
{"a": 5}
I started messing around and added a newline at the end of my trivial example and it started working!
{"a": 5}\n <- newline here
The result it produces now is correct:
{"a":5}
To make sure I wasn't missing something obvious, I edited tests.js and added these two test cases at the beginning of the file:
I was looking for JSON minifier libraries and this came up in my search. I tried it but surprisingly it wasn't working for some trivial JSON such as this:
The result it produces is still with a whitespace:
I started messing around and added a newline at the end of my trivial example and it started working!
The result it produces now is correct:
To make sure I wasn't missing something obvious, I edited
tests.js
and added these two test cases at the beginning of the file:When I run the tests, the first example succeeds but the second one fails:
I hope this was bug report was useful.
P.Krumins