@me2em/pact
    Preparing search index...

    Function decodeEvent

    • Strict parse of canonical event bytes: UTF-8 → JSON → exact envelope shape → per-type payload validation. Any deviation rejects (MALFORMED / UNKNOWN_EVENT_TYPE / PAYLOAD_TOO_LARGE); nothing is skipped or coerced.

      Parameters

      • bytes: Uint8Array

        Canonical event bytes (UTF-8 JSON, JCS-normalized).

      Returns Event

      The parsed and fully validated event.

      PactError MALFORMED on invalid UTF-8/JSON, unknown or missing envelope fields, payload violations; UNKNOWN_EVENT_TYPE / PAYLOAD_TOO_LARGE per validateEvent.

      const event = decodeEvent(line); // line = one export line