Revert "Removed mention of Buffer in byteSourceToUint8Array"

This reverts commit 365e540d05.
This commit is contained in:
David Ostrovsky 2018-12-07 21:53:18 +01:00
parent 365e540d05
commit 3cb0aeca93

View File

@ -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));