lib/detect-dependencies.js
function detectDependencies(config) {
  var allDependencies = {};

  if (config.get('dependencies')) {
    $._.assign(allDependencies, config.get('bower.json').dependencies);
  }

  if (config.get('dev-dependencies')) {
    $._.assign(allDependencies, config.get('bower.json').devDependencies);
  }

  if (config.get('include-self')) {
    allDependencies[config.get('bower.json').name] = config.get('bower.json').version;
  }

  $._.each(allDependencies, gatherInfo(config));

  config.set('global-dependencies-sorted', filterExcludedDependencies(
    config.get('detectable-file-types').
      reduce(function (acc, fileType) {
        if (!acc[fileType]) {
          acc[fileType] = prioritizeDependencies(config, '.' + fileType);
        }
        return acc;
      }, {}),
    config.get('exclude')
  ));

  return config;
}
function detectDependencies(config) {
  var allDependencies = {};

  if (config.get('dependencies')) {
    $._.assign(allDependencies, config.get('bower.json').dependencies);
  }

  if (config.get('dev-dependencies')) {
    $._.assign(allDependencies, config.get('bower.json').devDependencies);
  }

  if (config.get('include-self')) {
    allDependencies[config.get('bower.json').name] = config.get('bower.json').version;
  }

  $._.each(allDependencies, gatherInfo(config));

  config.set('global-dependencies-sorted', filterExcludedDependencies(
    config.get('detectable-file-types').
      reduce(function (acc, fileType) {
        if (!acc[fileType]) {
          acc[fileType] = prioritizeDependencies(config, '.' + fileType);
        }
        return acc;
      }, {}),
    config.get('exclude')
  ));

  return config;
}
function detectDependencies ( config ) { var allDependencies = { } ; if ( config . get ( 'dependencies' ) ) { $ . _ . assign ( allDependencies , config . get ( 'bower.json' ) . dependencies ) ; } if ( config . get ( 'dev-dependencies' ) ) { $ . _ . assign ( allDependencies , config . get ( 'bower.json' ) . devDependencies ) ; } if ( config . get ( 'include-self' ) ) { allDependencies [ config . get ( 'bower.json' ) . name ] = config . get ( 'bower.json' ) . version ; } $ . _ . each ( allDependencies , gatherInfo ( config ) ) ; config . set ( 'global-dependencies-sorted' , filterExcludedDependencies ( config . get ( 'detectable-file-types' ) . reduce ( function ( acc , fileType ) { if ( ! acc [ fileType ] ) { acc [ fileType ] = prioritizeDependencies ( config , '.' + fileType ) ; } return acc ; } , { } ) , config . get ( 'exclude' ) ) ) ; return config ; }
Detect dependencies of the components from `bower.json`.

@param  {object} config the global configuration object.
@return {object} config
Detect dependencies of the components from bower . json .