Comparing version 0.0.2 to 0.0.3
@@ -68,4 +68,5 @@ /* | ||
if (!seq || !(seq = seq[0])) return; | ||
if (!args || !args.length) args = [undefined]; | ||
this._length = args.length; | ||
if (args) forEach(args, function(arg) { | ||
forEach(args, function(arg) { | ||
seq(error, arg); | ||
@@ -72,0 +73,0 @@ }); |
{ | ||
"name": "finally", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "sane flow control library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -130,2 +130,40 @@ "use strict" | ||
it('should go to the next sequential on empty spreads', function() { | ||
flow(function(err) { | ||
this.spread(null, []) | ||
}).then(function(error, number) { | ||
expect(error).to.be(null) | ||
expect(number).to.be(undefined) | ||
this.done(null, 10); | ||
}).finally(function(error, number) { | ||
expect(number).to.be(10); | ||
}) | ||
flow(function(err) { | ||
this.spread(null) | ||
}).then(function(error, number) { | ||
expect(error).to.be(null) | ||
expect(number).to.be(undefined) | ||
this.done(null, 10); | ||
}).finally(function(error, number) { | ||
expect(number).to.be(10); | ||
}) | ||
}) | ||
it('should spread objects with a length', function() { | ||
flow(function(err) { | ||
this.spread(null, "yes") | ||
}).then(function(error, letter) { | ||
expect(error).to.be(null) | ||
this.done(null, letter); | ||
}).finally(function(error, y, e, s) { | ||
expect(error).to.be(null) | ||
expect(y + e + s).to.eql("yes") | ||
}) | ||
}) | ||
}) | ||
@@ -132,0 +170,0 @@ |
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
15886
381