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 {
85
85
return event . type === EventType . FullSnapshot ;
86
86
}
87
87
88
+ function isCustomSnapshot ( event : RecordingEvent ) : event is RecordingEvent & { data : CustomRecordingEvent } {
89
+ return event . type === EventType . Custom ;
90
+ }
91
+
88
92
/**
89
93
* This returns the replay container (assuming it exists).
90
94
* 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
146
150
}
147
151
148
152
function 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 ) ;
150
154
}
151
155
152
- function getReplayBreadcrumbs ( recordingEvents : RecordingEvent [ ] , category ?: string ) : Breadcrumb [ ] {
156
+ function getReplayBreadcrumbs ( recordingEvents : RecordingSnapshot [ ] , category ?: string ) : Breadcrumb [ ] {
153
157
return getAllCustomRrwebRecordingEvents ( recordingEvents )
154
158
. filter ( data => data . tag === 'breadcrumb' )
155
159
. map ( data => data . payload )
You can’t perform that action at this time.
0 commit comments