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.
17 lines
445 B
17 lines
445 B
2 years ago
|
var isUndef = require('./isUndef');
|
||
|
var each = require('./each');
|
||
|
exports = function(keysFn, defaults) {
|
||
|
return function(obj) {
|
||
|
each(arguments, function(src, idx) {
|
||
|
if (idx === 0) return;
|
||
|
var keys = keysFn(src);
|
||
|
each(keys, function(key) {
|
||
|
if (!defaults || isUndef(obj[key])) obj[key] = src[key];
|
||
|
});
|
||
|
});
|
||
|
return obj;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
module.exports = exports;
|