Function: stripForwardedEventMetadata()
stripForwardedEventMetadata<
TPayload>(payload:TPayload):StrippedForwardedEventMetadata<TPayload>
Defined in: electron/utils/eventMetadataForwarding.ts:150
Produces a shallow clone of the provided payload with event-bus metadata properties removed.
Type Parameters
TPayload
TPayload extends object | readonly unknown[]
Parameters
payload
TPayload
Payload that may carry forwarded metadata. Must be an array or an object; primitives are rejected at runtime.
Returns
StrippedForwardedEventMetadata<TPayload>
A shallow clone of payload with metadata properties removed. The original object is never mutated.
Remarks
Internal event buses attach metadata on the _meta, _originalMeta, and
ORIGINAL_METADATA_SYMBOL properties. When forwarding these payloads
across process or layer boundaries (for example, from the orchestrator to the
renderer), consumers often need a clean view of the domain payload without
bus-specific metadata.
This helper centralises that stripping logic so multiple callers do not duplicate knowledge of the metadata property keys.
For object payloads, the return type is Omit of _meta and
_originalMeta. For array payloads, the same array type is returned.
Throws
TypeError If a primitive payload (non-object, non-array) is provided. Event metadata is only attached to object or array payloads, so attempting to strip metadata from primitives usually indicates a programming error.