4 ms·
How would it compress and then decompress the following document? {"users": [ {"first": "Homer", "last": "Simpson"}, {"first": "Hank", "last": "Hill"
by perfunctory 14y ago
How would it compress and then decompress the following document?
{"users": [
{"first": "Homer", "last": "Simpson"},
{"first": "Hank", "last": "Hill"},
[2, "Peter", "Griffin"]
}
- asdfaoeu 14y ago{ "users": [ { "first": "Homer", "last": "Simpson" }, [ 2, "Hank", "Hill" ], [ 0, 2, "Peter", "Griffin" ] ] } There was a tester linked from the site. Looks like he added the [0, to handle that case.
- dogada 14y agoYeah, for arrays with first numeric value is reserved schema with index 0. You can see more examples in the unit tests: https://github.com/dogada/RJSON/blob/master/test/tests.js https://github.com/dogada/RJSON/blob/master/test/tests.js
- jerf 14y agoUnit test suggestion: testPackAndUnpack should also check double-compress and double-decompress for being identical, it'll tend to find any remaining such issues, if any.
- dogada 14y agoThanks, jerf, done: https://github.com/dogada/RJSON/commit/0a7fc5dd9e142477ebda93f3197ea346a7aff13a https://github.com/dogada/RJSON/commit/0a7fc5dd9e142477ebda9...
- judofyr 14y agoThere's a demo here: http://www.cliws.com/p/rjson/ http://www.cliws.com/p/rjson/ It comes it to: { "users": [ { "first": "Homer", "last": "Simpson" }, [ 2, "Hank", "Hill" ], [ 0, 2, "Peter", "Griffin" ] ] }