You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
381 B
23 lines
381 B
/**
|
|
* Merge object b with object a.
|
|
*
|
|
* var a = { foo: 'bar' }
|
|
* , b = { bar: 'baz' };
|
|
*
|
|
* merge(a, b);
|
|
* // => { foo: 'bar', bar: 'baz' }
|
|
*
|
|
* @param {Object} a
|
|
* @param {Object} b
|
|
* @return {Object}
|
|
* @api public
|
|
*/
|
|
|
|
exports = module.exports = function(a, b){
|
|
if (a && b) {
|
|
for (var key in b) {
|
|
a[key] = b[key];
|
|
}
|
|
}
|
|
return a;
|
|
};
|
|
|