Skip to content

Commit

Permalink
ensure entry has toJSON function
Browse files Browse the repository at this point in the history
+ fix entry.toJSON not used
  • Loading branch information
bcaudan committed Sep 30, 2022
1 parent 02d5b25 commit 454dae8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ function computeEntryTracingInfo(entry: RumPerformanceResourceTiming, configurat
}

function toPerformanceEntryRepresentation(entry: RumPerformanceEntry): PerformanceEntryRepresentation {
if (supportPerformanceEntry() && entry instanceof PerformanceEntry) {
entry.toJSON()
}
return entry as PerformanceEntryRepresentation
return (
supportPerformanceEntry() && entry instanceof PerformanceEntry && 'toJSON' in entry ? entry.toJSON() : entry
) as PerformanceEntryRepresentation
}

/**
Expand Down

0 comments on commit 454dae8

Please sign in to comment.