Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@ungap/structured-clone
Advanced tools
The @ungap/structured-clone package provides a polyfill for the structuredClone function, which allows for deep cloning of objects, including complex types that are not handled by JSON serialization, such as Dates, Maps, Sets, etc. This functionality is particularly useful for copying values where a simple reference copy is not sufficient or desired.
Cloning complex objects
This feature allows for the deep cloning of complex objects, including those containing types that cannot be cloned using JSON methods. It's useful for duplicating objects that include nested structures, Dates, Maps, Sets, etc., without the original object being affected by changes to the clone.
const clonedObject = structuredClone(originalObject);
The 'clone' package offers deep cloning of objects and supports circular references. Unlike @ungap/structured-clone, it does not rely on the structuredClone API and provides more customization options for cloning behaviors but might not handle all modern JavaScript types as seamlessly.
Provided by the Lodash library, lodash.clonedeep performs a deep clone of an object. While it is very effective for a wide range of JavaScript objects, it may not support cloning of newer types such as Blobs or FileLists as directly as @ungap/structured-clone does, focusing instead on compatibility with a wide range of JavaScript environments.
FAQs
A structuredClone polyfill
The npm package @ungap/structured-clone receives a total of 19,689,170 weekly downloads. As such, @ungap/structured-clone popularity was classified as popular.
We found that @ungap/structured-clone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.