Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
diff-immutability-helper
Advanced tools
Creates a diff between 2 javascript objects / variables, in a format that is compatible with immutability-helper
Creates a diff between 2 JavaScript objects, allowing you to mutate one object to another using immutability-helper
diff-immutability-helper
creates an immutability-helper compatible diff object between 2 JavaScript variables.
This diff object would then allow you to mutate the base object to the target object.
$ npm install diff-immutability-helper --save
Given:
import diff from 'diff-immutability-helper';
const base = {
a: [1, 2, { b: 1 }, 4, 5, 6],
b: 'test',
c: 'prev'
};
const target = {
a: [1, 2, { b: 2 }, 4, 6],
b: 'test 2',
d: 'new'
};
const change = diff(base, target);
will give a result of:
const change = {
a: {
$splice: [[4, 1], [2, 1, { b: 2 }]]
},
b: {$set: 'test 2'},
$apply: (v) => omit(v, ['c']),
$merge: {
d: 'new'
}
}
thus, we can then do:
import update from 'immutability-helper';
update(base, change); // to match target
diff-immutability-helper
is MIT licensed
FAQs
Creates a diff between 2 javascript objects / variables, in a format that is compatible with immutability-helper
The npm package diff-immutability-helper receives a total of 81 weekly downloads. As such, diff-immutability-helper popularity was classified as not popular.
We found that diff-immutability-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.