2017-08-12 22:33:13 +08:00

16 lines
354 B
JavaScript

export default function(target, ...sources) {
for (let i = 0; i < sources.length; i++) {
const source = sources[i] || {};
for (const prop in source) {
if (source.hasOwnProperty(prop)) {
const value = source[prop];
if (value !== undefined) {
target[prop] = value;
}
}
}
}
return target;
};