pull-stream
Advanced tools
Comparing version 2.9.2 to 2.10.0
{ | ||
"name": "pull-stream", | ||
"description": "minimal pull stream", | ||
"version": "2.9.2", | ||
"version": "2.10.0", | ||
"homepage": "https://github.com/dominictarr/pull-stream", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -13,6 +13,4 @@ function prop (map) { | ||
var k = 0 | ||
var map = exports.map = | ||
function (read, map) { | ||
var _k = k++ | ||
map = prop(map) || id | ||
@@ -75,20 +73,22 @@ return function (end, cb) { | ||
function (read, test) { | ||
var ended = false | ||
var ended = false, more | ||
if('number' === typeof test) { | ||
var n = test; test = function () { | ||
return n --> 0 | ||
return n -- | ||
} | ||
} | ||
return function (end, cb) { | ||
if(ended = ended || end) | ||
return read(ended, cb) | ||
if(ended) return cb(ended) | ||
if(1 === more) end = true | ||
if(ended = end) return read(ended, cb) | ||
read(null, function (end, data) { | ||
if(ended = ended || end) return cb(ended) | ||
//TODO, CHECK THAT END LOGIC IS CORRECT WITH TAKE!!! | ||
if(!test(data)) { | ||
if(!(more = test(data))) { | ||
ended = true | ||
read(true, cb) | ||
read(true, function (end, data) { | ||
cb(ended, data) | ||
}) | ||
} | ||
else | ||
else | ||
cb(null, data) | ||
@@ -95,0 +95,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
30486
22
763