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

awaitqueue

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awaitqueue - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

30

lib/index.js

@@ -39,3 +39,11 @@ "use strict";

close() {
if (this.closed)
return;
this.closed = true;
for (const pendingTask of this.pendingTasks) {
pendingTask.stopped = true;
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
}
// Enpty the pending tasks array.
this.pendingTasks.length = 0;
}

@@ -51,2 +59,4 @@ /**

return __awaiter(this, void 0, void 0, function* () {
if (this.closed)
throw new this.ClosedErrorClass('AwaitQueue closed');
if (typeof task !== 'function')

@@ -82,2 +92,4 @@ throw new TypeError('given task is not a function');

stop() {
if (this.closed)
return;
for (const pendingTask of this.pendingTasks) {

@@ -115,7 +127,3 @@ pendingTask.stopped = true;

return __awaiter(this, void 0, void 0, function* () {
if (this.closed) {
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
return;
}
// If stop() was called for this task, ignore it.
// If the task is stopped, ignore it.
if (pendingTask.stopped)

@@ -125,7 +133,3 @@ return;

const result = yield pendingTask.task();
if (this.closed) {
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
return;
}
// If stop() was called for this task, ignore it.
// If the task is stopped, ignore it.
if (pendingTask.stopped)

@@ -137,7 +141,3 @@ return;

catch (error) {
if (this.closed) {
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
return;
}
// If stop() was called for this task, ignore it.
// If the task is stopped, ignore it.
if (pendingTask.stopped)

@@ -144,0 +144,0 @@ return;

{
"name": "awaitqueue",
"version": "2.2.2",
"version": "2.2.3",
"description": "JavaScript utility to enqueue async tasks for Node.js and the browser",

@@ -5,0 +5,0 @@ "author": "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",

@@ -69,3 +69,15 @@ export type AwaitQueueOptions =

{
if (this.closed)
return;
this.closed = true;
for (const pendingTask of this.pendingTasks)
{
pendingTask.stopped = true;
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
}
// Enpty the pending tasks array.
this.pendingTasks.length = 0;
}

@@ -82,2 +94,5 @@

{
if (this.closed)
throw new this.ClosedErrorClass('AwaitQueue closed');
if (typeof task !== 'function')

@@ -123,2 +138,5 @@ throw new TypeError('given task is not a function');

{
if (this.closed)
return;
for (const pendingTask of this.pendingTasks)

@@ -166,10 +184,3 @@ {

{
if (this.closed)
{
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
return;
}
// If stop() was called for this task, ignore it.
// If the task is stopped, ignore it.
if (pendingTask.stopped)

@@ -182,10 +193,3 @@ return;

if (this.closed)
{
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
return;
}
// If stop() was called for this task, ignore it.
// If the task is stopped, ignore it.
if (pendingTask.stopped)

@@ -199,10 +203,3 @@ return;

{
if (this.closed)
{
pendingTask.reject(new this.ClosedErrorClass('AwaitQueue closed'));
return;
}
// If stop() was called for this task, ignore it.
// If the task is stopped, ignore it.
if (pendingTask.stopped)

@@ -209,0 +206,0 @@ return;

Sorry, the diff of this file is not supported yet

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