File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,12 @@ function newWritableStreamFromStreamWritable(streamWritable) {
101101 // here because it will return false if streamWritable is a Duplex
102102 // whose writable option is false. For a Duplex that is not writable,
103103 // we want it to pass this check but return a closed WritableStream.
104- const checkIfWritable =
104+ // We check if the given stream is a stream.Writable or http.OutgoingMessage
105+ const checkIfWritableOrOutgoingMessage =
105106 streamWritable &&
106107 typeof streamWritable ?. write === 'function' &&
107- typeof streamWritable ?. on === 'function' &&
108- ! streamWritable ?. _readableState ;
109- if ( ! checkIfWritable ) {
108+ typeof streamWritable ?. on === 'function' ;
109+ if ( ! checkIfWritableOrOutgoingMessage ) {
110110 throw new ERR_INVALID_ARG_TYPE (
111111 'streamWritable' ,
112112 'stream.Writable' ,
You can’t perform that action at this time.
0 commit comments