pick #286, export slim DOM options
This commit is contained in:
11
src/utils.ts
11
src/utils.ts
@@ -15,7 +15,7 @@ import {
|
||||
scrollData,
|
||||
inputData,
|
||||
} from './types';
|
||||
import { INode } from 'rrweb-snapshot';
|
||||
import { INode, IGNORED_NODE } from 'rrweb-snapshot';
|
||||
|
||||
export function on(
|
||||
type: string,
|
||||
@@ -197,6 +197,15 @@ export function isBlocked(node: Node | null, blockClass: blockClass): boolean {
|
||||
return isBlocked(node.parentNode, blockClass);
|
||||
}
|
||||
|
||||
export function isIgnored(n: Node | INode): boolean {
|
||||
if ('__sn' in n) {
|
||||
return (n as INode).__sn.id === IGNORED_NODE;
|
||||
}
|
||||
// The main part of the slimDOM check happens in
|
||||
// rrweb-snapshot::serializeNodeWithId
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isAncestorRemoved(target: INode): boolean {
|
||||
const id = mirror.getId(target);
|
||||
if (!mirror.has(id)) {
|
||||
|
||||
Reference in New Issue
Block a user