Remove `Buffer` from `getSizeOfPayloadSizeField`

This commit is contained in:
Franck Royer 2022-05-19 19:51:51 +10:00
parent 9e09de831f
commit 95485f0a69
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 2 additions and 2 deletions

View File

@ -110,8 +110,8 @@ export function clearDecode(
}
function getSizeOfPayloadSizeField(message: Uint8Array): number {
const buf = Buffer.from(message);
return buf.readUIntLE(0, 1) & FlagMask;
const messageDataView = new DataView(message.buffer);
return messageDataView.getUint8(0) & FlagMask;
}
/**