mhtml-stream
    Preparing search index...

    Interface ParseOptions

    options for mhtml parsing

    interface ParseOptions {
        decoderOverrides?: Map<string, Decoder>;
    }
    Index

    Properties

    decoderOverrides?: Map<string, Decoder>

    custom decoders keyed by (lowercased) Content-Transfer-Encoding

    Use these to handle an encoding the defaults don't, or to override one. A Decoder turns the CRLF-split lines of a part into its decoded bytes; the parser strips the CRLFs when splitting, so a passthrough decoder re-emits them between lines:

    const crlf = new Uint8Array([13, 10]);
    const decoderOverrides = new Map([
    ["binary", async function* (lines) {
    let first = true;
    for await (const line of lines) {
    if (!first) yield crlf;
    first = false;
    yield line;
    }
    }],
    ]);