Skip to content

Commit 477f926

Browse files
committed
fix test + lint
1 parent 77a12ac commit 477f926

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

packages/replay-internal/src/types/replayFrame.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ interface ReplayHistoryFrame extends ReplayBaseSpanFrame {
173173

174174
interface ReplayWebVitalFrame extends ReplayBaseSpanFrame {
175175
data: WebVitalData;
176-
op: 'largest-contentful-paint' | 'cumulative-layout-shift' | 'first-input-delay' | 'interaction-to-next-paint' | 'time-to-first-byte';
176+
op:
177+
| 'largest-contentful-paint'
178+
| 'cumulative-layout-shift'
179+
| 'first-input-delay'
180+
| 'interaction-to-next-paint'
181+
| 'time-to-first-byte';
177182
}
178183

179184
interface ReplayMemoryFrame extends ReplayBaseSpanFrame {

packages/replay-internal/src/util/createPerformanceEntries.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,14 @@ export function getLargestContentfulPaint(metric: Metric): ReplayPerformanceEntr
191191
* Add a CLS event to the replay based on a CLS metric.
192192
*/
193193
export function getCumulativeLayoutShift(metric: Metric): ReplayPerformanceEntry<WebVitalData> {
194-
const lastEntry = metric.entries[metric.entries.length - 1] as (PerformanceEntry & { sources?: LayoutShiftAttribution[] }) | undefined;
194+
const lastEntry = metric.entries[metric.entries.length - 1] as
195+
| (PerformanceEntry & { sources?: LayoutShiftAttribution[] })
196+
| undefined;
195197
const nodes: Node[] = [];
196198
if (lastEntry && lastEntry.sources) {
197199
for (const source of lastEntry.sources) {
198200
if (source.node) {
199-
nodes.push(source.node)
201+
nodes.push(source.node);
200202
}
201203

202204
}
@@ -251,7 +253,7 @@ export function getWebVital(
251253
}
252254
} else {
253255
if (node) {
254-
nodeIds.push(record.mirror.getId(node))
256+
nodeIds.push(record.mirror.getId(node));
255257
}
256258
}
257259

0 commit comments

Comments
 (0)