v2.0.1: use Buffer.from() instead of new Buffer()

This commit is contained in:
AJ ONeal 2018-08-08 01:22:56 -06:00
parent ece89be3dd
commit 9241604639
1 changed files with 1 additions and 1 deletions

View File

@ -211,7 +211,7 @@ Packer.packHeader = function (meta, data, service, andBody, oldways) {
data = Buffer.from(' '); data = Buffer.from(' ');
} }
if (data && !Buffer.isBuffer(data)) { if (data && !Buffer.isBuffer(data)) {
data = new Buffer(JSON.stringify(data)); data = Buffer.from(JSON.stringify(data));
} }
if (oldways && !data.byteLength) { if (oldways && !data.byteLength) {
data = Buffer.from(' '); data = Buffer.from(' ');