Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: fix pipeline with dest in objectMode #32414

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/internal/streams/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ function pipeline(...streams) {
// always returns a stream which can be further
// composed through `.pipe(stream)`.

const pt = new PassThrough();
const pt = new PassThrough({
objectMode: true
lpinca marked this conversation as resolved.
Show resolved Hide resolved
});
if (isPromise(ret)) {
ret
.then((val) => {
Expand Down
12 changes: 12 additions & 0 deletions test/parallel/test-stream-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -1065,3 +1065,15 @@ const { promisify } = require('util');
src.push('asd');
dst.destroy();
}

{
pipeline(async function * () {
yield 'asd';
}, async function * (source) {
for await (const chunk of source) {
yield { chunk };
}
}, common.mustCall((err) => {
assert.ifError(err);
}));
}