Comparing version 0.2.0 to 0.2.1
@@ -13,3 +13,3 @@ var fs = require('fs'); | ||
.par(function (who) { | ||
fs.readFile(__filename, 'ascii', this); | ||
fs.readFile(__filename, 'utf8', this); | ||
}) | ||
@@ -16,0 +16,0 @@ .seq(function (groups, src) { |
36
index.js
@@ -151,2 +151,26 @@ var EventEmitter = require('events').EventEmitter; | ||
[ 'seq', 'par' ].forEach((function (name) { | ||
this[name + '_'] = function (key) { | ||
var args = [].slice.call(arguments); | ||
var cb = typeof key === 'function' | ||
? args[0] : args[1]; | ||
var fn = function () { | ||
var argv = [].slice.call(arguments); | ||
argv.unshift(this); | ||
cb.apply(this, argv); | ||
}; | ||
if (typeof key === 'function') { | ||
args[0] = fn; | ||
} | ||
else { | ||
args[1] = fn; | ||
} | ||
this[name].apply(this, args); | ||
}; | ||
}).bind(this)); | ||
this['catch'] = function (cb) { | ||
@@ -261,2 +285,14 @@ if (context.error) { | ||
[ 'forEach', 'seqEach', 'parEach', 'seqMap', 'parMap' ] | ||
.forEach((function (name) { | ||
this[name + '_'] = function (cb) { | ||
this[name].call(this, function () { | ||
var args = [].slice.call(arguments); | ||
args.unshift(this); | ||
cb.apply(this, args); | ||
}); | ||
}; | ||
}).bind(this)) | ||
; | ||
['push','pop','shift','unshift','splice'] | ||
@@ -263,0 +299,0 @@ .forEach((function (name) { |
{ | ||
"name" : "seq", | ||
"version" : "0.2.0", | ||
"version" : "0.2.1", | ||
"description" : "Chainable asynchronous flow control with sequential and parallel primitives and pipeline-style error handling", | ||
@@ -5,0 +5,0 @@ "main" : "./index.js", |
Sorry, the diff of this file is not supported yet
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
43969
11
1144
331
3