File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/firestore/src/remote Expand file tree Collapse file tree 1 file changed +5
-3
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 | undefined
255
+ value : string | Uint8Array | Buffer | undefined
256
256
) : ByteString {
257
257
if ( serializer . useProto3Json ) {
258
258
hardAssert (
@@ -262,8 +262,10 @@ export function fromBytes(
262
262
return ByteString . fromBase64String ( value ? value : '' ) ;
263
263
} else {
264
264
hardAssert (
265
- value === undefined || value instanceof Uint8Array ,
266
- 'value must be undefined or Uint8Array'
265
+ value === undefined ||
266
+ value instanceof Buffer ||
267
+ value instanceof Uint8Array ,
268
+ 'value must be undefined, Buffer, or Uint8Array'
267
269
) ;
268
270
return ByteString . fromUint8Array ( value ? value : new Uint8Array ( ) ) ;
269
271
}
You can’t perform that action at this time.
0 commit comments