From 6c2415d599847cbdadc17dee3cdf369fc9facade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E9=93=84=E8=BF=90?= Date: Sun, 18 Dec 2016 21:59:47 +0800 Subject: [PATCH] Fix directly using Buffer instead of util.Buffer This seems to have caused webpack to load a Buffer shim. --- src/field.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field.js b/src/field.js index 3d74452ee..fedd18a68 100644 --- a/src/field.js +++ b/src/field.js @@ -287,7 +287,7 @@ FieldPrototype.jsonConvert = function(value, options) { if (options.bytes === Array) return Array.prototype.slice.call(value); if (options.bytes === util.Buffer && !util.Buffer.isBuffer(value)) - return util.Buffer.from ? util.Buffer.from(value) : new Buffer(value); + return util.Buffer.from ? util.Buffer.from(value) : new util.Buffer(value); } } return value;