(existing any, incoming any)
| 728 | } |
| 729 | |
| 730 | func mergeEventConfig(existing any, incoming any) any { |
| 731 | existingMap, existingOK := existing.(map[string]any) |
| 732 | incomingMap, incomingOK := incoming.(map[string]any) |
| 733 | if !existingOK || !incomingOK { |
| 734 | return incoming |
| 735 | } |
| 736 | merged := maps.Clone(existingMap) |
| 737 | maps.Copy(merged, incomingMap) |
| 738 | |
| 739 | existingTypes, existingTypesOK := parseEventTypes(existingMap["types"]) |
| 740 | incomingTypes, incomingTypesOK := parseEventTypes(incomingMap["types"]) |
| 741 | if existingTypesOK && incomingTypesOK { |
| 742 | combined := sliceutil.MergeUnique(existingTypes, incomingTypes...) |
| 743 | merged["types"] = combined |
| 744 | } |
| 745 | |
| 746 | return merged |
| 747 | } |
| 748 | |
| 749 | func parseEventTypes(value any) ([]string, bool) { |
| 750 | switch typed := value.(type) { |
no test coverage detected