Socket
Socket
Sign inDemoInstall

minizlib

Package Overview
Dependencies
Maintainers
9
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minizlib - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

29

index.js

@@ -12,2 +12,20 @@ 'use strict'

class ZlibError extends Error {
constructor (err) {
super('zlib: ' + err.message)
this.code = err.code
this.errno = err.errno
/* istanbul ignore if */
if (!this.code)
this.code = 'ZLIB_ERROR'
this.message = 'zlib: ' + err.message
Error.captureStackTrace(this, this.constructor)
}
get name () {
return 'ZlibError'
}
}
// the Zlib class they all inherit from

@@ -41,3 +59,8 @@ // This thing manages the queue of requests, and returns

// this will throw if any options are invalid for the class selected
this[_handle] = new realZlib[mode](opts)
try {
this[_handle] = new realZlib[mode](opts)
} catch (er) {
// make sure that all errors get decorated properly
throw new ZlibError(er)
}

@@ -52,3 +75,3 @@ this[_onError] = (err) => {

this[_handle].on('error', er => this[_onError](er))
this[_handle].on('error', er => this[_onError](new ZlibError(er)))
this.once('end', () => this.close)

@@ -127,3 +150,3 @@ }

Buffer.concat = OriginalBufferConcat
this[_onError](err)
this[_onError](new ZlibError(err))
} finally {

@@ -130,0 +153,0 @@ if (this[_handle]) {

2

package.json
{
"name": "minizlib",
"version": "1.3.0",
"version": "1.3.1",
"description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc