pull-stream
Advanced tools
Comparing version 3.6.8 to 3.6.9
{ | ||
"name": "pull-stream", | ||
"description": "minimal pull stream", | ||
"version": "3.6.8", | ||
"version": "3.6.9", | ||
"homepage": "https://pull-stream.github.io", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -45,2 +45,37 @@ var pull = require('../') | ||
tape('abort async map (source is slow to ack abort)', function (t) { | ||
var err = new Error('abort') | ||
t.plan(3) | ||
function source(end, cb) { | ||
if (end) setTimeout(function () { cb(end) }, 20) | ||
else cb(null, 10) | ||
} | ||
var read = pull( | ||
source, | ||
pull.asyncMap(function (data, cb) { | ||
setImmediate(function () { | ||
cb(null, data) | ||
}) | ||
}) | ||
) | ||
var ended = false | ||
read(null, function (end) { | ||
if(!end) throw new Error('expected read to end') | ||
ended = true | ||
t.ok(end, "read's callback") | ||
}) | ||
read(err, function (end) { | ||
if(!end) throw new Error('expected abort to end') | ||
t.ok(end, "Abort's callback") | ||
t.ok(ended, 'read called back first') | ||
t.end() | ||
}) | ||
}) | ||
tape('abort async map (async source)', function (t) { | ||
@@ -108,3 +143,3 @@ var err = new Error('abort') | ||
} | ||
}, 100) | ||
}, 100) | ||
}), | ||
@@ -119,1 +154,2 @@ pull.collect(function (err, five) { | ||
@@ -36,3 +36,3 @@ 'use strict' | ||
cb(aborted) | ||
abortCb(aborted) | ||
abortCb && abortCb(aborted) | ||
} | ||
@@ -39,0 +39,0 @@ else if(err) next (err, cb) |
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
73001
1583