NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3430 most downloaded on npm
Fast implementation of JSON-Patch (RFC-6902) with duplex (observe changes) capabilities
Last release 5 years ago
no release in 18 months
Ships unpredictably
gaps range from 2 weeks to 1.9 years
Nearly every release is documented
notes for 40 of 44 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
46 releases · first in 2013
Security Fix for Prototype Pollution - huntr.dev #262
Security Fix for Prototype Pollution - huntr.dev #262
package now exports non-bundled ES module https://github.com/Starcounter-Jack/JSON-Patch/pull/232
Use ES6 Modules
main still points to CommonJS module for backward compatibilityList of changes https://github.com/Starcounter-Jack/JSON-Patch/compare/v2.2.1...3.0.0-0
One column per quarter.
Nothing published for this version
package now exports non-bundled ES module https://github.com/Starcounter-Jack/JSON-Patch/pull/232
main still points to CommonJS module for backward compatibilityFull list of changes https://github.com/Starcounter-Jack/JSON-Patch/compare/v2.2.1...3.0.0-0
This patch release fixes a regression introduced in 2.2.0, namely: the default import using ES6 with Webpack/Babel stopped working (https://github.com
This patch release fixes a regression introduced in 2.2.0, namely: the default import using ES6 with Webpack/Babel stopped working (https://github.com/Starcounter-Jack/JSON-Patch/issues/233).
This version fixes the problem by adding an explicit default import.
ab74905
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.
Ability to generate test operations for original values in the first object, also known as "invertible" operations. Search fro the word invertible in
New feature:
invertible in README.md for details about usage (PR #228, PR #226).Code quality:
deep-equal with fast-deep-equal (PR #227)applyOperation and applyReducer now accept an optional index parameter. This param is used to create more elaborate error messages when invalid operat
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, https://github.com/Starcounter-Jack/JSON-Patch/pull/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": []
}"
banPrototypeModifications = false to all applyX functions. https://github.com/Starcounter-Jack/JSON-Patch/pull/219.`js add op: 117% faster remove op: 109% faster replace: 112% faster test: 131% geneate: 110% faster `
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 https://github.com/Starcounter-Jack/JSON-Patch/issues/208 & https://github.com/Starcounter-Jack/JSON-Patch/pull/212
Ignore tsconfig.json when publishing to NPM https://github.com/Starcounter-Jack/JSON-Patch/commit/5236d81e647c037b9007f7c90fcd5b58377e2b90, thanks @Li
tsconfig.json when publishing to NPM https://github.com/Starcounter-Jack/JSON-Patch/commit/5236d81e647c037b9007f7c90fcd5b58377e2b90, thanks @LinusU!mutateDocument in function applyPatch that defaults to true. If you set it to false, your object will be cloned before applying any operations. https://github.com/Starcounter-Jack/JSON-Patch/commit/688be37248597d30b8e9a6125a18262f9a58b5d2, thanks @chochihim!Earlier, setting array props wasn't possible: ```js var obj = [];
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 on applyPatch when validation is enabled (fix https://github.com/Starcounter-Jack/JSON-Patch/issues/186)
applyPatch when validation is enabled (fix https://github.com/Starcounter-Jack/JSON-Patch/issues/186)Fix https://github.com/Starcounter-Jack/JSON-Patch/issues/184 thanks @sgoll!
webpack and tsc globally.Nothing published for this version
To make sure JS files are freshly compiled before publishing NPM package.
To make sure JS files are freshly compiled before publishing NPM package.
Remove deprecated apply, in favour of applyPatch and applyOperation.
import { applyOperation } from 'fast-json-patch'
apply, in favour of applyPatch and applyOperation.Getting root using _get operation in apply function wasn't working.
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 validate, it used to corrupt patches (https://github.com/Starcounter-Jack/JSON-Patch/issues/76).
getValueByPointer bug when accessing root (https://github.com/Starcounter-Jack/JSON-Patch/issues/178).Thanks @baranga!
jsonpatch.applyOperation(): Applies single operation object operation on document.
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.
jsonpatch.apply(): In favor of applyPatch.jsonpatch.validate() now accepts a third optional callback parameter validator that you can pass for custom validation.applyOperation and applyPatch.applyOperation and applyPatch functions now return OperationResult after applying your operations. It contains each operation result and final document state.A more elaborate explanation is available in README.
Big thanks to @felixfbecker, he had major contributions in every step of this.
[TS] Patch operation typings now enforced (commit https://github.com/Starcounter-Jack/JSON-Patch/commit/decebe74038184670fd60b37ebd8d9fca53b5bdb).
hasUndefined bug https://github.com/Starcounter-Jack/JSON-Patch/issues/163 (commit https://github.com/Starcounter-Jack/JSON-Patch/commit/17b141b37a69e1ffdc5d47ed0591a8ec4ccf1ee7).Big thanks to @MRamos62786 & @felixfbecker
Nothing published for this version
Nothing published for this version
Huge performance improvement for compare and generate of the same objects - https://github.com/Starcounter-Jack/JSON-Patch/pull/149 thanks to @KamranA
compare and generate of the same objects - https://github.com/Starcounter-Jack/JSON-Patch/pull/149 thanks to @KamranAsifFollow TS best practices #148 by @felixfbecker
generate now respects each node .toJSON method
generate now respects each node .toJSON method (https://github.com/Starcounter-Jack/JSON-Patch/pull/145 , thanks @EricBourland)` import jsonpatch from 'fast-json-patch'; `
Used as such:
import jsonpatch from 'fast-json-patch';
add dirty checking on "change" event
add dirty checking on "change" event (https://github.com/PuppetJs/PuppetJs/issues/106)
This becomes obsolete when we switch to ES6 Proxy, but it will take some time still
add CLI tests and benchmark, integrate with Travis CI
Fixed: - #83 compare function does not distinguish between 0 and empty string - by @mweathers (https://github.com/Starcounter-Jack/JSON-Patch/pull/131
Fixed:
Validate now check for paths that does not start with / - https://github.com/Starcounter-Jack/JSON-Patch/issues/77
Validate now check for paths that does not start with / - https://github.com/Starcounter-Jack/JSON-Patch/issues/77
Restore observing keydown and mousedown events. So it aligns with already supported keyup and mouseup - PuppetJs/PuppetJs#98
keydown and mousedown events.
So it aligns with already supported keyup and mouseup - PuppetJs/PuppetJs#98
(https://github.com/Starcounter-Jack/JSON-Patch/commit/924069918a7033849c1e61e793488b506f1849c1)PS. command line tests are not running due to https://github.com/jasmine/jasmine-npm/issues/88
OriginalEvent and __extends globals were moved to local scope - https://github.com/Starcounter-Jack/JSON-Patch/issues/120
OriginalEvent and __extends globals were moved to local scope - https://github.com/Starcounter-Jack/JSON-Patch/issues/120 (https://github.com/Starcounter-Jack/JSON-Patch/commit/481efa471b8e82d0e963c6d5115ec94a02e191e8)//# sourceMappingURL=json-patch-duplex.js.map line was removed from compiled JS files - https://github.com/Starcounter-Jack/JSON-Patch/issues/117 https://github.com/Starcounter-Jack/JSON-Patch/commit/8d0666bd74b0ae9aee6eac415184f1cd0686f53d
change the way how undefined value is JS object is treated. Now, it will act as in JSON.stringify. See https://github.com/Starcounter-Jack/JSON-Patch#
undefined value is JS object is treated. Now, it will act as in JSON.stringify. See https://github.com/Starcounter-Jack/JSON-Patch#undefineds-js-to-json-projection for details (closes #105, #90, #60, #32)mouseup and keyup events trigger dirty checking. There is no additional interval-based checking (#103, #98)_objectKeys method in json-patch and json-patch-duplex (https://github.com/Starcounter-Jack/JSON-Patch/issues/85)apply. Now it's an array with results of respective patches. Test results are booleans, replace, move and remove operations has removed elemnts as results.Completely remove Object.observe (https://github.com/Starcounter-Jack/JSON-Patch/issues/88). Now observe() only uses dirty checking
Object.observe (https://github.com/Starcounter-Jack/JSON-Patch/issues/88). Now observe() only uses dirty checkingunobserve (https://github.com/Starcounter/Starcounter/issues/3408)#85 - improve _objectKeys method
#85 - improve _objectKeys method
#84 - Fix dirty checking for array properties #82 - Remove Object.observe logic
#84 - Fix dirty checking for array properties
#82 - Remove Object.observe logic
#/74 - fix TypeError exception when patch.path is not defined
#/74 - fix TypeError exception when patch.path is not defined
add VALUE_OBJECT_CANNOT_CONTAIN_UNDEFINED validation
fixed replacing, coping, moving, and removing null values
added new method jsonpatch.validate (#29, #44)
jsonpatch.validate (#29, #44)validate in jsonpatch.applyjson-patch-duplex.js (#63)null (#35)renamed to Fast-JSON-Patch, the same name that was already used for Bower and NPM package name (fast-json-patch)
fast-json-patch)compare method no longer modifies the object passed as the first parameter (#52, #53)conform by 100% to a general JSON Patch test suite at https://github.com/json-patch/json-patch-tests
- in the path to append to an array (#23, #26)test/test operation failed of test if properties in two were ordered differently
expose method jsonpatch.compare for comparing two object trees
Feature:
jsonpatch.compare for comparing two object treesminified build now available in dist/ directory
use the new record type names that landed in Chrome Canary
Update:
issues with calling observe/unobserve method on an object multiple times in Chrome (native Object.observe)
Bugfix:
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →