Unverified Commit 89b5333a authored by Adam Cozzette's avatar Adam Cozzette Committed by GitHub

Merge pull request #4378 from acozzette/node-buffer

Revert "Removed mention of Buffer in byteSourceToUint8Array"
parents 4f110257 f8005a5d
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment