advance-json-merge
Advance json merge
- written in Typescript
- combination
Object.assign
method - can merge with any level
Installation
Node.js / Browserify
npm install advance-json-merge --save
var advanceMerge = ;
Global object
Include the pre-built script.
usage
var mergeWithLevel = ;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 = ; ; // level 1 merge const result = ; ; // level 2 merge const result = ; ; // level 3+ merge const levelNum = chance; const result = ; ;
使用说明
- 本工具并不会分析数组内部的对象属性,因此如果键值对的值是 数组,此时你将数组当成诸如
int
等原始值去理解;
Build & test
npm run build
npm test
document
npm run doc
then open the generated out/index.html
file in your browser.
License
MIT.