MCPcopy Index your code
hub / github.com/anomalyco/opencode / diff

Function diff

packages/opencode/src/cli/cmd/export.ts:27–33  ·  view source on GitHub ↗
(kind: string, diffs: { file?: string; patch?: string }[] | undefined)

Source from the content-addressed store, hash-verified

25}
26
27function diff(kind: string, diffs: { file?: string; patch?: string }[] | undefined) {
28 return diffs?.map((item, i) => ({
29 ...item,
30 file: item.file === undefined ? undefined : redact(`${kind}-file`, String(i), item.file),
31 patch: item.patch === undefined ? undefined : redact(`${kind}-patch`, String(i), item.patch),
32 }))
33}
34
35function source(part: SessionV1.FilePart) {
36 if (!part.source) return part.source

Callers 1

sanitizeFunction · 0.70

Calls 1

redactFunction · 0.85

Tested by

no test coverage detected