pull-stream
Advanced tools
Comparing version 2.4.0 to 2.5.0
@@ -39,2 +39,7 @@ # Throughs | ||
## asyncMap (fun) | ||
like `map` but the signature of `fun` must be | ||
`function (data, cb) { cb(null, data) }` | ||
## filter (test) | ||
@@ -41,0 +46,0 @@ |
{ | ||
"name": "pull-stream", | ||
"description": "minimal pull stream", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"homepage": "https://github.com/dominictarr/pull-stream", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -11,7 +11,10 @@ var pull = require('../') | ||
read(null, function (end, data) { | ||
if(!end) t.deepEqual(data, [ | ||
[0, 1,2,3,4,5,6], | ||
[7,8,9,10,11,12,13], | ||
[14, 15,16,17,18,19] | ||
]) | ||
if(!end) { | ||
t.deepEqual(data, [ | ||
[0, 1,2,3,4,5,6], | ||
[7,8,9,10,11,12,13], | ||
[14, 15,16,17,18,19] | ||
]) | ||
console.log(data) | ||
} | ||
process.nextTick(cb.bind(null, end, data)) | ||
@@ -18,0 +21,0 @@ }) |
@@ -26,2 +26,14 @@ function prop (map) { | ||
var asyncMap = exports.asyncMap = | ||
function (read, map) { | ||
if(!map) return read | ||
return function (end, cb) { | ||
if(end) return read(end, cb) //abort | ||
read(null, function (end, data) { | ||
if(end) return cb(end, data) | ||
map(data, cb) | ||
}) | ||
} | ||
} | ||
var filter = exports.filter = | ||
@@ -28,0 +40,0 @@ function (read, test) { |
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
27974
20
669