zipson
zipson copied to clipboard
Incorrect result when compress nested empty object in template
I have two similar objects with empty object. When compressing with zipson part of state disappearing.
I wrote two tests in test/full/object.ts
:
it('nested empty object', function() {
testPackUnpack({ a: { 1: {} }, c: 42 })
})
it('nested empty object template', function() {
testPackUnpack({ a: { 1: {} }, b: { 1: {} }, c: 42 })
})
Second test is failing
1) object
nested empty template:
unpacked integrity
+ expected - actual
{
- "a": {}
- "b": {}
+ "a": {
+ "1": {}
+ }
+ "b": {
+ "1": {}
+ }
"c": 42
}
Good catch, let me have a look at the PR when I’m back home and get it merged. Thank you @mnsrv
@jgranstrom any update about this topic?