
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@magic/deep
Advanced tools
Work with deeply nested objects and arrays.
npm i --save --save-exact @magic/deep
// single function
import { equal, flatten, loop, merge } from '@magic/deep'
// object with all functions
import deep from '@magic/deep'
Currently implemented:
// test equality
deep.equal(['shallow', ['deep']], ['shallow', ['deep']])
// true
// alias
deep.equals, deep.eq
// test difference
deep.different(['shallow', ['deep']], ['shallow', ['deep']])
// false
// alias
deep.diff
// flatten a deeply nested array
deep.flatten(['shallow', ['deep']])
// ['shallow', 'deep']
// apply function add
const add = e => e + 1
// for each item
const items = [1, 2, [3]]
// using a deeply nested array
deep.loop(add, items)
// or
deep.loop(items, add)
// returns [2, 3, [4]]
// merge objects and arrays, with infinite recursion if needed.
// this can be slow...
deep.merge({ obj1Key: { val: 1 } }, { obj2Key: { val: 2 } } )
// { obj1Key: { val: 1}, obj2Key: { val: 2 } }
deep.merge({ key: { val: 1, str: 'test' } }, { key: { val: 2, str: 'overwritten' } })
// { key: { val: 2, str: 'overwritten' } }
use ecmascript modules instead of commonjs.
bump required node version to 14.2.0
update dependencies
update @magic/types to avoid circular dependency
update dependencies
update dependencies
update dependencies
update dependencies
update dependencies
update dependencies
update dependencies
...
FAQs
manipulate nested objects and arrays
We found that @magic/deep demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.