merge.js 484 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = merge;
  6. function merge() {
  7. var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8. var defaults = arguments.length > 1 ? arguments[1] : undefined;
  9. for (var key in defaults) {
  10. if (typeof obj[key] === 'undefined') {
  11. obj[key] = defaults[key];
  12. }
  13. }
  14. return obj;
  15. }
  16. module.exports = exports.default;
  17. module.exports.default = exports.default;