Merge pull request #4378 from acozzette/node-buffer

Revert "Removed mention of Buffer in byteSourceToUint8Array"
pull/4313/merge
Adam Cozzette 7 years ago committed by GitHub
commit 89b5333ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      js/binary/utils.js

@ -971,6 +971,10 @@ jspb.utils.byteSourceToUint8Array = function(data) {
return /** @type {!Uint8Array} */(new Uint8Array(data));
}
if (data.constructor === Buffer) {
return /** @type {!Uint8Array} */(new Uint8Array(data));
}
if (data.constructor === Array) {
data = /** @type {!Array<number>} */(data);
return /** @type {!Uint8Array} */(new Uint8Array(data));

Loading…
Cancel
Save