class

JsonSerializer

typescript

Default JSON serializer with newline terminator

Properties

terminator

string

Terminator sequence used to delimit messages in the stream. Must be the same on both client and server.

Methods

deserialize(data: string | Uint8Array<ArrayBufferLike>): T

Deserialize string or Uint8Array back to data

Parameters

data:string | Uint8Array<ArrayBufferLike>

Returns

T
serialize(data: T): string

Serialize data to string or Uint8Array

Parameters

data:T

Returns

string