Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
deep-clone
Advanced tools
Readme
Deep cloning of data.
$ npm i -S deep-clone
deepClone(obj, [stringFormatter])
Recursively clone nested objects and arrays containing primitive data or nested objects and arrays containing primitive data. Clones Date
objects too.
import deepClone from 'deep-clone'
const foo = { bar: 'baz' }
const fooClone = deepClone(foo)
assert.deepEqual(foo, fooClone)
assert.notEqual(foo, fooClone)
const arr = [{ foo: 'bar'}, { baz: 'qux'}]
const arrClone = deepClone(arr)
assert.deepEqual(arr, arrClone)
assert.notEqual(arr, arrClone)
Deep clone an Object or Array and format the keys.
import camelCase from 'camelcase'
import deepClone from 'deep-clone'
const foo = { bar_baz: 'qux' }
const fooClone = deepClone(foo, camelCase)
assert.deepEqual(fooClone, { barBaz: 'qux' })
Or...
import camelCase from 'camelcase'
import { formatKeys } from 'deep-clone'
const camelKeys = formatKeys(camelCase)
const arr = [{ foo_bar: 'baz' }, { qux_quux: 'corge' }]
const camelClone = camelKeys(arr)
assert.deepEqual(camelClone, [{ fooBar: 'baz' }, { quxQuux: 'corge' }])
Circular references are handled using a Map.
const foo = { bar: 'baz' }
foo.qux = [foo]
const clone = deepClone(foo)
assert.deepEqual(clone, foo)
assert.equal(clone.qux[0], clone)
Other options:
FAQs
Deep cloning of Arrays and plain Objects.
We found that deep-clone 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.