export reset id function

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 14dac7c0cc
commit bbf23157c5
4 changed files with 5 additions and 4 deletions

1
index.d.ts vendored
View File

@@ -8,3 +8,4 @@ export function serializeNodeWithId(
doc: Document,
map: idNodeMap,
): serializedNodeWithId | null;
export function resetId(): void;

View File

@@ -1,6 +1,6 @@
{
"name": "rrweb-snapshot",
"version": "0.4.2",
"version": "0.4.3",
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",
"main": "dist/index.js",
"module": "dist/module.js",

View File

@@ -1,5 +1,5 @@
import snapshot, { serializeNodeWithId } from './snapshot';
import snapshot, { serializeNodeWithId, resetId } from './snapshot';
import rebuild from './rebuild';
export * from './types';
export { snapshot, serializeNodeWithId, rebuild };
export { snapshot, serializeNodeWithId, resetId, rebuild };

View File

@@ -13,7 +13,7 @@ function genId(): number {
return _id++;
}
function resetId() {
export function resetId() {
_id = 1;
}