New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

timequeue

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timequeue - npm Package Compare versions

Comparing version
0.2.0
to
0.2.1
+7
-3
lib/index.js

@@ -111,3 +111,5 @@ var EventEmitter = require('events').EventEmitter

var tid = setTimeout(function taskTimeout() {
taskCallback(new Error('Task timed out'));
var err = new Error('Task timed out');
err.args = args;
taskCallback(err);
taskTimedOut = true;

@@ -158,5 +160,7 @@ }, timeout);

// add custom callback to args
args.push(taskCallback);
var args2 = args.slice();
args2.push(taskCallback);
this.worker.apply(null, args);
// call the worker
this.worker.apply(null, args2);
};

@@ -163,0 +167,0 @@

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

"keywords": ["queue", "flow", "time"],
"version": "0.2.0",
"version": "0.2.1",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -20,9 +20,11 @@ var TimeQueue = require('..')

describe('With tasks that lag', function() {
var q = new TimeQueue(function() {}, { timeout: 50 });
var q = new TimeQueue(function(a, b, callback) {}, { timeout: 50 });
it('Should throw an error', function(done) {
q.push();
q.push(3, 4);
q.on('error', function(err) {
assert(err);
assert.equal(err.message, 'Task timed out');
assert.equal(err.args[0], 3);
assert.equal(err.args[1], 4);
done();

@@ -32,6 +34,8 @@ });

it('Should call the callback with the error', function() {
q.push(function(err) {
it('Should call the callback with the error', function(done) {
q.push('hello!', 'world', function(err) {
assert(err);
assert.equal(err.message, 'Task timed out');
assert.equal(err.args[0], 'hello!');
assert.equal(err.args[1], 'world');
done();

@@ -38,0 +42,0 @@ });