import type { StateSnapshot } from "./types"; export const snapshotReplacer = (_key: string, value: unknown) => { if (value instanceof Date) { return value.toISOString(); } if (typeof value === "function") { return undefined; } return value; }; export const buildSnapshotString = (snapshot: StateSnapshot) => JSON.stringify(snapshot, snapshotReplacer);