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

finally

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

finally - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

11

index.js

@@ -96,2 +96,3 @@ /*

this._arguments = [];
this._errors = [];
this._controls = [];

@@ -104,3 +105,11 @@

this._arguments[index] = data;
if (!--this._length) this._continue.apply(this, [error].concat(this._arguments));
if (error) this._errors.push(error);
if (!--this._length) {
var errors = null;
if (this._errors.length === 1) errors = this._errors[0];
else if (this._errors.length) errors = new Error(map(this._errors, function(e) {
return e.message;
}).join('\n'));
this._continue.apply(this, [errors].concat(this._arguments));
}
else this._controls[index]._kill();

@@ -107,0 +116,0 @@ }

2

package.json
{
"name": "finally",
"version": "0.0.3",
"version": "0.0.4",
"description": "sane flow control library",

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

@@ -168,2 +168,19 @@ "use strict"

it('should get errors when parallels return errors', function() {
flow(function(err) {
this.done(new Error('A'));
}, function(err) {
this.done(new Error('B'));
}, function(err) {
this.done(null, true)
}).finally(function(error, vA, vB, vC) {
expect(error.message).to.be('A\nB')
expect(vA).to.be(undefined)
expect(vB).to.be(undefined)
expect(vC).to.be(true)
})
})
})

@@ -170,0 +187,0 @@

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