Skip to content

Releases: Starcounter-Jack/JSON-Patch

Allow plain (prototype-less objects) usage

28 Jun 11:23
Compare
Choose a tag to compare
  • Fix #184 thanks @sgoll!
  • Add build command to avoid needing to install webpack and tsc globally.

Publish TypeScript definitions in the NPM package

03 Aug 11:23
Compare
Choose a tag to compare

Add prepublish script in package.json

03 Aug 11:24
Compare
Choose a tag to compare

To make sure JS files are freshly compiled before publishing NPM package.

Better API and cleaner exports

16 Jun 09:43
Compare
Choose a tag to compare
  • Include any API function individually by:
import { applyOperation } from 'fast-json-patch'
  • Remove deprecated apply, in favour of applyPatch and applyOperation.

Bug fix

11 Jan 09:51
Compare
Choose a tag to compare

Getting root using _get operation in apply function wasn't working.

Such as:

var patches = [{"op":"_get","path":""}]
jsonpatch.apply(doc, patches) // 1.2.0 throws on this call

This was fixed in 1.2.2.

Note: getValueByPointer is part of the API now and _get operation shouldn't be used.

Fix getValueByPointer, validate, copy and _get operations

01 Jun 09:26
Compare
Choose a tag to compare
  • Fix validate, it used to corrupt patches (#76).
  • Fix copy operation cross-referencing issue (#177).
  • Fix getValueByPointer bug when accessing root (#178).

Thanks @baranga!

Deprecate apply, introduce applyOperation, applyPatch and applyReducer

29 May 11:12
Compare
Choose a tag to compare

Added:

  • jsonpatch.applyOperation(): Applies single operation object operation on document.

  • jsonpatch.applyPatch(): Applies full patch array.

  • jsonpatch.applyReducer(): Applies single operation object operation on document. Ideal for patch.reduce.

  • jsonpatch.escapePathComponent(): Escapes json-pointer path component.

  • jsonpatch.unescapePathComponent(): Unescapes json-pointer path component.

  • jsonpatch.getValueByPointer(): Retrieves a value from a JSON document by a JSON pointer.

  • Added TEST_OPERATION_FAILED error, thrown when a test operation fails.

Deprecated

jsonpatch.apply(): In favor of applyPatch.

Changed

  • jsonpatch.validate() now accepts a third optional callback parameter validator that you can pass for custom validation.
  • Now you can opt-out of document mutating behaviour with applyOperation and applyPatch.
  • applyOperation and applyPatch functions now return OperationResult after applying your operations. It contains each operation result and final document state.
  • Validation behaviour is now slightly different.
  • Enhanced Typescript typings.

A more elaborate explanation is available in README.


Big thanks to @felixfbecker, he had major contributions in every step of this.

Better TS typings and minor fixes

05 May 08:01
Compare
Choose a tag to compare
  • Better JSDoc comments.
  • [TS] Patch operation typings now enforced (commit decebe7).
  • [TS] Observer interface implemented (commit decebe7).
  • Fixed hasUndefined bug #163 (commit 17b141b).

Big thanks to @MRamos62786 & @felixfbecker

npm package update

19 Apr 13:50
Compare
Choose a tag to compare

Publish d.ts file

Publish minified files

11 Jan 09:52
Compare
Choose a tag to compare
1.1.8

Version 1.1.8