search () {
    this.log.debug('Now looking for apidoc config files');
    // possible sources of information
    const sources = [
      'package.json',
      'apidoc.json',
      'apidoc.config.js',
    ];

    // create a new object because javascript will not assign value
    const config = Object.assign({}, defaultConfig);

    // loop the three possible source of information to try and find packageInfo
    sources.forEach(configFile => {
      this.log.debug(`Now looking for ${configFile}`);
      // first look in cwd dir
      Object.assign(config, this.findConfigFileInDir(configFile, process.cwd()));
      // scan each source dir to find a valid config file
      this.opt.src.forEach(dir => {
        Object.assign(config, this.findConfigFileInDir(configFile, dir));
      });
    });
    if (_.isEqual(config, defaultConfig)) {
      this.log.warn('No config files found.');
    }
    return config;
  }
/**
   * Look for config files in input folder
   */
Look for config files in input folder
Look for config files in input folder
search () {
    this.log.debug('Now looking for apidoc config files');
    const sources = [
      'package.json',
      'apidoc.json',
      'apidoc.config.js',
    ];
    const config = Object.assign({}, defaultConfig);
    sources.forEach(configFile => {
      this.log.debug(`Now looking for ${configFile}`);
      Object.assign(config, this.findConfigFileInDir(configFile, process.cwd()));
      this.opt.src.forEach(dir => {
        Object.assign(config, this.findConfigFileInDir(configFile, dir));
      });
    });
    if (_.isEqual(config, defaultConfig)) {
      this.log.warn('No config files found.');
    }
    return config;
  }
search ( ) { this . log . debug ( 'Now looking for apidoc config files' ) ; const sources = [ 'package.json' , 'apidoc.json' , 'apidoc.config.js' , ] ; const config = Object . assign ( { } , defaultConfig ) ; sources . forEach ( configFile => { this . log . debug ( ` ${ configFile } ` ) ; Object . assign ( config , this . findConfigFileInDir ( configFile , process . cwd ( ) ) ) ; this . opt . src . forEach ( dir => { Object . assign ( config , this . findConfigFileInDir ( configFile , dir ) ) ; } ) ; } ) ; if ( _ . isEqual ( config , defaultConfig ) ) { this . log . warn ( 'No config files found.' ) ; } return config ; }
Look for config files in input folder
Look for config files in input folder
// possible sources of information // create a new object because javascript will not assign value // loop the three possible source of information to try and find packageInfo // first look in cwd dir // scan each source dir to find a valid config file