MCPcopy Create free account
hub / github.com/anomalyco/opencode / merge

Function merge

packages/opencode/src/project/vcs.ts:23–29  ·  view source on GitHub ↗
(...lists: Git.Item[][])

Source from the content-addressed store, hash-verified

21 new Map(list.map((item) => [item.file, { additions: item.additions, deletions: item.deletions }] as const))
22
23const merge = (...lists: Git.Item[][]) => {
24 const out = new Map<string, Git.Item>()
25 lists.flat().forEach((item) => {
26 if (!out.has(item.file)) out.set(item.file, item)
27 })
28 return [...out.values()]
29}
30
31const emptyBatch = () => ({ patches: new Map<string, string>(), capped: false })
32

Callers 1

vcs.tsFile · 0.70

Calls 2

setMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected