remove getStreamError

This commit is contained in:
Simon Knott 2025-01-13 11:25:58 +01:00
parent dce95a5a4f
commit 2749367bb5
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -1,4 +1,4 @@
const { Writable, Readable, getStreamError } = require('stream')
const { Writable, Readable } = require('stream')
const headers = require('./headers')
const EMPTY = Buffer.alloc(0)
@ -78,10 +78,6 @@ class Source extends Readable {
}
}
_predestroy () {
this._parent.destroy(getStreamError(this))
}
_detach () {
if (this._parent._stream === this) {
this._parent._stream = null
@ -91,6 +87,7 @@ class Source extends Readable {
}
_destroy (err, cb) {
this._parent.destroy(err)
this._detach()
cb(null)
}