
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
advance-json-merge
Advanced tools
[](https://opensource.org/licenses/mit-license.php) [](https://badge.fury.io/js/advance-json-merge)
Advance json merge
Object.assign
methodnpm install advance-json-merge --save
var advanceMerge = require('advance-json-merge');
Include the pre-built script.
<script src="./dist/index.umd.min.js"></script>
var { mergeWithLevel } = require('advance-json-merge');
const origin = {
e: {
a: {
c: 'o_c',
d: 'o_d'
},
b: {
e: 'o_e'
},
c: {
h: 'o_h'
},
d: {
j: 'o_j'
}
},
f: 1
};
const target = {
e: {
a: {
a: 't_a'
},
b: {
e: 't_e',
f: 't_f'
},
d: 2
},
f: {
a: {},
b: {
c: 't_c',
h: 't_h'
}
}
};
// level 0 merge
const result = mergeWithLevel(origin, target, 0);
expect(result).toEqual(target);
// level 1 merge
const result = mergeWithLevel(origin, target, 1);
expect(result).toEqual(Object.assign({}, origin, target));
// level 2 merge
const result = mergeWithLevel(origin, target, 2);
expect(result).toEqual({
e: {
a: {
a: 't_a'
},
b: {
e: 't_e',
f: 't_f'
},
c: {
h: 'o_h'
},
d: 2
},
f: {
a: {},
b: {
c: 't_c',
h: 't_h'
}
}
});
// level 3+ merge
const levelNum = chance.integer({ min: 3, max: 1000 });
const result = mergeWithLevel(origin, target, levelNum);
expect(result).toEqual({
e: {
a: {
a: 't_a',
c: 'o_c',
d: 'o_d'
},
b: {
e: 't_e',
f: 't_f'
},
c: {
h: 'o_h'
},
d: 2
},
f: {
a: {},
b: {
c: 't_c',
h: 't_h'
}
}
});
int
等原始值去理解;npm run build
npm test
npm run doc
then open the generated out/index.html
file in your browser.
MIT.
FAQs
[](https://opensource.org/licenses/mit-license.php) [](https://badge.fury.io/js/advance-json-merge)
We found that advance-json-merge 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
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.