Comparing version 1.0.0 to 2.0.0
18
index.js
'use strict'; | ||
module.exports = buf => { | ||
if (!buf || buf.length < 3) { | ||
return false; | ||
} | ||
/** | ||
* Check if a Buffer/Uint8Array is a GZIP file | ||
* | ||
* @param {Buffer} buf | ||
* @api public | ||
*/ | ||
module.exports = function (buf) { | ||
if (!buf || buf.length < 3) { | ||
return false; | ||
} | ||
return buf[0] === 31 && buf[1] === 139 && buf[2] === 8; | ||
return buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x08; | ||
}; |
{ | ||
"name": "is-gzip", | ||
"version": "1.0.0", | ||
"description": "Check if a Buffer/Uint8Array is a GZIP file", | ||
"license": "MIT", | ||
"repository": "kevva/is-gzip", | ||
"author": { | ||
"name": "Kevin Mårtensson", | ||
"email": "kevinmartensson@gmail.com", | ||
"url": "https://github.com/kevva" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "node test/test.js" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"archive", | ||
"buffer", | ||
"check", | ||
"detect", | ||
"gzip", | ||
"type", | ||
"uint8array" | ||
], | ||
"devDependencies": { | ||
"ava": "0.0.4", | ||
"mocha": "^1.18.2", | ||
"read-chunk": "^1.0.0" | ||
} | ||
"name": "is-gzip", | ||
"version": "2.0.0", | ||
"description": "Check if a Buffer/Uint8Array is a GZIP file", | ||
"license": "MIT", | ||
"repository": "kevva/is-gzip", | ||
"author": { | ||
"name": "Kevin Mårtensson", | ||
"email": "kevinmartensson@gmail.com", | ||
"url": "github.com/kevva" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"archive", | ||
"buffer", | ||
"check", | ||
"detect", | ||
"gzip", | ||
"type", | ||
"uint8array" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2215
2
4
27
7
1