
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
deep copy data
$ npm install deepcopy
const deepcopy = require('deepcopy');
import * as deepcopy from 'deepcopy';
<script src="deepcopy.min.js"></script>
basic usage:
const src = {
desserts: [
{ name: 'cake' },
{ name: 'ice cream' },
{ name: 'pudding' }
]
};
const dist = deepcopy(src);
src.desserts = null;
console.log(src); // { desserts: null }
console.log(dist); // { desserts: [ { name: 'cake' }, { name: 'ice cream' }, { name: 'pudding' } ] }
customize deepcopy:
function MyClass(id) {
this._id = id;
}
const src = {
myClasses: [
new MyClass(1),
new MyClass(2),
new MyClass(3)
]
};
const dest = deepcopy(base, {
customizer(value) {
if (target.constructor === MyClass) {
return new MyClass(target._id);
}
}
});
src.myClasses = null;
console.log(src); // { myClasses: null }
console.log(dest); // { myClasses: [ MyClass { _id: 1 }, MyClass { _id: 2 }, MyClass { _id: 3 } ] }
value
*
options
Object|Function
Object - pass optionsFunction - use as customize functionreturn
* - copied value| type | operation | |
|---|---|---|
| ArrayBuffer | deep copy | |
| Boolean | deep copy | |
| Buffer | deep copy | node.js only |
| DataView | deep copy | |
| Date | deep copy | |
| Number | deep copy | |
| RegExp | deep copy | |
| String | deep copy | |
| Float32Array | deep copy | |
| Float64Array | deep copy | |
| Int16Array | deep copy | |
| Int32Array | deep copy | |
| Int8Array | deep copy | |
| Uint16Array | deep copy | |
| Uint32Array | deep copy | |
| Uint8Array | deep copy | |
| Uint8ClampedArray | deep copy | |
| boolean | deep copy | |
| null | deep copy | |
| number | deep copy | |
| string | deep copy | |
| symbol | deep copy | |
| undefined | deep copy | |
| Arguments | deep copy | recursively, copy as Array |
| Array | deep copy | recursively |
| Map | deep copy | recursively |
| Object | deep copy | recursively |
| Set | deep copy | recursively |
| Array Iterator | shallow copy | |
| Map Iterator | shallow copy | |
| Promise | shallow copy | |
| Set Iterator | shallow copy | |
| String Iterator | shallow copy | |
| function | shallow copy | |
| global | shallow copy | window, global, self, etc. |
| WeakMap | shallow copy | |
| WeakSet | shallow copy |
The MIT license.
Lodash is a popular utility library that provides a wide range of functions for manipulating arrays, objects, and other data types. It includes a `cloneDeep` function that performs deep copying similar to `deepcopy`. However, Lodash offers many additional utilities beyond deep copying.
The 'rfdc' (Really Fast Deep Clone) package is designed for performance and provides a very fast way to deep clone objects. It is similar to `deepcopy` in functionality but is optimized for speed.
The 'clone-deep' package is another utility for deep cloning objects and arrays. It is similar to `deepcopy` but offers additional options for customizing the cloning process.
FAQs
deep copy data
The npm package deepcopy receives a total of 151,873 weekly downloads. As such, deepcopy popularity was classified as popular.
We found that deepcopy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.