@me2em/pact
    Preparing search index...

    Function assertValidPayload

    • Strict payload validation for ty (PACTS §7.3 + D35 limits + D34 check-verification). Used by decodeEvent, validateEvent and every assembler — all sides fail closed.

      Parameters

      • ty: EventType

        The event type (v1 registry) deciding the normative shape.

      • pl: Record<string, unknown>

        The payload object to validate.

      • context: PactErrorContext = 'codec'

        Reporting layer for the PactError.

      Returns void

      PactError MALFORMED on unknown/missing fields or a failed inline check; PAYLOAD_TOO_LARGE when the canonical payload exceeds PAYLOAD_MAX_BYTES.

      assertValidPayload('EXIT', { rs: 'leaving' }); // ok
      assertValidPayload('ACT', { no: 'x'.repeat(33) }); // PAYLOAD_TOO_LARGE