JavaScript Arrays and Objects deep cloner for diox (but not only).
yarn add diox-cloner
// main.js
// --------------------------
import { deepMerge, deepCopy } from 'diox-cloner';
const objectA = {
propA: {
propAA: 'test',
},
propB: ['test'],
propC: 'test',
};
const objectB = {
propA: {
propAB: 'test',
},
propB: ['testB'],
propC: 'testB',
};
const objectACopy = deepCopy(objectA);
console.log(objectA === objectACopy, objectA.propA === objectACopy.propA); // false, false
const mergedObject = deepMerge(objectA, objectB);
console.log(mergedObject); // { propA: { propAA: 'test', propAB: 'test' }, propB: ['test, 'testB'], propC: 'testB' }
You can find the full API documentation here
See the Contribution guide
Copyright (c) Matthieu Jabbour.
Generated using TypeDoc