Skip to content

Commit

Permalink
Apply formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellanoce authored and github-actions[bot] committed Nov 13, 2023
1 parent 41e146b commit b9e2753
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ export default class MutationBuffer {
const getParentId = (n: Node): number | null => {
if (!n.parentNode) return null;
return isShadowRoot(n.parentNode)
? this.mirror.getId(getShadowHost(n))
: this.mirror.getId(n.parentNode);
? this.mirror.getId(getShadowHost(n))
: this.mirror.getId(n.parentNode);
};
const pushAdd = (n: Node) => {
if (!n.parentNode || !inDom(n)) {
Expand Down Expand Up @@ -385,7 +385,7 @@ export default class MutationBuffer {
adds.push({
parentId,
nextId: getNextId(addedNode),
node: sn
node: sn,
});
addedIds.add(sn.id);
}
Expand Down
16 changes: 11 additions & 5 deletions packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ export class Replayer {
// is newly added document, maybe the document node of an iframe
return this.newDocumentQueue.push(mutation);
}
return allowQueue ? addToQueue(mutation) : false
return allowQueue ? addToQueue(mutation) : false;
}

if (mutation.node.isShadow) {
Expand All @@ -1528,7 +1528,7 @@ export class Replayer {
next = mirror.getNode(mutation.nextId);
}
if (nextNotInDOM(mutation)) {
return allowQueue ? addToQueue(mutation) : false
return allowQueue ? addToQueue(mutation) : false;
}

if (mutation.node.rootId && !mirror.getNode(mutation.node.rootId)) {
Expand Down Expand Up @@ -1687,7 +1687,11 @@ export class Replayer {
appendNode(mutation);
});

const iterateResolveTree = (tree: ResolveTree, mirror: RRDOMMirror | Mirror, cb: (mutation: addedNodeMutation) => unknown) => {
const iterateResolveTree = (
tree: ResolveTree,
mirror: RRDOMMirror | Mirror,
cb: (mutation: addedNodeMutation) => unknown,
) => {
if (tree.value) {
cb(tree.value);
}
Expand All @@ -1701,9 +1705,11 @@ export class Replayer {
}
while (nextChild) {
iterateResolveTree(nextChild, mirror, cb);
nextChild = nextChild.value ? tree.children.get(nextChild.value.node.id) : undefined;
nextChild = nextChild.value
? tree.children.get(nextChild.value.node.id)
: undefined;
}
}
};
const startTime = Date.now();
for (const tree of queue) {
iterateResolveTree(tree, mirror, (mutation: addedNodeMutation) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export function polyfill(win = window) {
}

export type ResolveTree = {
id: number,
id: number;
value: addedNodeMutation | null;
children: Map<number | null, ResolveTree>;
};
Expand Down

0 comments on commit b9e2753

Please sign in to comment.