0.0.2 • Published 4 years ago

diox-cloner v0.0.2

Weekly downloads
20
License
-
Repository
github
Last release
4 years ago

diox-cloner

JavaScript Arrays and Objects deep cloner for diox (but not only).

Build Status Coverage Status npm version Downloads

Installation

yarn add diox-cloner

Usage

// 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' }

API documentation

You can find the full API documentation here

Contributing

See the Contribution guide

License

MIT

Copyright (c) Matthieu Jabbour.

0.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago