Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

promise-queue

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-queue - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

45

lib/index.js

@@ -136,3 +136,2 @@ /* global define, Promise */

var self = this;
if (this.pendingPromises >= this.maxPendingPromises) {

@@ -148,22 +147,30 @@ return false;

this.pendingPromises++;
resolveWith(item.promiseGenerator())
try {
this.pendingPromises++;
resolveWith(item.promiseGenerator())
// Forward all stuff
.then(function (value) {
// It is not pending now
self.pendingPromises--;
self._dequeue();
// It should pass values
item.resolve(value);
}, function (err) {
// It is not pending now
self.pendingPromises--;
self._dequeue();
// It should not mask errors
item.reject(err);
}, function (message) {
// It should pass notifications
item.notify(message);
});
.then(function (value) {
// It is not pending now
self.pendingPromises--;
// It should pass values
item.resolve(value);
self._dequeue();
}, function (err) {
// It is not pending now
self.pendingPromises--;
// It should not mask errors
item.reject(err);
self._dequeue();
}, function (message) {
// It should pass notifications
item.notify(message);
});
} catch (err) {
self.pendingPromises--;
item.reject(err);
self._dequeue();
}
return true;

@@ -170,0 +177,0 @@ };

@@ -5,3 +5,3 @@ {

"name": "promise-queue",
"version": "2.1.2",
"version": "2.2.0",
"contributors": [

@@ -8,0 +8,0 @@ {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc