Palindrom / JSONPatcherProxy

ES6 proxy powered JSON Object observer that emits JSON patches when changes occur to your object tree.
94 stars 14 forks source link

JSONPatcherProxy is incombatible with external deep proxies #35

Open warpech opened 5 years ago

warpech commented 5 years ago

Steps to reproduce

  1. Have an object that has a deep structure
  2. Replace a subbranch in that object with a simple proxied version of that object

Expected result

JSONPatcherProxy should observe changes to that object as usual, i.e. with the same behavior as in the initial object.

Actual result

Some traps are set twice, also the replacement of the proxified object is detected as a replace operation.

I have an idea how to solve it using Symbol instead of Map. I am preparing a fix for that.