Skip to content

Commit

Permalink
Apply formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdnguyen authored and github-actions[bot] committed Jul 16, 2024
1 parent 8f6498d commit 88fbb74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/rrweb-snapshot/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
getInputType,
toLowerCase,
extractFileExtension,
absoluteToStylesheet
absoluteToStylesheet,
} from './utils';

let _id = 1;
Expand Down
11 changes: 3 additions & 8 deletions packages/rrweb-snapshot/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions packages/rrweb-snapshot/test/snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 88fbb74

Please sign in to comment.