Mixin the own and inherited properties of other objects onto the first object. Pass an empty object as the first arg to shallow clone.
npm install mixin-object> Mixin the own and inherited properties of other objects onto the first object. Pass an empty object as the first arg to shallow clone.
Follow this project's author, Jon Schlinkert, for updates on this project and others.
Install with npm:
``sh`
$ npm install --save mixin-object
If you only want to combine own-properties, use extend-shallow.
`js
var mixin = require('mixin-object');
var obj = {c: 'c'};
var foo = mixin({a: 'a'}, {b: 'b'});
console.log(foo);
//=> {c: 'c', a: 'a', b: 'b'}
console.log(obj);
//=> {c: 'c'}
mixin({}, {a: 'a'}, {b: 'b'});
//=> {a: 'a', b: 'b'}
`
You might also be interested in these projects:
* assign-deep: Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… more | homepage object.")
* defaults-deep: Like extend but recursively copies only the missing properties/values to the target object. | extendObject but recursively copies only the missing properties/values to the target object."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* extend-shallow: Extend an object with the properties of additional objects. node.js/javascript util. | homepage
* for-in: Iterate over the own and inherited enumerable properties of an object, and return an object… more | false. JavaScript/Node.js"" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* for-own: Iterate over the own enumerable properties of an object, and return an object with properties… more | false. JavaScript/Node.js."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* is-plain-object: Returns true if an object was created by the constructor. | Object constructor."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* isobject: Returns true if the value is an object and not an array or null. | homepage
* merge-deep: Recursively merge values in a javascript object. | homepage
* mixin-deep: Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
_(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)_
To generate the readme, run the following command:
`sh`
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
`sh``
$ npm install && npm test
Jon Schlinkert
* github/jonschlinkert
* twitter/jonschlinkert
Copyright © 2017, Jon Schlinkert.
Released under the MIT License.
*
_This file was generated by verb-generate-readme, v0.6.0, on September 04, 2017._