Skip to content

Releases: Starcounter-Jack/JSON-Patch

3.1.1

24 Mar 18:51
Compare
Choose a tag to compare

Security Fix for Prototype Pollution - huntr.dev #262

Bug fixes and ES6 modules

13 Aug 10:06
Compare
Choose a tag to compare

Use ES6 Modules

  • package now exports non-bundled ES module #232
  • main still points to CommonJS module for backward compatibility
  • README recommends use of named ES imports

List of changes
v2.2.1...3.0.0-0

Use ES6 Modules

22 Aug 10:33
Compare
Choose a tag to compare
Use ES6 Modules Pre-release
Pre-release
  • package now exports non-bundled ES module #232
  • main still points to CommonJS module for backward compatibility
  • README recommends use of named ES imports

Full list of changes
v2.2.1...3.0.0-0

Fix default import

09 Aug 08:53
Compare
Choose a tag to compare

This patch release fixes a regression introduced in 2.2.0, namely: the default import using ES6 with Webpack/Babel stopped working (#233).

This version fixes the problem by adding an explicit default import.

Generate invertible test operations

25 Jul 10:53
Compare
Choose a tag to compare

New feature:

  • Ability to generate test operations for original values in the first object, also known as "invertible" operations. Search fro the word invertible in README.md for details about usage (PR #228, PR #226).

Code quality:

  • Replace deep-equal with fast-deep-equal (PR #227)
  • Remove traces for support for legacy browsers which were broken since v2.0.7 (PR #229)
  • Fix testing framework

Enhancements and bug fixes

01 Apr 12:39
Compare
Choose a tag to compare
  • applyOperation and applyReducer now accept an optional index parameter. This param is used to create more elaborate error messages when invalid operations occur in your patches, #221.

  • Error messages are now nicely-formatted, they look like:

	The specified index MUST NOT be greater than the number of elements in the array
    name: OPERATION_VALUE_OUT_OF_BOUNDS
    index: 1
    operation: {
      "op": "add",
      "path": "/root/1",
      "value": "val"
    }
    tree: {
      "root": []
    }"
  • By default, prototype injection is not allowed and throws an error. If you want to pollute a prototype, you'll need to pass a flag banPrototypeModifications = false to all applyX functions. #219.
  • Bad behaviour when you replace an object with an array is now fixed. See #205.

Use Map and WeakMap to remove leaks and enhance performance

30 Aug 10:19
Compare
Choose a tag to compare

Performance improvements:

add op: 117% faster
remove op: 109% faster
replace: 112% faster
test: 131%
geneate: 110% faster

IE11 support is still 10/10.

IE versions lower than 11 are not supported anymore.

See #208 & #212

Minor fixes

16 Oct 14:01
Compare
Choose a tag to compare
  • Ignore tsconfig.json when publishing to NPM 5236d81, thanks @LinusU!
  • add param mutateDocument in function applyPatch that defaults to true. If you set it to false, your object will be cloned before applying any operations. 688be37, thanks @chochihim!

Support applying array properties

29 Aug 12:09
Compare
Choose a tag to compare

Earlier, setting array props wasn't possible:

var obj = [];

jsonpatch.applyPatch(obj, [{op: 'add', path: '/prop', value: 'arrayProp'}])

console.log(obj.prop); // --> undefined

Now it is.

Validate patches in applyPatch

03 Aug 11:17
Compare
Choose a tag to compare
  • Validate on applyPatch when validation is enabled (fix #186)