Comparing version
21
index.js
@@ -159,11 +159,26 @@ var util = require('util') | ||
function elseNoop(callback) { | ||
function elseNoop() { | ||
var callback = arguments[arguments.length - 1] | ||
if (typeof callback !== 'function') { | ||
throw new Error('expected a callback function') | ||
} | ||
setImmediate(callback) | ||
} | ||
function elseTrue(callback) { | ||
function elseTrue() { | ||
var callback = arguments[arguments.length - 1] | ||
if (typeof callback !== 'function') { | ||
throw new Error('expected a callback function') | ||
} | ||
callback(null, true) | ||
} | ||
function elseFalse(callback) { | ||
function elseFalse() { | ||
var callback = arguments[arguments.length - 1] | ||
if (typeof callback !== 'function') { | ||
throw new Error('expected a callback function') | ||
} | ||
callback(null, false) | ||
@@ -170,0 +185,0 @@ } |
{ | ||
"name": "if-async", | ||
"description": "", | ||
"version": "3.7.2", | ||
"version": "3.7.3", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "async" |
@@ -96,3 +96,3 @@ # if-async [](http://travis-ci.org/kessler/if-async) | ||
#### Consequent | ||
in the context of ifAsync and consequent is an async function that is invoked as a result of an evaluation of a predicate, e.g | ||
in the context of ifAsync a consequent is an async function that is invoked as a result of an evaluation of a predicate, e.g | ||
```javascript | ||
@@ -99,0 +99,0 @@ function consequent(callback) { |
22941
1.77%615
1.99%