clone-data

1.0.3 • Public • Published

Readme

Clone JS Objects without worrying about Circular data and key names not suitable for MongoDB

Details here

Use

npm install clone-data

const cloneData = require('clone-data');
...
let myData = cloneData.clone(oldData);
 
// encode / decode
let query = { $ne: true };
query = cloneData.encode(query); // { [$]ne: true }
query = cloneData.decode(query); // { $ne: true }

Origin

The code is based (or copied from):

https://github.com/winstonjs/winston-mongodb/blob/f0095206e9c27e903bd7e896822633bf47601030/lib/helpers.js

Original author

The original author for that code is Yurij Mikhalevich

Package Sidebar

Install

npm i clone-data

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

7.07 kB

Total Files

7

Last publish

Collaborators

  • nicoriesco