From 1c069aac77a01f4c101710d921c80003e488b754 Mon Sep 17 00:00:00 2001 From: eoghanmurray Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] Apply formatting changes --- packages/rrweb/src/record/observer.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/rrweb/src/record/observer.ts b/packages/rrweb/src/record/observer.ts index 01a23218..bdfaae54 100644 --- a/packages/rrweb/src/record/observer.ts +++ b/packages/rrweb/src/record/observer.ts @@ -244,7 +244,9 @@ function initMouseInteractionObserver({ if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) { // we are actually listening on 'pointerdown' eventKey = 'TouchStart'; - } else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) { + } else if ( + MouseInteractions[eventKey] === MouseInteractions.MouseUp + ) { // we are actually listening on 'pointerup' eventKey = 'TouchEnd'; } @@ -259,7 +261,7 @@ function initMouseInteractionObserver({ currentPointerType = pointerType; } else if (MouseInteractions[eventKey] === MouseInteractions.Click) { pointerType = currentPointerType; - currentPointerType = null; // cleanup as we've used it + currentPointerType = null; // cleanup as we've used it } if (!e) { return; @@ -271,7 +273,7 @@ function initMouseInteractionObserver({ id, x: clientX, y: clientY, - ...pointerType && { pointerType } + ...(pointerType && { pointerType }), }); }; }; @@ -286,15 +288,15 @@ function initMouseInteractionObserver({ let eventName = eventKey.toLowerCase(); const handler = getHandler(eventKey); if (window.PointerEvent) { - switch(MouseInteractions[eventKey]) { - case MouseInteractions.MouseDown: - case MouseInteractions.MouseUp: - eventName = eventName.replace('mouse', 'pointer'); - break; - case MouseInteractions.TouchStart: - case MouseInteractions.TouchEnd: - // these are handled by pointerdown/pointerup - return; + switch (MouseInteractions[eventKey]) { + case MouseInteractions.MouseDown: + case MouseInteractions.MouseUp: + eventName = eventName.replace('mouse', 'pointer'); + break; + case MouseInteractions.TouchStart: + case MouseInteractions.TouchEnd: + // these are handled by pointerdown/pointerup + return; } } handlers.push(on(eventName, handler, doc));