Skip to content

Commit

Permalink
fix(replay): Fix types in WebVitalData (#13573)
Browse files Browse the repository at this point in the history
Fixes attribution type: when adding an attribution in CLS we add
{`value`, `nodeIds`} not {`value`, `sources`}
  • Loading branch information
c298lee authored Sep 3, 2024
1 parent f5ef470 commit d5f9f9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/replay-internal/src/types/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export interface WebVitalData {
/**
* The layout shifts of a CLS metric
*/
attributions?: { value: number; sources?: number[] }[];
attributions?: { value: number; nodeIds?: number[] }[];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export function getLargestContentfulPaint(metric: Metric): ReplayPerformanceEntr
return getWebVital(metric, 'largest-contentful-paint', node);
}

function isLayoutShift(entry: PerformanceEntry | LayoutShift): entry is LayoutShift {
function isLayoutShift(entry: PerformanceEntry): entry is LayoutShift {
return (entry as LayoutShift).sources !== undefined;
}

Expand Down

0 comments on commit d5f9f9d

Please sign in to comment.