NdjsonLineDecoder
Defined in: packages/format-ndjson/src/ndjson-line-decoder.ts:33
Decodes one JSON value per \n-terminated line, skipping blank lines.
The single implementation of the NDJSON read grammar: parseNdjson and
NdjsonParseStream are both driven by this rather than repeating it.
Written against string rather than Uint8Array because the grammar is
defined over characters; byte-to-text conversion is the buffer’s job
(TextDecodeBuffer).
Implements
Section titled “Implements”Decoder<JsonValue,string>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NdjsonLineDecoder(
maxLineLength):NdjsonLineDecoder
Defined in: packages/format-ndjson/src/ndjson-line-decoder.ts:34
Parameters
Section titled “Parameters”maxLineLength
Section titled “maxLineLength”number
Returns
Section titled “Returns”NdjsonLineDecoder
Methods
Section titled “Methods”decode()
Section titled “decode()”decode(
view,context):DecodeResult<JsonValue>
Defined in: packages/format-ndjson/src/ndjson-line-decoder.ts:36
Attempt to decode one value from the front of view.
view is a window into the driver’s buffer and is invalidated as soon as
this call returns. Copy anything retained in the returned value.
Parameters
Section titled “Parameters”string
context
Section titled “context”DecodeContext
Returns
Section titled “Returns”DecodeResult<JsonValue>
Implementation of
Section titled “Implementation of”Decoder.decode