mhtml-stream
    Preparing search index...

    Interface MhtmlHeaders

    class for storing headers parse from MHTML

    Tries to somewhat mimic the behavior of the fetch-api Headers object, with some differences, notably that it does no validation.

    interface MhtmlHeaders {
        "[iterator]"(): Iterator<[string, string], any, any>;
        append(key: string, value: string): void;
        entries(delimiter?: string): IterableIterator<[string, string]>;
        entriesAll(): IterableIterator<[string, string]>;
        get(key: string, delimiter?: string): string | null;
        getAll(key: string): string[];
        has(key: string): boolean;
        keys(): Iterable<string>;
        values(delimiter?: string): IterableIterator<string>;
        valuesAll(): IterableIterator<string>;
    }

    Hierarchy

    • Iterable<[string, string]>
      • MhtmlHeaders
    Index

    Methods

    • Returns Iterator<[string, string], any, any>

    • add a key-value pair

      If key is already present it will be appended.

      Parameters

      • key: string
      • value: string

      Returns void

    • iterate over all key-value pairs

      Multiple values for the same key will be joined in the order they were added by delimiter.

      Parameters

      • Optionaldelimiter: string

      Returns IterableIterator<[string, string]>

    • iterate over all key-value pairs

      Multiple values for the same key will get iterated in the order they were added.

      Returns IterableIterator<[string, string]>

    • get the value for a key

      If the key is missing, null will be returned, if multiple values for the key are present, they will be joined be delimiter.

      Parameters

      • key: string
      • Optionaldelimiter: string

      Returns string | null

    • get all values for a key

      Parameters

      • key: string

      Returns string[]

    • whether key has any values associated with it

      Parameters

      • key: string

      Returns boolean

    • all keys with at least one value

      Returns Iterable<string>

    • iterate over all values

      If a key has multiple values they will be joined by delimiter.

      Parameters

      • Optionaldelimiter: string

      Returns IterableIterator<string>

    • iterate over all values added

      Returns IterableIterator<string>