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

seq

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seq - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

59

index.js

@@ -262,6 +262,29 @@ var EventEmitter = require('events').EventEmitter;

.parEach(limit, function (x, i) {
cb.apply((function () {
var self = this;
var next = function () {
res[i] = arguments[1];
this.apply(this, arguments);
}).bind(this), arguments);
self.apply(self, arguments);
};
next.stack = self.stack;
next.stack_ = self.stack_;
next.vars = self.vars;
next.args = self.args;
next.error = self.error;
next.into = function (key) {
return function () {
res[key] = arguments[1];
self.apply(self, arguments);
};
};
next.ok = function () {
var args = [].slice.call(arguments);
args.unshift(null);
return next.apply(next, args);
};
cb.apply(next, arguments);
})

@@ -280,8 +303,30 @@ .seq(function () {

this.seqEach(function (x, i) {
var self = (function () {
var self = this;
var next = function () {
res[i] = arguments[1];
if (i == len - 1) context.stack = res;
this.apply(this, arguments);
}).bind(this);
cb.apply(self, arguments);
self.apply(self, arguments);
};
next.stack = self.stack;
next.stack_ = self.stack_;
next.vars = self.vars;
next.args = self.args;
next.error = self.error;
next.into = function (key) {
return function () {
res[key] = arguments[1];
self.apply(self, arguments);
};
};
next.ok = function () {
var args = [].slice.call(arguments);
args.unshift(null);
return next.apply(next, args);
};
cb.apply(next, arguments);
});

@@ -288,0 +333,0 @@ };

2

package.json
{
"name" : "seq",
"version" : "0.3.0",
"version" : "0.3.1",
"description" : "Chainable asynchronous flow control with sequential and parallel primitives and pipeline-style error handling",

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

@@ -728,1 +728,28 @@ var Seq = require('seq');

};
exports.nextOk = function () {
var to = setTimeout(function () {
assert.fail('seq never fired');
}, 500);
function moo1 (cb) { cb(3) }
function moo2 (cb) { cb(4) }
Seq()
.par_(function (next) { moo1(next.ok) })
.par_(function (next) { moo2(next.ok) })
.seq_(function (next, x, y) {
assert.eql(x, 3);
assert.eql(y, 4);
next.ok([ 1, 2, 3 ])
})
.flatten()
.parMap_(function (next, x) {
next.ok(x * 100)
})
.seq_(function (next) {
clearTimeout(to);
assert.deepEqual(next.stack, [ 100, 200, 300 ]);
})
;
};
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