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

kgo

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kgo - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

10

kgo.js

@@ -40,3 +40,3 @@ var run = require('./run'),

if(defaultsDefined){
throw new Error('Defaults may be defined only once per kgo');
throw new Error('Defaults may be defined only once per kgo');
}

@@ -46,3 +46,3 @@

if(key in tasks){
throw new Error('A task is already defined for ' + key);
throw new Error('A task is already defined for ' + key);
}

@@ -70,3 +70,3 @@ results[key] = defaults[key];

if(names[i] in results){
throw new Error('A default with the same name as this task (' + names[i] + ') has already been set');
throw new Error('A default with the same name as this task (' + names[i] + ') has already been set');
}

@@ -81,3 +81,3 @@ }

if(typeof dependency !== 'string'){
throw new Error('dependency was not a string: ' + dependency + ' in task: ' + names);
throw new Error('dependency was not a string: ' + dependency + ' in task: ' + names);
}

@@ -88,3 +88,3 @@ });

if(name in tasks){
throw new Error('A task with the same name (' + name + ') is aready defined');
throw new Error('A task with the same name (' + name + ') is aready defined');
}

@@ -91,0 +91,0 @@

{
"name": "kgo",
"version": "2.1.0",
"version": "2.2.0",
"description": "Flow control the super easy way",

@@ -38,3 +38,6 @@ "main": "kgo.js",

]
},
"dependencies": {
"stack-slice": "^1.0.0"
}
}

@@ -1,3 +0,5 @@

var ignoreDependency = /^\!.+/,
errorTask = '*error';
var stackSlice = require('stack-slice'),
ignoreDependency = /^\!.+/,
errorDependency = /^\*/,
errorSymbol = '*';

@@ -25,2 +27,5 @@ function Step(task, args, done){

if(error){
if(error instanceof Error){
stackSlice(error, __dirname, true);
}
return this._done(error);

@@ -38,3 +43,3 @@ }

if(dependants){
var useError = dependants[0] === errorTask;
var useError = dependants[0] === errorSymbol;

@@ -46,3 +51,3 @@ if(useError && !error && dependants.length === 1){

for(var i = 0; i < dependants.length; i++) {
var isErrorDep = dependants[i] === errorTask,
var isErrorDep = dependants[i] === errorSymbol,
dependantName = dependants[i],

@@ -144,7 +149,7 @@ ignore = dependantName.match(ignoreDependency);

if(dependencyName !== errorTask && !(dependencyName in tasks) && !(dependencyName in results)){
if(dependencyName !== errorSymbol && !(dependencyName in tasks) && !(dependencyName in results)){
throw new Error('No task or result has been defined for dependency: ' + dependencyName);
}
return result || dependencyName === errorTask;
return result || dependencyName === errorSymbol;
}

@@ -151,0 +156,0 @@

@@ -276,3 +276,3 @@ var test = require('tape'),

})
(['*error', 'result'], function(error, result){
(['*', 'result'], function(error, result){
t.notOk(error);

@@ -292,3 +292,3 @@ t.ok(result);

})
(['*error', 'result'], function(error, result){
(['*', 'result'], function(error, result){
t.ok(error);

@@ -313,7 +313,7 @@ t.notOk(result);

})
(['*error', 'initial'], function(error, initial){
(['*', 'initial'], function(error, initial){
t.ok(initial);
t.notOk(error);
})
(['*error', 'result'], function(error, result){
(['*', 'result'], function(error, result){
t.ok(error);

@@ -338,3 +338,3 @@ t.notOk(result);

})
(['*error', 'initial', 'result'], function(error, initial, result){
(['*', 'initial', 'result'], function(error, initial, result){
t.ok(error);

@@ -355,6 +355,6 @@ t.notOk(initial);

})
(['*error', 'result'], function(error, result){
(['*', 'result'], function(error, result){
t.ok(error, 'result handler got error');
})
(['*error'], function(error){
(['*'], function(error){
t.ok(error, 'error only handler got error');

@@ -381,3 +381,3 @@ });

})
(['*error'], function(error){
(['*'], function(error){
t.fail();

@@ -401,3 +401,3 @@ });

})
(['*error', '!result'], function(error, shouldBeDoneFn){
(['*', '!result'], function(error, shouldBeDoneFn){
t.notOk(error);

@@ -470,2 +470,16 @@ t.equal(typeof shouldBeDoneFn, 'function');

);
});
test('must have argmuents', function(t){
t.plan(1);
function someTask(done){
done(new Error('bang'));
}
kgo
('someTask', someTask)
(['*'], function(error){
t.notOk(~error.stack.indexOf('kgo'));
});
});
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