all files / src/utils/ merge.js

16.67% Statements 2/12
0% Branches 0/6
0% Functions 0/1
10% Lines 1/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                                 
export default function(target, ...sources) {
  for (let i = 0; i < sources.length; i++) {
    let source = sources[i] || {};
    for (let prop in source) {
      if (source.hasOwnProperty(prop)) {
        let value = source[prop];
        if (value !== undefined) {
          target[prop] = value;
        }
      }
    }
  }
 
  return target;
};