Skip to content

Commit

Permalink
fixup: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Jan 31, 2020
1 parent 1e9ab30 commit 6282580
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/internal/streams/end-of-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ function isWritable(stream) {
function isWritableFinished(stream) {
if (stream.writableFinished) return true;
const wState = stream._writableState;
if (wState && wState.finished) return true;
if (wState && wState.ended && wState.length === 0 &&
!wState.errored) return true;
return false;
if (!wState || wState.errored) return false;
return wState.finished || (wState.ended && wState.length === 0);
}

function eos(stream, opts, callback) {
Expand Down

0 comments on commit 6282580

Please sign in to comment.