zipson icon indicating copy to clipboard operation
zipson copied to clipboard

Incorrect result when compress nested empty object in template

Open mnsrv opened this issue 4 years ago • 2 comments

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
       }

mnsrv avatar Apr 09 '20 12:04 mnsrv

Good catch, let me have a look at the PR when I’m back home and get it merged. Thank you @mnsrv

jgranstrom avatar Apr 29 '20 13:04 jgranstrom

@jgranstrom any update about this topic?

rimiti avatar Nov 04 '20 14:11 rimiti