From 92416046393812e5eceae91f7af6fd2db3d7dde4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 8 Aug 2018 01:22:56 -0600 Subject: [PATCH] v2.0.1: use Buffer.from() instead of new Buffer() --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a3d6836..ae6c032 100644 --- a/index.js +++ b/index.js @@ -211,7 +211,7 @@ Packer.packHeader = function (meta, data, service, andBody, oldways) { data = Buffer.from(' '); } if (data && !Buffer.isBuffer(data)) { - data = new Buffer(JSON.stringify(data)); + data = Buffer.from(JSON.stringify(data)); } if (oldways && !data.byteLength) { data = Buffer.from(' ');