githubEdit

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.

If you only want to combine own-properties, use extend-shallowarrow-up-right.

Install

Install with npmarrow-up-right

$ npm i mixin-object --save

Install with bowerarrow-up-right

$ bower install mixin-object --save

Usage

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'}

Running tests

Install dev dependencies:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issuearrow-up-right

Author

Jon Schlinkert

License

Copyright © 2014-2015 Jon Schlinkertarrow-up-right Released under the MIT license.


This file was generated by verb-cliarrow-up-right on July 05, 2015.

Last updated