style: remove unnecessary whitespace in packet.ts and basic.test.ts
This commit is contained in:
@@ -21,7 +21,7 @@ export interface OutgoingPacket {
|
|||||||
export function packOutgoingPacket(outgoingPacket: OutgoingPacket): Uint8Array {
|
export function packOutgoingPacket(outgoingPacket: OutgoingPacket): Uint8Array {
|
||||||
// Default to empty data if not provided
|
// Default to empty data if not provided
|
||||||
const data = outgoingPacket.data ?? new Uint8Array(0);
|
const data = outgoingPacket.data ?? new Uint8Array(0);
|
||||||
|
|
||||||
// Verify that the data does not exceed the maximum data length.
|
// Verify that the data does not exceed the maximum data length.
|
||||||
if (data.length > MAX_DATA_LENGTH) {
|
if (data.length > MAX_DATA_LENGTH) {
|
||||||
throw RangeError(
|
throw RangeError(
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ test("Parse a basic message (0x0001).", () => {
|
|||||||
// Given
|
// Given
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
const originalMessage = encoder.encode("Test message");
|
const originalMessage = encoder.encode("Test message");
|
||||||
|
|
||||||
// First encrypt the message to get valid encrypted data
|
// First encrypt the message to get valid encrypted data
|
||||||
const encryptedData = packers[MessageTypes.Basic](originalMessage, KEY);
|
const encryptedData = packers[MessageTypes.Basic](originalMessage, KEY);
|
||||||
// Extract just the data portion (skip the 4-byte header)
|
// Extract just the data portion (skip the 4-byte header)
|
||||||
|
|||||||
Reference in New Issue
Block a user