Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

accumulator: string = ''

Accumulator for the current parsed structure

buffer: string = ''

The current piece of JSON

expected: ParserState = parserStateTypes.VALUE

The next expected parser state from a stream

index: number = 0

The current index in a buffer parsing process

isOpenNumber: boolean = false

Is the parser parsing a number now

matched?: null | RegExpExecArray

The current match value after RegExp execution

parent: ParentParserState = parserStateTypes.EMPTY

The current parent of a parsed structure

patterns: Record<string, RegExp> = parserPatterns

Dictionary with RegExp-s to different types of data

stack: ParentParserState[] = []

An array of parent objects for the current parsed structure

value?: string = ''

The current parsed value

Methods

  • finishChunkProcessing(): Generator<Token, any, unknown>
  • processChunk(chunk: string): Generator<Token, any, unknown>
  • from(source: Iterable<string> | AsyncIterable<string>): AsyncGenerator<Token, any, unknown>
  • from<T>(source: Iterable<string> | AsyncIterable<string>, ...processors: T): T extends [TokenProcessor<R>] ? AsyncGenerator<R, any, unknown> : T extends [...A[], TokenProcessor<R>] ? AsyncGenerator<R, any, unknown> : unknown
  • Parses the specified iterable object as a JSON stream and yields tokens via a Generator

    Parameters

    • source: Iterable<string> | AsyncIterable<string>

    Returns AsyncGenerator<Token, any, unknown>

  • Parses the specified iterable object as a JSON stream and yields tokens or values via a Generator

    Type parameters

    Parameters

    • source: Iterable<string> | AsyncIterable<string>
    • Rest ...processors: T

    Returns T extends [TokenProcessor<R>] ? AsyncGenerator<R, any, unknown> : T extends [...A[], TokenProcessor<R>] ? AsyncGenerator<R, any, unknown> : unknown