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

Function stampEntryKey

web/lib/scroll-memory.ts:59–67  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

57}
58
59function stampEntryKey(key: string): void {
60 try {
61 // 展开保留 Next 自己的 state 字段,只增补一个独立属性;省略第三参 url
62 // 不改变当前 URL(第二参为已废弃的 title,浏览器忽略)。
63 window.history.replaceState({ ...readState(), __kbScrollKey: key }, "");
64 } catch {
65 // 个别环境 replaceState 受限:退化为「这次不记忆」,不致命。
66 }
67}
68
69// Date.now 仅作可读前缀;keyCounter 单调递增才是唯一性保证(同毫秒也不撞)。
70function mintKey(): string {

Callers 3

currentEntryKeyFunction · 0.85
forceNewEntryKeyFunction · 0.85
ensureEntryKeyFunction · 0.85

Calls 1

readStateFunction · 0.85

Tested by

no test coverage detected