style(rebuild.ts snapshot.ts): format code

This commit is contained in:
Yun Feng
2021-06-23 16:58:38 +08:00
parent f5509d3a47
commit 2cf4ddd9e2
2 changed files with 8 additions and 5 deletions

View File

@@ -203,12 +203,15 @@ function buildNode(
(node as HTMLElement).style.height = value; (node as HTMLElement).style.height = value;
} }
if (name === 'rr_mediaCurrentTime') { if (name === 'rr_mediaCurrentTime') {
(node as HTMLMediaElement).currentTime = n.attributes.rr_mediaCurrentTime as number (node as HTMLMediaElement).currentTime = n.attributes
.rr_mediaCurrentTime as number;
} }
if (name === 'rr_mediaState') { if (name === 'rr_mediaState') {
switch (value) { switch (value) {
case 'played': case 'played':
(node as HTMLMediaElement).play().catch(e => console.warn("media playback error", e)); (node as HTMLMediaElement)
.play()
.catch((e) => console.warn('media playback error', e));
break; break;
case 'paused': case 'paused':
(node as HTMLMediaElement).pause(); (node as HTMLMediaElement).pause();

View File

@@ -363,8 +363,8 @@ function serializeNode(
} = options; } = options;
// Only record root id when document object is not the base document // Only record root id when document object is not the base document
let rootId: number | undefined; let rootId: number | undefined;
if (((doc as unknown) as INode).__sn) { if ((doc as unknown as INode).__sn) {
const docId = ((doc as unknown) as INode).__sn.id; const docId = (doc as unknown as INode).__sn.id;
rootId = docId === 1 ? undefined : docId; rootId = docId === 1 ? undefined : docId;
} }
switch (n.nodeType) { switch (n.nodeType) {
@@ -464,7 +464,7 @@ function serializeNode(
attributes.rr_mediaState = (n as HTMLMediaElement).paused attributes.rr_mediaState = (n as HTMLMediaElement).paused
? 'paused' ? 'paused'
: 'played'; : 'played';
attributes.rr_mediaCurrentTime = (n as HTMLMediaElement).currentTime attributes.rr_mediaCurrentTime = (n as HTMLMediaElement).currentTime;
} }
// scroll // scroll
if ((n as HTMLElement).scrollLeft) { if ((n as HTMLElement).scrollLeft) {