Socket
Socket
Sign inDemoInstall

destroy

Package Overview
Dependencies
0
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

27

index.js
/*!
* destroy
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed

@@ -77,2 +78,26 @@ */

/**
* Close a Zlib stream.
*
* Zlib streams below Node.js 4.5.5 have a buggy implementation
* of .close() when zlib encountered an error.
*
* @param {object} stream
* @private
*/
function closeZlibStream (stream) {
if (stream._hadError === true) {
var prop = stream._binding === null
? '_binding'
: '_handle'
stream[prop] = {
close: function () { this[prop] = null }
}
}
stream.close()
}
/**
* Destroy a Zlib stream.

@@ -120,3 +145,3 @@ *

// node.js < 8 fallback
stream.close()
closeZlibStream(stream)
}

@@ -123,0 +148,0 @@

4

package.json
{
"name": "destroy",
"description": "destroy a stream if possible",
"version": "1.1.0",
"version": "1.1.1",
"author": {

@@ -23,3 +23,3 @@ "name": "Jonathan Ong",

"eslint-plugin-standard": "4.1.0",
"mocha": "9.2.0",
"mocha": "9.2.1",
"nyc": "15.1.0"

@@ -26,0 +26,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc