-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
node/lib/internal/streams/end-of-stream.js
Lines 245 to 255 in f0cf100
function finished(stream, opts) { | |
return new Promise((resolve, reject) => { | |
eos(stream, opts, (err) => { | |
if (err) { | |
reject(err); | |
} else { | |
resolve(); | |
} | |
}); | |
}); | |
} |
Should the promise version of finished
call the clean up function returned from the callback version?
So something like:
function finished(stream, opts) {
return new Promise((resolve, reject) => {
const cleanup = eos(stream, opts, (err) => {
cleanup();
if (err) {
reject(err);
} else {
resolve();
}
});
});
}
Metadata
Metadata
Assignees
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.