jsonaut
    Preparing search index...

    Class StreamToSequence

    Convert a stream of characters (in chunks) to a sequence of path/value pairs

    Index

    Constructors

    • Convert a stream of bytes (in chunks) into a sequence of path/value pairs

      Parameters

      • Optionaloptions: {
            isMaxDepthReached?: (arg0: Path) => boolean;
            maxDepth?: number;
            startingPath?: JSONPathType;
        } = {}
        • OptionalisMaxDepthReached?: (arg0: Path) => boolean

          Max parsing depth

        • OptionalmaxDepth?: number

          Max parsing depth

        • OptionalstartingPath?: JSONPathType

          The parser will consider this path as it is initial (useful to resume)

      Returns StreamToSequence

    Properties

    _isMaxDepthReached: (arg0: Path) => boolean
    currentPath: Path
    emptyObjectOrArrayStart: number
    maxDepthReached: boolean
    state: string
    stringBuffer: Uint8Array<ArrayBuffer>
    tokenizer: StreamJSONTokenizer

    Methods

    • Parse a json or json fragment from a buffer, split in chunks (ArrayBuffers) and yields a sequence of path/value pairs It also yields the starting and ending byte of each value

      Parameters

      • asyncIterable:
            | AsyncIterable<Uint8Array<ArrayBufferLike>, any, any>
            | Iterable<Uint8Array<ArrayBufferLike>, any, any>

        an arraybuffer that is a chunk of a stream

      Returns AsyncIterable<Iterable<[Path, Value, number, number], any, any>, any, any>

      • path, value, byte start, and byte end when the value is in the buffer
    • Parse a json or json fragment from a buffer, split in chunks (ArrayBuffers) and yields a sequence of path/value pairs It also yields the starting and ending byte of each value

      Parameters

      • chunk: Uint8Array<ArrayBufferLike>

        an arraybuffer that is a chunk of a stream

      Returns Iterable<[Path, Value, number, number], any, any>

      • path, value, byte start, and byte end when the value is in the buffer