pull-pushable
Advanced tools
Comparing version 2.1.2 to 2.2.0
@@ -53,3 +53,3 @@ module.exports = pullPushable | ||
if (separated) { | ||
return { push: push, end: end, source: read } | ||
return { push: push, end: end, source: read, buffer: buffer } | ||
} | ||
@@ -60,2 +60,3 @@ | ||
read.end = end | ||
read.buffer = buffer | ||
return read | ||
@@ -62,0 +63,0 @@ |
{ | ||
"name": "pull-pushable", | ||
"description": "pull-stream with a push interface", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"homepage": "https://github.com/dominictarr/pull-pushable", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -48,3 +48,3 @@ # pull-pushable | ||
When giving the stream away and you don't want the user to have the `push`/`end` functions, | ||
you can pass a `separated` option. It returns `{ push, end, source }`. | ||
you can pass a `separated` option. It returns `{ push, end, source, buffer }`. | ||
@@ -67,2 +67,5 @@ ```js | ||
The current buffer array is exposed as `buffer` if you need to inspect or | ||
manipulate it. | ||
## License | ||
@@ -69,0 +72,0 @@ |
@@ -13,2 +13,6 @@ var pull = require('pull-stream') | ||
buf.push(1) | ||
t.deepEqual(buf.buffer, [1]) | ||
pull( | ||
@@ -25,3 +29,2 @@ buf, | ||
buf.push(1) | ||
buf.push(2) | ||
@@ -33,5 +36,5 @@ buf.push(3) | ||
test('pushable with separated functions', function (t) { | ||
t.plan(3) | ||
t.plan(4) | ||
var { push, end, source } = pushable(true) | ||
var { push, end, source, buffer } = pushable(true) | ||
@@ -41,2 +44,7 @@ t.is(typeof source, 'function', 'is a function') | ||
push(1) | ||
push(2) | ||
t.deepEqual(buffer, [1, 2]) | ||
pull( | ||
@@ -51,6 +59,4 @@ source, | ||
push(1) | ||
push(2) | ||
push(3) | ||
end() | ||
}) |
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
8414
218
73