Skip to content

Commit

Permalink
Add note about ignoring changes above MAX_SAFE_INTEGER
Browse files Browse the repository at this point in the history
as suggested at #58 (comment)
  • Loading branch information
tomalec authored Sep 5, 2019
1 parent 27ea090 commit b5d4d0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ See the [ECMAScript spec](http://www.ecma-international.org/ecma-262/6.0/index.h

3. **Generated patches are not immutable**. The patches generated by JSONPatcherProxy contain reference to the profixied object as the patch `value`. You should either serialize the patch to JSON immediately or deep clone the value it if you want to process it later. If you don't do that, you run the risk that reading the patch will contain changes added after the patch was generated.

4. **Changes for Numbers above `Number.MAX_SAFE_INTEGER` are ignored**. To reduce patch generation noise, JSONPatcherProxy compares if the new value is the same (`===`) as the previous one if so, no patch is generated. Therefore, a change from `Number.MAX_SAFE_INTEGER + 1` to `Number.MAX_SAFE_INTEGER + 2` will not be effectively observed.

## Specs/tests

#### In browser
Expand Down

0 comments on commit b5d4d0a

Please sign in to comment.