updated npm modules

This commit is contained in:
2019-05-20 20:43:45 -05:00
parent 2319197b81
commit f166b72b7d
1113 changed files with 8758 additions and 12227 deletions

15
node_modules/compression/index.js generated vendored
View File

@@ -85,7 +85,7 @@ function compression (options) {
}
return stream
? stream.write(Buffer.from(chunk, encoding))
? stream.write(toBuffer(chunk, encoding))
: _write.call(this, chunk, encoding)
}
@@ -112,7 +112,7 @@ function compression (options) {
// write Buffer for Node.js 0.8
return chunk
? stream.end(Buffer.from(chunk, encoding))
? stream.end(toBuffer(chunk, encoding))
: stream.end()
}
@@ -275,3 +275,14 @@ function shouldTransform (req, res) {
return !cacheControl ||
!cacheControlNoTransformRegExp.test(cacheControl)
}
/**
* Coerce arguments to Buffer
* @private
*/
function toBuffer (chunk, encoding) {
return !Buffer.isBuffer(chunk)
? Buffer.from(chunk, encoding)
: chunk
}