code: function setting(options) {
    var conf = {};
  
    if (options === null || typeof options !== 'object') {
      options = {};
    }
  
    for (var key in defaultSetting) {
      conf[key] = options[key] === undefined ? defaultSetting[key] : options[key];
    }
  
    conf.format = defaultFormat(['json', 'xml'].indexOf(conf.format.toLowerCase()));
  
    var prefix = conf.prefix;
    if ((typeof prefix === 'string' || util.isRegExp(prefix)) && !options.prefixPattern) {
      conf.prefixPattern = util.isRegExp(prefix) ? prefix : new RegExp(prefix);
    }
  
    if (conf.authenticate) {
      conf.deny = options.deny;
      conf.authenticatePattern = options.authenticatePattern || conf.prefixPattern;
  
      if (conf.authenticate.constructor.name !== 'GeneratorFunction') {
        console.error('authenticate should be a GeneratorFunction');
        conf.authenticate = false;
      }
      if (conf.deny.constructor.name !== 'GeneratorFunction') {
        console.error('deny should be a GeneratorFunction');
      }
    }
  
    return conf;
  }
docs: Set conf
  @param  {Object} options Options objest
  @return {Object}         Formated conf object
  @api private