File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/firestore/src/remote Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ export function toBytes(
252
252
*/
253
253
export function fromBytes (
254
254
serializer : JsonProtoSerializer ,
255
- value : string | Uint8Array | Buffer | undefined
255
+ value : string | Uint8Array | undefined
256
256
) : ByteString {
257
257
if ( serializer . useProto3Json ) {
258
258
hardAssert (
@@ -263,6 +263,10 @@ export function fromBytes(
263
263
} else {
264
264
hardAssert (
265
265
value === undefined ||
266
+ // The Buffer interface extends the Uint8Array interface, however
267
+ // the Uint8ArrayConstructor is not in the prototype chain of
268
+ // Buffer, so we have to test `value instanceof Buffer` and
269
+ // `value instanceof Uint8Array`.
266
270
value instanceof Buffer ||
267
271
value instanceof Uint8Array ,
268
272
'value must be undefined, Buffer, or Uint8Array'
You can’t perform that action at this time.
0 commit comments