Skip to content

Commit

Permalink
fgixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 25, 2021
1 parent bab2cd5 commit 917fb2a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/internal/streams/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ async function* fromReadable(val) {
yield* Readable.prototype[SymbolAsyncIterator].call(val);
}

async function pump(iterable, writable, finish, opts) {
const end = opts?.end !== false;

async function pump(iterable, writable, finish, { end }) {
let error;
let onresolve = null;

Expand Down Expand Up @@ -208,11 +206,10 @@ function pipelineImpl(streams, callback, opts) {
const writing = i > 0;
const end = reading || opts?.end !== false;

if (isNodeStream(stream) && end) {
destroys.push(destroyer(stream, reading, writing));
}

if (isNodeStream(stream)) {
if (end) {
destroys.push(destroyer(stream, reading, writing));
}
eos(stream, { readable: reading, writable: writing }, (err) => {
if (err && err.name !== 'AbortError' && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
finish(err);
Expand Down Expand Up @@ -310,9 +307,7 @@ function pipelineImpl(streams, callback, opts) {
return ret;
}

function pipe(src, dst, finish, opts) {
const end = opts?.end !== false;

function pipe(src, dst, finish, { end }) {
src.pipe(dst, { end })

if (end) {
Expand Down

0 comments on commit 917fb2a

Please sign in to comment.