Skip to content

Commit

Permalink
use async method
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameiswhm committed Jan 26, 2019
1 parent becfa3e commit a33e301
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions compress.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function adapter() {
try {
var zlib = require('zlib');
if (zlib.hasOwnProperty('brotliCompressSync')) {
return zlib.brotliCompressSync;
if (zlib.hasOwnProperty('brotliCompress')) {
return zlib.brotliCompress;
}
} catch (err) {}

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ BrotliPlugin.prototype.apply = function (compiler) {
var asset = assets[file];
var content = asset.source();
if (!Buffer.isBuffer(content)) {
content = new Buffer(content, 'utf-8');
content = Buffer.from(content, 'utf-8');
}

var originalSize = content.length;
Expand Down

0 comments on commit a33e301

Please sign in to comment.