From 1a3b17bae44f47c1f46a6a63746b68a7359c5164 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] format code --- src/snapshot.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/snapshot.ts b/src/snapshot.ts index 2c0e170e..da6fcf1c 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -248,16 +248,16 @@ export function serializeNodeWithId( console.warn(n, 'not serialized'); return null; } - let id + let id; // Try to reuse the previous id if ('__sn' in n) { - id = n.__sn.id + id = n.__sn.id; } else { - id = genId() + id = genId(); } const serializedNode = Object.assign(_serializedNode, { id }); (n as INode).__sn = serializedNode; - map[id] = (n as INode); + map[id] = n as INode; let recordChild = !skipChild; if (serializedNode.type === NodeType.Element) { recordChild = recordChild && !serializedNode.needBlock;