cbor2
    Preparing search index...

    Class SequenceEvents

    Decode the bytes of a CBOR Sequence to major-type/additional-information/ value tuples. Each of these tuples is an event in parsing the sequence.

    Note that this includes items indicating the start of an array or map, and the end of an indefinite-length item, and tag numbers separate from the tag content. Does not guarantee that the input is valid.

    Will attempt to read all items in an array or map, even if indefinite. Throws when there is insufficient data to do so. The same applies when reading tagged items, byte strings and text strings.

    const s = new Sequence(buffer);
    for (const [majorType, additionalInfo, value] of s.seq()) {
    ...
    }
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Iterate over all tuples.

      Returns Generator<MtAiValue, void, undefined>

      On insufficient data.

    • Peek at the next tuple, allowing for later reads.

      Returns undefined | MtAiValue

      On insufficient data.