Skip to content

Commit

Permalink
fix: correctly merge 'details' into 'metadata'
Browse files Browse the repository at this point in the history
  • Loading branch information
niieani committed Sep 25, 2024
1 parent 9a9ac60 commit e9ef553
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/v2/defaultEventProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ export const defaultEventProcessor: EventProcessor = (
}

const detail = typeof entry.detail === 'object' && entry.detail
const metadata =
const existingMetadata =
'metadata' in entry && typeof entry.metadata === 'object'
? detail
? { ...detail, ...entry.metadata }
: entry.metadata
? entry.metadata
: {}
const metadata = detail
? { ...detail, ...existingMetadata }
: existingMetadata

let kind = entry.entryType
let commonName = entry.name
let status: EventStatus = 'ok'
Expand Down

0 comments on commit e9ef553

Please sign in to comment.