File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/integration-tests/utils Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ function isFullSnapshot(event: RecordingEvent): event is FullRecordingSnapshot {
8585 return event . type === EventType . FullSnapshot ;
8686}
8787
88+ function isCustomSnapshot ( event : RecordingEvent ) : event is RecordingEvent & { data : CustomRecordingEvent } {
89+ return event . type === EventType . Custom ;
90+ }
91+
8892/**
8993 * This returns the replay container (assuming it exists).
9094 * Note that due to how this works with playwright, this is a POJO copy of replay.
@@ -146,10 +150,10 @@ export function getCustomRecordingEvents(resOrReq: Request | Response): CustomRe
146150}
147151
148152function getAllCustomRrwebRecordingEvents ( recordingEvents : RecordingEvent [ ] ) : CustomRecordingEvent [ ] {
149- return recordingEvents . filter ( event => event . type === 5 ) . map ( event => event . data as CustomRecordingEvent ) ;
153+ return recordingEvents . filter ( isCustomSnapshot ) . map ( event => event . data ) ;
150154}
151155
152- function getReplayBreadcrumbs ( recordingEvents : RecordingEvent [ ] , category ?: string ) : Breadcrumb [ ] {
156+ function getReplayBreadcrumbs ( recordingEvents : RecordingSnapshot [ ] , category ?: string ) : Breadcrumb [ ] {
153157 return getAllCustomRrwebRecordingEvents ( recordingEvents )
154158 . filter ( data => data . tag === 'breadcrumb' )
155159 . map ( data => data . payload )
You can’t perform that action at this time.
0 commit comments