MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / loadPruneMap

Function loadPruneMap

lib/state/utils.ts:95–105  ·  view source on GitHub ↗
(obj?: Record<string, number>)

Source from the content-addressed store, hash-verified

93}
94
95export function loadPruneMap(obj?: Record<string, number>): Map<string, number> {
96 if (!obj || typeof obj !== "object") {
97 return new Map()
98 }
99
100 const entries = Object.entries(obj).filter(
101 (entry): entry is [string, number] =>
102 typeof entry[0] === "string" && typeof entry[1] === "number",
103 )
104 return new Map(entries)
105}
106
107export function createPruneMessagesState(): PruneMessagesState {
108 return {

Callers 2

buildSessionStateFunction · 0.90
ensureSessionInitializedFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected