Skip to content

Commit

Permalink
[fix] please the lint god
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaagie committed Jun 21, 2015
1 parent 55871af commit 7b00f1b
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions lib/minimize.js
Expand Up @@ -105,15 +105,22 @@ Minimize.prototype.traverse = function traverse(data, html, done) {
async.reduce(data, html, function reduce(html, element, step) {
var children;

//
// Run the registered plugins before the element is processed.
// Note that the plugins are not run in order.
//
if (!plugins.length) return enter();
async.eachSeries(plugins, function plug(plugin, next) {
debug('Running plugin for element %s', element.name);
minimize.plugins[plugin].element.call(minimize, element, next);
}, enter);
/**
* Close element in HTML.
*
* @param {Error} error
* @param {String} html
* @api private
*/
function close(error, html) {
if (error) {
debug('Error received by #close %s', error.message);
return step(error);
}

html += minimize.helpers.close(element);
step(null, html);
}

/**
* Enter element in HTML.
Expand All @@ -137,22 +144,15 @@ Minimize.prototype.traverse = function traverse(data, html, done) {
});
}

/**
* Close element in HTML.
*
* @param {Error} error
* @param {String} html
* @api private
*/
function close(error, html) {
if (error) {
debug('Error received by #close %s', error.message);
return step(error);
}

html += minimize.helpers.close(element);
step(null, html);
}
//
// Run the registered plugins before the element is processed.
// Note that the plugins are not run in order.
//
if (!plugins.length) return enter();
async.eachSeries(plugins, function plug(plugin, next) {
debug('Running plugin for element %s', element.name);
minimize.plugins[plugin].element.call(minimize, element, next);
}, enter);
}, done);
};

Expand Down

0 comments on commit 7b00f1b

Please sign in to comment.