Skip to content

mergeEventConfig

mergeEventConfig<T>(base, custom, options?): T

Merge custom event configuration into base configuration.

  • Skips undefined, empty strings, and empty arrays
  • Deep merges metadata (original + custom)

T extends Record<string, unknown>

T

Base event configuration

Partial<T> | undefined

Custom configuration to merge (can be undefined)

MergeEventConfigOptions = {}

Merge options

T

Merged configuration

const base = { id: "event-1", title: "Event", metadata: { a: 1, b: 2 } };
const custom = { title: "Custom Event", metadata: { b: 3, c: 4 } };
const result = mergeEventConfig(base, custom);
// Result: { id: "event-1", title: "Custom Event", metadata: { a: 1, b: 3, c: 4 } }