lib/image-optim.js
function _reduceImageOptimFunc(prev, next) {
        return prev.then(function (res) {
            return Q.all(next.map(function (filename) {
                return modes[mode](new File(filename), algorithms, opts);
            }))
            .then(function (stepRes) {
                return res.concat(stepRes);
            });
        });
    }
function _reduceImageOptimFunc(prev, next) {
        return prev.then(function (res) {
            return Q.all(next.map(function (filename) {
                return modes[mode](new File(filename), algorithms, opts);
            }))
            .then(function (stepRes) {
                return res.concat(stepRes);
            });
        });
    }
function _reduceImageOptimFunc ( prev , next ) { return prev . then ( function ( res ) { return Q . all ( next . map ( function ( filename ) { return modes [ mode ] ( new File ( filename ) , algorithms , opts ) ; } ) ) . then ( function ( stepRes ) { return res . concat ( stepRes ) ; } ) ; } ) ; }
Helping reduce function
@param {Promise * OptimResult[]|LintResult[]} prev
@param {Promise * OptimResult[]|LintResult[]} next
@returns {Promise * OptimResult[]|LintResult[]}
Helping reduce function