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.

12 lines
277 B

1 month ago
  1. var clone = require('clone');
  2. module.exports = function(options, defaults) {
  3. options = options || {};
  4. Object.keys(defaults).forEach(function(key) {
  5. if (typeof options[key] === 'undefined') {
  6. options[key] = clone(defaults[key]);
  7. }
  8. });
  9. return options;
  10. };