Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDuckworth committed Apr 8, 2024
1 parent 2f58b4f commit 3e36742
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/firestore/src/remote/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export function toBytes(
*/
export function fromBytes(
serializer: JsonProtoSerializer,
value: string | Uint8Array | Buffer | undefined
value: string | Uint8Array | undefined
): ByteString {
if (serializer.useProto3Json) {
hardAssert(
Expand All @@ -263,6 +263,10 @@ export function fromBytes(
} else {
hardAssert(
value === undefined ||
// The Buffer interface extends the Uint8Array interface, however
// the Uint8ArrayConstructor is not in the prototype chain of
// Buffer, so we have to test `value instanceof Buffer` and
// `value instanceof Uint8Array`.
value instanceof Buffer ||
value instanceof Uint8Array,
'value must be undefined, Buffer, or Uint8Array'
Expand Down

0 comments on commit 3e36742

Please sign in to comment.