refactor: use new method of accessing zlib constants

"Accessing the constants directly from the module is currently still possible but is deprecated."
https://nodejs.org/api/zlib.html#zlib_zlib_constants
This commit is contained in:
weyusi 2019-04-22 20:08:50 +09:30
parent 9b52aed8e4
commit 369bad96b7
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ function logicGzip () {
assetPath.on('end', () => {
if (assetTxt.length) {
// gzip compress using highest level
zlib.gzip(assetTxt, { level: zlib.Z_BEST_COMPRESSION }, (err, Input) => {
zlib.gzip(assetTxt, { level: zlib.constants.Z_BEST_COMPRESSION }, (err, Input) => {
if (!err) {
// Save the compressed file to .gz
route.set(path + '.gz', Input)