Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/minizlib/index.js')
-rw-r--r--node_modules/minizlib/index.js24
1 files changed, 3 insertions, 21 deletions
diff --git a/node_modules/minizlib/index.js b/node_modules/minizlib/index.js
index c84bda1b5..295047b9c 100644
--- a/node_modules/minizlib/index.js
+++ b/node_modules/minizlib/index.js
@@ -9,7 +9,6 @@ const Minipass = require('minipass')
const OriginalBufferConcat = Buffer.concat
-const _superWrite = Symbol('_superWrite')
class ZlibError extends Error {
constructor (err) {
super('zlib: ' + err.message)
@@ -165,12 +164,12 @@ class ZlibBase extends Minipass {
if (Array.isArray(result) && result.length > 0) {
// The first buffer is always `handle._outBuffer`, which would be
// re-used for later invocations; so, we always have to copy that one.
- writeReturn = this[_superWrite](Buffer.from(result[0]))
+ writeReturn = super.write(Buffer.from(result[0]))
for (let i = 1; i < result.length; i++) {
- writeReturn = this[_superWrite](result[i])
+ writeReturn = super.write(result[i])
}
} else {
- writeReturn = this[_superWrite](Buffer.from(result))
+ writeReturn = super.write(Buffer.from(result))
}
}
@@ -178,10 +177,6 @@ class ZlibBase extends Minipass {
cb()
return writeReturn
}
-
- [_superWrite] (data) {
- return super.write(data)
- }
}
class Zlib extends ZlibBase {
@@ -248,22 +243,9 @@ class Inflate extends Zlib {
}
// gzip - bigger header, same deflate compression
-const _portable = Symbol('_portable')
class Gzip extends Zlib {
constructor (opts) {
super(opts, 'Gzip')
- this[_portable] = opts && !!opts.portable
- }
-
- [_superWrite] (data) {
- if (!this[_portable])
- return super[_superWrite](data)
-
- // we'll always get the header emitted in one first chunk
- // overwrite the OS indicator byte with 0xFF
- this[_portable] = false
- data[9] = 255
- return super[_superWrite](data)
}
}