diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 82c9643071..44f2a2963b 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -25,7 +25,7 @@ import { getInputType, toLowerCase, extractFileExtension, - absoluteToStylesheet + absoluteToStylesheet, } from './utils'; let _id = 1; diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index ece172a032..6b7700e2a4 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -96,18 +96,13 @@ export function escapeImportStatement(rule: CSSImportRule): string { export function stringifyStylesheet(s: CSSStyleSheet): string | null { try { const rules = s.rules || s.cssRules; - const stringifiedRules = Array - .from(rules, stringifyRule) + const stringifiedRules = Array.from(rules, stringifyRule) .map((rule) => { - return s.href ? absoluteToStylesheet(rule, s.href) : rule + return s.href ? absoluteToStylesheet(rule, s.href) : rule; }) .join(''); - return rules - ? fixBrowserCompatibilityIssuesInCSS( - stringifiedRules, - ) - : null; + return rules ? fixBrowserCompatibilityIssuesInCSS(stringifiedRules) : null; } catch (error) { return null; } diff --git a/packages/rrweb-snapshot/test/snapshot.test.ts b/packages/rrweb-snapshot/test/snapshot.test.ts index 11f79f2d9e..bfab523940 100644 --- a/packages/rrweb-snapshot/test/snapshot.test.ts +++ b/packages/rrweb-snapshot/test/snapshot.test.ts @@ -3,10 +3,7 @@ */ import { JSDOM } from 'jsdom'; import { describe, it, expect } from 'vitest'; -import { - serializeNodeWithId, - _isBlockedElement, -} from '../src/snapshot'; +import { serializeNodeWithId, _isBlockedElement } from '../src/snapshot'; import snapshot from '../src/snapshot'; import { serializedNodeWithId, elementNode } from '../src/types'; import { Mirror, absoluteToStylesheet } from '../src/utils';