From c59316530c846c18e8746c15831af07ef5e0b287 Mon Sep 17 00:00:00 2001 From: eoghanmurray Date: Tue, 20 Aug 2024 13:50:06 +0000 Subject: [PATCH] Apply formatting changes --- packages/rrdom/test/diff/dialog.test.ts | 4 +--- packages/rrweb-snapshot/src/utils.ts | 7 +++++-- packages/rrweb/src/record/observers/asset-manager.ts | 5 +---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/rrdom/test/diff/dialog.test.ts b/packages/rrdom/test/diff/dialog.test.ts index d0bb966e48..623fa826b0 100644 --- a/packages/rrdom/test/diff/dialog.test.ts +++ b/packages/rrdom/test/diff/dialog.test.ts @@ -7,9 +7,7 @@ import { Mirror as NodeMirror, serializedNodeWithId, } from 'rrweb-snapshot'; -import { - NodeType as RRNodeType, -} from '@rrweb/types'; +import { NodeType as RRNodeType } from '@rrweb/types'; import { RRDocument } from '../../src'; import { diff, ReplayerHandler } from '../../src/diff'; diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index f8d32d8a65..ada26a77f6 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -129,11 +129,14 @@ export function stringifyStylesheet(s: CSSStyleSheet): string | null { } } -export function stringifyCssRules(rules: CSSRuleList, sheetHref: string | null): string { +export function stringifyCssRules( + rules: CSSRuleList, + sheetHref: string | null, +): string { const stringifiedRules = Array.from(rules, (rule: CSSRule) => stringifyRule(rule, sheetHref), ).join(''); - return fixBrowserCompatibilityIssuesInCSS(stringifiedRules); + return fixBrowserCompatibilityIssuesInCSS(stringifiedRules); } export function stringifyRule(rule: CSSRule, sheetHref: string | null): string { diff --git a/packages/rrweb/src/record/observers/asset-manager.ts b/packages/rrweb/src/record/observers/asset-manager.ts index 9032d650c9..9182d9b6ae 100644 --- a/packages/rrweb/src/record/observers/asset-manager.ts +++ b/packages/rrweb/src/record/observers/asset-manager.ts @@ -177,10 +177,7 @@ export default class AssetManager { } const processStylesheet = () => { cssRules = el.sheet!.cssRules; // update, as a mutation may have since occurred - const cssText = stringifyCssRules( - cssRules, - sheetBaseHref, - ); + const cssText = stringifyCssRules(cssRules, sheetBaseHref); const payload: SerializedCssTextArg = { rr_type: 'CssText', cssTexts: [cssText],