Mixin the own and inherited properties of other objects onto the first object. Pass an empty object as the first arg to shallow clone.
If you only want to combine own-properties, use extend-shallow.
Install with npm
$ npm i mixin-object --save
Install with bower
$ bower install mixin-object --save
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'}
extend
but recursively copies only the missing properties/values to the target object.Object
constructor.Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2014-2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on July 05, 2015.