diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-09-15 14:21:27 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-09-15 14:21:27 +0200 |
commit | 6732957e42350b3aefa4b1c80371baea92950651 (patch) | |
tree | 1605473bf22c7e4ab90a6cc9bebf5cb807fa1d90 /lib/utils/batch.js | |
parent | 5f56098ae7fae80a4dd75a944c38201560b480c6 (diff) | |
parent | 1fd00068595dfced5a0f16ac05ae2553d09608bc (diff) | |
download | gitbook-6732957e42350b3aefa4b1c80371baea92950651.zip gitbook-6732957e42350b3aefa4b1c80371baea92950651.tar.gz gitbook-6732957e42350b3aefa4b1c80371baea92950651.tar.bz2 |
Merge pull request #930 from GitbookIO/jshint
Add config for jshint and fix lint errors
Diffstat (limited to 'lib/utils/batch.js')
-rw-r--r-- | lib/utils/batch.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/utils/batch.js b/lib/utils/batch.js index bd3b80f..9069766 100644 --- a/lib/utils/batch.js +++ b/lib/utils/batch.js @@ -3,12 +3,12 @@ var _ = require("lodash"); // Execute a method for all element function execEach(items, options) { - if (_.size(items) == 0) return Q(); + if (_.size(items) === 0) return Q(); var concurrents = 0, d = Q.defer(), pending = []; options = _.defaults(options || {}, { max: 100, - fn: function(item) {} + fn: function() {} }); @@ -29,7 +29,7 @@ function execEach(items, options) { // Next pending var next = pending.shift(); - if (concurrents == 0 && !next) { + if (concurrents === 0 && !next) { d.resolve(); } else if (next) { startItem.apply(null, next); @@ -38,7 +38,7 @@ function execEach(items, options) { .fail(function(err) { pending = []; d.reject(err); - }) + }); } _.each(items, startItem); |