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

async-if-else

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-if-else - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

index.js

@@ -29,3 +29,3 @@

else
elseStatement.apply(null, applyArguments);
elseStatement.apply(null, applyArguments);
}

@@ -45,3 +45,5 @@ }

var callback = args.pop();
callback.apply(null, args);
callback.apply(null, [null].concat(args));
}
{
"name": "async-if-else",
"version": "1.0.0",
"version": "1.0.1",
"description": "'conditional if to async control flow'",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,3 +18,19 @@ # async-if-else

what about if without else ?
```javascript
var async = require('async');
var require('async-if-else').extend(async);
async.waterfall([
async.constant({email: 'thiago@email.com', dogs: 2, money: 0, fun: 100 }),
async.if(emailExists, auditLogging),
publishToQueue
], handler);
```
#### Hey, if you found a BUG !

@@ -21,0 +37,0 @@ Amazing ! PR are always welcome

@@ -176,2 +176,16 @@ var test = require('tape');

test('invalid predicate and sync statement', function(t) {
async.waterfall([
async.constant({name: 'thiago'}),
async.if(falsyValidation, createAccount),
], verify);
function verify(err, result) {
t.notOk(err, 'there is no error');
t.equal(result.name, 'thiago', 'payload name is the same as initial');
t.notOk(result.id);
t.end();
}
});
test('must pass the result to next in chain after else statement', function(t){

@@ -178,0 +192,0 @@ async.waterfall([

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