Skip to content

Commit

Permalink
Fix directly using Buffer instead of util.Buffer
Browse files Browse the repository at this point in the history
This seems to have caused webpack to load a Buffer shim.
  • Loading branch information
fnlctrl authored Dec 18, 2016
1 parent bfac0ea commit 6c2415d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6c2415d

Please sign in to comment.