format code

This commit is contained in:
Yanzhen Yu
2021-06-29 18:37:49 +08:00
parent b1a8b6926a
commit 778b22dc81
3 changed files with 6 additions and 7 deletions

View File

@@ -154,7 +154,7 @@ function buildNode(
node.appendChild(child);
continue;
}
try {
if (n.isSVG && name === 'xlink:href') {
node.setAttributeNS('http://www.w3.org/1999/xlink', name, value);
@@ -269,7 +269,7 @@ export function buildNodeWithSN(
}
if (n.rootId) {
console.assert(
(map[n.rootId] as unknown as Document) === doc,
((map[n.rootId] as unknown) as Document) === doc,
'Target document should has the same root id.',
);
}
@@ -332,7 +332,7 @@ function handleScroll(node: INode) {
if (n.type !== NodeType.Element) {
return;
}
const el = node as Node as HTMLElement;
const el = (node as Node) as HTMLElement;
for (const name in n.attributes) {
if (!(n.attributes.hasOwnProperty(name) && name.startsWith('rr_'))) {
continue;

View File

@@ -362,12 +362,12 @@ function serializeNode(
maskInputOptions = {},
maskTextFn,
recordCanvas,
keepIframeSrcFn
keepIframeSrcFn,
} = options;
// Only record root id when document object is not the base document
let rootId: number | undefined;
if ((doc as unknown as INode).__sn) {
const docId = (doc as unknown as INode).__sn.id;
if (((doc as unknown) as INode).__sn) {
const docId = ((doc as unknown) as INode).__sn.id;
rootId = docId === 1 ? undefined : docId;
}
switch (n.nodeType) {

View File

@@ -110,4 +110,3 @@ export type SlimDOMOptions = Partial<{
export type MaskTextFn = (text: string) => string;
export type KeepIframeSrcFn = (src: string) => boolean;