Open tomalec opened 5 years ago
I vote for option 2 with clarification in JSONPatcherProxy and Palindrom docs.
Reasoning: Anyone who uses numbers above MAX_SAFE_INTEGER
in JavaScript should expect the unexpected. Since JS can't recognize a difference between two numbers, I don't think that JSONPatcherProxy
or Palindrom
should do that either.
Option 1 would be a performance degradation.
@warpech, @eriksunsol https://github.com/Palindrom/JSONPatcherProxy/pull/45 changes Palindrom behavior in respect of numbers
> Number.MAX_SAFE_INTEGER
. This change checks thatNumber.MAX_SAFE_INTEGER == Number.MAX_SAFE_INTEGER +1 // true
and do not emit a patch, therefore such error is not cough by Palindrom's validation. And the tests that are failing are:WDYT of
JSONPatcherProxy
?as I cannot think of any other solution.
You can check the behavior at https://github.com/Palindrom/Palindrom/compare/update-deps?expand=1 https://travis-ci.org/Palindrom/Palindrom/builds/581106763