summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/lib/utils/gunzip-maybe.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/deps/npm/lib/utils/gunzip-maybe.js')
-rw-r--r--deps/node/deps/npm/lib/utils/gunzip-maybe.js22
1 files changed, 0 insertions, 22 deletions
diff --git a/deps/node/deps/npm/lib/utils/gunzip-maybe.js b/deps/node/deps/npm/lib/utils/gunzip-maybe.js
deleted file mode 100644
index adf7e440..00000000
--- a/deps/node/deps/npm/lib/utils/gunzip-maybe.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var duplex = require('mississippi').duplex
-var through = require('mississippi').through
-var zlib = require('zlib')
-
-function hasGzipHeader (c) {
- return c[0] === 0x1F && c[1] === 0x8B && c[2] === 0x08
-}
-
-module.exports = gunzip
-function gunzip () {
- var stream = duplex()
- var peeker = through(function (chunk, enc, cb) {
- var newStream = hasGzipHeader(chunk)
- ? zlib.createGunzip()
- : through()
- stream.setReadable(newStream)
- stream.setWritable(newStream)
- stream.write(chunk)
- })
- stream.setWritable(peeker)
- return stream
-}