- Fix
Object.create(null)
not being recognized as object.
- BREAKING: deprecated the
JSONValue
type, use generics instead. - Implement generics, improving the TypeScript experience.
- Drop official support for Node.js 16.
- Fix #2: the
main
field not pointing to the CommonJS version of the library. - Fix UMD export not correctly exporting to
window.immutableJSONPatch
in the browser. - Drop official support for Nodejs 14.
- Add
exports
object to package.json to improve support different bundlers.
- Fix helper function
existsIn
not handling recursive paths containingnull
.
- Exports a new utility function
transform
.
- BREAKING: Type
JSONData
has been renamed toJSONValue
. - BREAKING: The optional property
json
in the returned objects from callbacksJSONPatchOperations.before
andRevertJSONPatchOptions.before
has been renamed todocument
. - Fixed
isJSONObject
returning true for class instances.
- Mark the package as side-effects free, allowing better optimization in bundlers.
- BREAKING: Changed the
"main"
field inpackage.json
to point to the ES Module entry point instead of CommonJS. - BREAKING: Converted the source code to TypeScript. There are some subtle changes in the TypeScript definitions of util functions.
- Implemented two new typeguard functions:
isJSONObject
andisJSONArray
.
- BREAKING: the
before
andafter
hooks of the functionimmutableJSONPatch
now pass aJSONPatchOperation
instead of aPreprocessedJSONPatchOperation
. - BREAKING: dropping function
parseJSONPointerWithArrayIndices
(introduced in v2.0.0) again, and changingJSONPath
to always return an array with strings. Reason is that a mix of strings and numbers is fragile. It leads to bad usage patterns and can easily cause bugs. - Implement a
before
callback forrevertJSONPatch
. - Export utility functions
parsePath
andparseFrom
,isJSONPatchOperation
,isJSONPatchAdd
,isJSONPatchRemove
,isJSONPatchReplace
,isJSONPatchCopy
,isJSONPatchMove
,isJSONPatchTest
.
- Fix broken link to TypeScript definitions.
- Improved TypeScript definitions (there are some breaking changes).
- Implemented new util functions:
compileJSONPointerProp
,startsWithJSONPointer
,appendToJSONPointer
, andparseJSONPointerWithArrayIndices
.
- Fix move operation from a nested property to the root not working when the root is an array.
- Fix revert operation of operation
move
not correct when moving a child object to the root.
- Expose util functions
parseJSONPointer
,compileJSONPointer
,getIn
,setIn
,updateIn
,deleteIn
,existsIn
, andinsertAt
.
- Initial release.