MCPcopy Create free account
hub / github.com/Qinbf/groundmap / currentEntryKey

Function currentEntryKey

web/lib/scroll-memory.ts:76–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74
75/** 取当前历史条目的稳定 key;首次到达该条目时生成并写回 history.state。 */
76export function currentEntryKey(): string {
77 if (typeof window === "undefined") return "ssr";
78 const existing = readState().__kbScrollKey;
79 if (typeof existing === "string") return existing;
80 const key = mintKey();
81 stampEntryKey(key);
82 return key;
83}
84
85/**
86 * 强制给当前历史条目发一个全新 key 并写回 state(覆盖原有的)。

Callers 2

ScrollMemoryFunction · 0.90

Calls 3

readStateFunction · 0.85
mintKeyFunction · 0.85
stampEntryKeyFunction · 0.85

Tested by

no test coverage detected