Socket
Socket
Sign inDemoInstall

mixin-deep

Package Overview
Dependencies
2
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mixin-deep

Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.


Version published
Weekly downloads
11M
decreased by-9.26%
Maintainers
1
Install size
30.9 kB
Created
Weekly downloads
 

Package description

What is mixin-deep?

The mixin-deep package is a utility for deeply mixing the properties of objects into the first object. It is useful for merging objects with nested properties, allowing for deep assignment and merging of object properties, arrays, and other nested structures.

What are mixin-deep's main functionalities?

Deep Merging of Objects

This feature allows for the deep merging of objects, including nested properties. The code sample demonstrates merging two objects with nested properties, resulting in a single object that combines both.

{"const mixinDeep = require('mixin-deep');\nconst object1 = { a: { b: { c: 1 } } };\nconst object2 = { a: { b: { d: 2 }, e: 3 } };\nconst result = mixinDeep(object1, object2);\nconsole.log(result); // Output: { a: { b: { c: 1, d: 2 }, e: 3 } }"}

Merging Arrays and Objects

This feature demonstrates how mixin-deep can merge both arrays and objects. The arrays are replaced rather than merged, while the objects are deeply merged.

{"const mixinDeep = require('mixin-deep');\nconst object1 = { a: [1, 2], b: { c: 1 } };\nconst object2 = { a: [3, 4], b: { d: 2 } };\nconst result = mixinDeep(object1, object2);\nconsole.log(result); // Output: { a: [3, 4], b: { c: 1, d: 2 } }"}

Other packages similar to mixin-deep

Readme

Source

mixin-deep NPM version

Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.

Install with npm

npm i mixin-deep --save

Usage

var mixinDeep = require('mixin-deep');

mixinDeep({a: {aa: 'aa'}}, {a: {bb: 'bb'}}, {a: {cc: 'cc'}});
//=> { a: { aa: 'aa', bb: 'bb', cc: 'cc' } }
  • assign-deep: Deeply assign the enumerable properties of source objects to a destination object. If a callback… more
  • extend-shallow: Extend an object with the properties of additional objects. node.js/javascript util.
  • merge-deep: Recursively merge values in a javascript object.

Running tests

Install dev dependencies:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on April 29, 2015.

Keywords

FAQs

Last updated on 30 Apr 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc