Skip to content

Commit cb69ab2

Browse files
committed
optimize
1 parent 73a7a21 commit cb69ab2

File tree

1 file changed

+1
-3
lines changed
  • packages/standard-server-peer/src

1 file changed

+1
-3
lines changed

packages/standard-server-peer/src/codec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ async function decodeRawMessage(raw: EncodedMessage): Promise<{ json: any, blobD
337337
return { json: JSON.parse(raw) }
338338
}
339339

340-
const buffer = raw instanceof Blob
341-
? await raw.bytes()
342-
: new Uint8Array(raw)
340+
const buffer = raw instanceof Uint8Array ? raw : new Uint8Array(raw)
343341

344342
const delimiterIndex = buffer.indexOf(JSON_AND_BINARY_DELIMITER)
345343

0 commit comments

Comments
 (0)