Skip to content

Commit

Permalink
make destroyed check cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Sep 24, 2019
1 parent ec0b5bd commit ad6a948
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ var eos = function(stream, opts, callback) {
};

var onclose = function() {
if (stream.destroyed || (readable && !(rs && rs.ended))) return callback.call(stream, new Error('premature close'));
if (stream.destroyed || (writable && !(ws && ws.ended))) return callback.call(stream, new Error('premature close'));
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
};

var onrequest = function() {
Expand Down

0 comments on commit ad6a948

Please sign in to comment.