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.

13 lines
334 B

  1. 'use strict';
  2. module.exports = function mergeOptions(defaults, options) {
  3. options = options || Object.create(null);
  4. return [defaults, options].reduce((merged, optObj) => {
  5. Object.keys(optObj).forEach(key => {
  6. merged[key] = optObj[key];
  7. });
  8. return merged;
  9. }, Object.create(null));
  10. };