File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 1
1
import type { IWindow , listenerHandler , RecordPlugin } from '@rrweb/types' ;
2
- import { findLast , patch } from '../../../utils' ;
2
+ import { patch } from '../../../utils' ;
3
3
import { stringify , StringifyOptions } from '../../utils/stringify' ;
4
+ import { findLast } from '../../utils/find-last' ;
4
5
5
6
export type InitiatorType =
6
7
| 'audio'
Original file line number Diff line number Diff line change
1
+ export function findLast < T > (
2
+ array : Array < T > ,
3
+ predicate : ( value : T ) => boolean ,
4
+ ) : T | undefined {
5
+ const length = array . length ;
6
+ for ( let i = length - 1 ; i >= 0 ; i -= 1 ) {
7
+ if ( predicate ( array [ i ] ) ) {
8
+ return array [ i ] ;
9
+ }
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -545,15 +545,3 @@ export function inDom(n: Node): boolean {
545
545
if ( ! doc ) return false ;
546
546
return doc . contains ( n ) || shadowHostInDom ( n ) ;
547
547
}
548
-
549
- export function findLast < T > (
550
- array : Array < T > ,
551
- predicate : ( value : T ) => boolean ,
552
- ) : T | undefined {
553
- const length = array . length ;
554
- for ( let i = length - 1 ; i >= 0 ; i -= 1 ) {
555
- if ( predicate ( array [ i ] ) ) {
556
- return array [ i ] ;
557
- }
558
- }
559
- }
You can’t perform that action at this time.
0 commit comments