Skip to content

Commit 272c5eb

Browse files
committed
Note collisions of multi-level proxification
1 parent 3a80335 commit 272c5eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ Whenever a value is set to `undefined` in JS, JSONPatcherProxy method `generate`
149149
150150
See the [ECMAScript spec](http://www.ecma-international.org/ecma-262/6.0/index.html#sec-json.stringify) for details.
151151

152+
## Limitations
153+
154+
1. **It mutates your original object**: During proxification, JSONPatcherProxy mutates the object you pass to it. Because it doesn't deep-clone for better performance. If you want your original object to remain untouched, please deep-clone before you pass it to the constructor.
155+
156+
2. **It does not support multi-level proxification**: During proxification, it recursively traverses the object and sets each property to its new proxified version. This means you can't proxyify an already proxified object because the original proxy will record proxification as a series of changes. And the emitted patches are unpredictable. Also, when you change a property from either one of the proxies, both of the proxies will emit patches in an undefined manner.
157+
152158
## Specs/tests
153159

154160
#### In browser

0 commit comments

Comments
 (0)