MCPcopy Create free account
hub / github.com/Noumena-Network/code / deduplicateEdits

Function deduplicateEdits

src/services/api/claude.ts:3143–3152  ·  view source on GitHub ↗
(block: CachedMCEditsBlock)

Source from the content-addressed store, hash-verified

3141
3142 // Helper to deduplicate a cache_edits block against already-seen deletions
3143 const deduplicateEdits = (block: CachedMCEditsBlock): CachedMCEditsBlock => {
3144 const uniqueEdits = block.edits.filter(edit => {
3145 if (seenDeleteRefs.has(edit.cache_reference)) {
3146 return false
3147 }
3148 seenDeleteRefs.add(edit.cache_reference)
3149 return true
3150 })
3151 return { ...block, edits: uniqueEdits }
3152 }
3153
3154 // Re-insert all previously-pinned cache_edits at their original positions
3155 for (const pinned of pinnedEdits ?? []) {

Callers 1

addCacheBreakpointsFunction · 0.85

Calls 2

hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected