Comparing version 1.1.1 to 1.1.2
15
index.js
@@ -16,18 +16,19 @@ 'use strict'; | ||
this.length++ | ||
if (waiting) { | ||
if (waiting) | ||
waiting(item) | ||
} else { | ||
else | ||
this._items.push(item) | ||
} | ||
} | ||
Queue.prototype.pop = function(cb) { var self = this | ||
var item = this._items.shift() | ||
this.length-- | ||
if (item) | ||
if (this._items.length) { | ||
var item = this._items.shift() | ||
this.length-- | ||
return Promise.from(item).nodeify(cb) | ||
else | ||
} | ||
else { | ||
return new Promise(function(resolve, reject) { | ||
self._waiting.push(resolve) | ||
}).nodeify(cb) | ||
} | ||
} |
{ | ||
"name": "then-queue", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "a simple asynchronous queue", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,1 +22,5 @@ # then-queue | ||
### queue.length | ||
Amount of items in the queue. | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1552
29
26