Gathering detailed insights and metrics for tiny-merge-patch
Gathering detailed insights and metrics for tiny-merge-patch
Gathering detailed insights and metrics for tiny-merge-patch
Gathering detailed insights and metrics for tiny-merge-patch
@hutechtechnical/nobis-ex-dolor-reprehenderit
The tiny, regex powered, lenient, _almost_ spec-compliant JavaScript tokenizer that never fails.
@ryniaubenpm2/incidunt-sunt-provident
Tiny, isomorphic convenience wrapper around the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) aiming to reduce boilerplate, especially when sending and receiving JSON.
@a-2-c-2-anpm/iste-explicabo-maxime
A tiny but capable push & pull stream library for TypeScript and Flow, loosely following the [callbag spec](https://github.com/callbag/callbag)
@xdanangelxoqenpm/itaque-blanditiis-laboriosam
A tiny but capable push & pull stream library for TypeScript and Flow, loosely following the [callbag spec](https://github.com/callbag/callbag)
An FP-ready implementation of the JSON Merge Patch RFC 7396
npm install tiny-merge-patch
Typescript
Module System
Node Version
NPM Version
99.3
Supply Chain
99.4
Quality
75.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
4 Stars
179 Commits
1 Forks
2 Watchers
27 Branches
3 Contributors
Updated on Nov 03, 2023
Latest Version
0.1.2
Package Id
tiny-merge-patch@0.1.2
Size
3.77 kB
NPM Version
2.15.11
Node Version
4.8.4
Published on
Oct 09, 2017
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
An implementation of the JSON Merge Patch RFC 7396: a standard format used to describe modifications to JSON documents.
This library complies with the functional programming style: it does not mutate the original target, but recycles what it can.
tiny-merge-patch
passes all RFC 7396 tests.
Install the current version (and save it as a dependency):
1npm install tiny-merge-patch --save
1// Fetch `apply` from the module. 2const mergePatch = require('tiny-merge-patch').apply;
1// `apply` is also the default export. 2import mergePatch from 'https://unpkg.com/tiny-merge-patch/esm/index.js'
1// Original document / object. 2const doc = { 3 a: 'b', 4 c: { d: 'e', f: 'g' }, 5 h: { i: 0 } 6}; 7 8// JSON merge patch to apply. 9const patch = { 10 a: 'z', 11 c: { f: null } // null marks deletions. 12}; 13 14// Apply the patch. 15const patchedDoc = mergePatch(doc, patch); 16 17// tiny-merge-patch complies with the RFC specification. 18assert.deepEqual(patchedDoc, { 19 a: 'z', 20 c: { d: 'e' }, 21 h: { i: 0 }, 22}); 23 24// Additionally, it does not mutate the original document... 25assert(patchedDoc !== doc); 26 27// ...nor its content... 28assert(patchedDoc.c !== doc.c); 29 30// ...but recycles what it can. 31assert(patchedDoc.h === doc.h);
json-merge-patch
(from which this library is forked)
All are in-place.
To avoid mutations of the original object, one can deep-clone beforehand, but it can be expensive.
At the contrary, tiny-merge-patch
does not alter any of its arguments—but
recycles what it can.
Recycling also allows efficient strict identity-based memoization
(used by React's PureComponent for example).
All of the above libraries also embed additional functionalities, such as patch generation from two objects or merge of patches.
tiny-merge-patch
only focuses on the IETF standard and on patch applications.
(None of the above libraries are particularly big.
Still, tiny-merge-patch
is smaller if you only need to apply patches.
It is also worth mentioning that unlike
JSON patches, there is no way to
implement merge of merge patches that reliably preserves deletion.)
JSON merge patch implementation for Immutable.js.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
76 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More