merge.js 316 B

123456789101112
  1. export default function merge() {
  2. var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3. var defaults = arguments.length > 1 ? arguments[1] : undefined;
  4. for (var key in defaults) {
  5. if (typeof obj[key] === 'undefined') {
  6. obj[key] = defaults[key];
  7. }
  8. }
  9. return obj;
  10. }