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.
 
 
 
 

14 lines
321 B

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