index.js 277 B

12345678910111213
  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. };