lib/apply_hooks.js
function applyHooks(config, filename)
{
  // sort hooks short first + alphabetically
  Object.keys(this.hooks).sort(compareHooks).forEach(function(hook)
  {
    // in order to match hook should either the same length
    // as the filename or smaller
    if (filename.substr(0, hook.length) === hook)
    {
      config = this.hooks[hook].call(this, config);
    }
  }.bind(this));

  return config;
}
function applyHooks(config, filename)
{
  // sort hooks short first + alphabetically
  Object.keys(this.hooks).sort(compareHooks).forEach(function(hook)
  {
    // in order to match hook should either the same length
    // as the filename or smaller
    if (filename.substr(0, hook.length) === hook)
    {
      config = this.hooks[hook].call(this, config);
    }
  }.bind(this));

  return config;
}
function applyHooks ( config , filename ) { // sort hooks short first + alphabetically Object . keys ( this . hooks ) . sort ( compareHooks ) . forEach ( function ( hook ) { // in order to match hook should either the same length // as the filename or smaller if ( filename . substr ( 0 , hook . length ) === hook ) { config = this . hooks [ hook ] . call ( this , config ) ; } } . bind ( this ) ) ; return config ; }
Applies matched hooks

@param   {object} config - config object to apply hooks to
@param   {string} filename - base filename to match hooks against
@returns {object} - modified config object
Applies matched hooks