https://github.com/nodesource/ah-deep-clone
Creates a deep clone of a map of collected async hooks activities.
https://github.com/nodesource/ah-deep-clone
Last synced: 4 months ago
JSON representation
Creates a deep clone of a map of collected async hooks activities.
- Host: GitHub
- URL: https://github.com/nodesource/ah-deep-clone
- Owner: nodesource
- License: mit
- Created: 2017-01-20T20:05:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-01T17:12:35.000Z (almost 9 years ago)
- Last Synced: 2024-12-17T04:23:12.686Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://nodesource.github.io/ah-deep-clone
- Size: 1.12 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ah-deep-clone [](http://travis-ci.org/nodesource/ah-deep-clone)
Creates a deep clone of a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) of collected async hooks activities.
```js
const deepClone = require('ah-deep-clone')
const copy = deepClone(activities)
```
## Installation
npm install ah-deep-clone
## API
### ahDeepClone
Clones the activities passed to it.
Any modifications applied to the original won't be visible in the copy.
This includes additions/removals to the original Map
**Parameters**
- `activities` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** to be cloned
Returns **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** cloned activities
## License
MIT