Skip to content

probe-web / @probe-web/serial / LineDecoder

Class: LineDecoder ​

Defined in: index.ts:138

Splits a byte stream into lines. Bytes are decoded as UTF-8 across chunk boundaries; \r\n and \n end a line, a lone \r is dropped.

Constructors ​

Constructor ​

ts
new LineDecoder(): LineDecoder;

Returns ​

LineDecoder

Accessors ​

pending ​

Get Signature ​

ts
get pending(): string;

Defined in: index.ts:151

Text received after the last newline.

Returns ​

string

Methods ​

push() ​

ts
push(bytes): string[];

Defined in: index.ts:143

Feed bytes; returns the complete lines they finished.

Parameters ​

ParameterType
bytesUint8Array

Returns ​

string[]