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

if-async

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

if-async - npm Package Compare versions

Comparing version 3.7.3 to 3.7.4

21

index.js

@@ -79,3 +79,3 @@ var util = require('util')

.then(fn)
.else(elseFalse)
.else(callbackFalse)
)

@@ -95,6 +95,6 @@

ifAsync(predicate)
.then(elseTrue)
.then(callbackTrue)
.elseIf(fn)
.then(elseTrue)
.else(elseFalse)
.then(callbackTrue)
.else(callbackFalse)
)

@@ -162,3 +162,6 @@ return functor

function elseNoop() {
var callback = arguments[arguments.length - 1]
var args = toArray(arguments)
var callback = args.pop()
args.unshift(null)
if (typeof callback !== 'function') {

@@ -168,6 +171,8 @@ throw new Error('expected a callback function')

setImmediate(callback)
setImmediate(function () {
callback.apply(null, args)
})
}
function elseTrue() {
function callbackTrue() {
var callback = arguments[arguments.length - 1]

@@ -181,3 +186,3 @@ if (typeof callback !== 'function') {

function elseFalse() {
function callbackFalse() {
var callback = arguments[arguments.length - 1]

@@ -184,0 +189,0 @@ if (typeof callback !== 'function') {

{
"name": "if-async",
"description": "",
"version": "3.7.3",
"version": "3.7.4",
"keywords": [

@@ -6,0 +6,0 @@ "async"

@@ -445,3 +445,3 @@ var ifAsync = require('./index.js')

it('carry arguments', function (done) {
it('carry arguments from "then" consequent', function (done) {
ifAsync(function(a, b, callback) {

@@ -462,2 +462,19 @@ a.should.eql(1)

it('carry arguments from default "else" consequent', function (done) {
ifAsync(function(a, b, callback) {
a.should.eql(1)
b.should.eql(2)
callback(null, false)
})
.then(function(a, b, callback) {
a.should.eql(1)
b.should.eql(2)
callback(null, 3)
})(1, 2, function (err, a, b) {
a.should.eql(1)
b.should.eql(2)
done()
})
})
it('has a negation operator for predicates', function (done) {

@@ -464,0 +481,0 @@ var p1Invoked = false

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