Permalink
Browse files

Fix directly using Buffer instead of util.Buffer

This seems to have caused webpack to load a Buffer shim.
  • Loading branch information...
fnlctrl committed Dec 18, 2016
1 parent bfac0ea commit 6c2415d599847cbdadc17dee3cdf369fc9facade
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit 6c2415d

Please sign in to comment.