Skip to content

Commit 07a8f59

Browse files
Phillip9587wesleytodd
authored andcommitted
fix: remove obsolete dependency destroy
The [`destroy`](https://www.npmjs.com/package/destroy) package was was used to handle stream destruction across legacy Node.js versions (>=0.8), addressing bugs in specific versions. Since we now officially support only Node.js 18 and newer, we can safely remove this dependency and replace it with a direct call to `stream.destroy()`.
1 parent 91c9199 commit 07a8f59

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/read.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
var createError = require('http-errors')
15-
var destroy = require('destroy')
1615
var getBody = require('raw-body')
1716
var iconv = require('iconv-lite')
1817
var onFinished = require('on-finished')
@@ -90,7 +89,7 @@ function read (req, res, next, parse, debug, options) {
9089
// unpipe from stream and destroy
9190
if (stream !== req) {
9291
req.unpipe()
93-
destroy(stream, true)
92+
stream.destroy()
9493
}
9594

9695
// read off entire request

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"bytes": "3.1.2",
1313
"content-type": "~1.0.5",
1414
"debug": "3.1.0",
15-
"destroy": "1.2.0",
1615
"http-errors": "2.0.0",
1716
"iconv-lite": "0.5.2",
1817
"on-finished": "2.4.1",

0 commit comments

Comments
 (0)