Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gunzip-maybe

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gunzip-maybe - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

9

index.js

@@ -14,10 +14,13 @@ var zlib = require('zlib')

var gunzip = function () {
var gunzip = function (maxRecursion) {
if (!(maxRecursion >= 0)) maxRecursion = 3
return peek({newline: false, maxBuffer: 10}, function (data, swap) {
if (maxRecursion < 0) return swap(new Error('Maximum recursion reached'))
switch (isCompressed(data)) {
case 1:
swap(null, pumpify(zlib.createGunzip(), gunzip()))
swap(null, pumpify(zlib.createGunzip(), gunzip(maxRecursion - 1)))
break
case 2:
swap(null, pumpify(zlib.createInflate(), gunzip()))
swap(null, pumpify(zlib.createInflate(), gunzip(maxRecursion - 1)))
break

@@ -24,0 +27,0 @@ default:

{
"name": "gunzip-maybe",
"description": "Transform stream that gunzips its input if it is gzipped and just echoes it if not",
"version": "1.4.0",
"version": "1.4.1",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

@@ -14,3 +14,4 @@ # gunzip-maybe

Simply pipe a gzipped (or not gzipped) stream to `gunzip()` and read the unzipped content.
Simply pipe a gzipped (or not gzipped) stream to `gunzip([maxRecursion = 3])` and read the unzipped content.
`maxRecursion` protects the unzip mechanism from an infinite recursion in case of a malicious archive.

@@ -17,0 +18,0 @@ ``` 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