Skip to content

Commit

Permalink
Add note to README about hidden Date deserialization change
Browse files Browse the repository at this point in the history
  • Loading branch information
briancavalier committed Dec 8, 2014
1 parent b53d677 commit e97264d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ var b = jiff.clone(a);

Creates a deep copy of `a`, which must be a valid JSON object/array/value.

**NOTE:** In jiff <= 0.6.x, `jiff.clone` incorrectly caused some ISO Date-formatted strings (eg `"2014-12-03T11:40:16.816Z"`) to be turned into `Date` objects. Thus, a clone *might not end up as an exact copy*.

That was fixed in 0.7.0: `jiff.clone` creates exact copies.

If you have code that depended on that hidden deserialization, *it will break*. Date deserialization is now the responsibility of the party who parsed the JSON string from which the original object/array/etc. (ie, the one passed to `jiff.clone`) was created.

### Patch context

As of v0.2, `jiff.diff` and `jiff.patch` support [patch contexts](http://en.wikipedia.org/wiki/Diff#Context_format), an extra bit of information carried with each patch operation. Patch contexts allow smarter patching, especially in the case of arrays, where items may have moved and thus their indices changed.
Expand Down

0 comments on commit e97264d

Please sign in to comment.