bluebird-ff
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -31,8 +31,19 @@ var util = require('util'); | ||
arg = [arg]; | ||
arg.__ff_and_sig = true; | ||
Object.defineProperty(arg, '__ff_and_sig', { | ||
configurable: false, | ||
writable: false, | ||
enumerable: false, | ||
value: true | ||
}); | ||
} | ||
return Promise.all(arg.concat([fn.apply(this, arg)])); | ||
return Promise.resolve(fn.apply(this, arg)) | ||
.then(function(result) { | ||
arg.push(result); | ||
return arg; | ||
}); | ||
}; | ||
} | ||
{ | ||
"name": "bluebird-ff", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Functional/Control-Flow utilities for Bluebird", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -18,3 +18,20 @@ var chai = require('chai'); | ||
}); | ||
it('should not append the result if the previous result was not created by and', function() { | ||
var promise = Promise.resolve(['123']) | ||
.and(function(value) { | ||
expect(value).to.eql(['123']); | ||
return ['456']; | ||
}) | ||
.and(function(value, value2) { | ||
expect(value).to.eql(['123']); | ||
expect(value2).to.eql(['456']); | ||
return 'abc'; | ||
}); | ||
return expect(promise).to.eventually.eql([['123'], ['456'], 'abc']); | ||
}); | ||
}); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7723
163