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

Function resolveFileDiff

packages/session-ui/src/components/session-diff.ts:30–37  ·  view source on GitHub ↗
(diff: DiffSource)

Source from the content-addressed store, hash-verified

28const patchFileDiffCache = new Map<string, FileDiffMetadata>()
29
30export function resolveFileDiff(diff: DiffSource) {
31 if (typeof diff.patch === "string") return fileDiffFromPatch(diff.file, diff.patch)
32 return fileDiffFromContent(
33 diff.file,
34 typeof diff.before === "string" ? diff.before : "",
35 typeof diff.after === "string" ? diff.after : "",
36 )
37}
38
39export function normalize(diff: ReviewDiff): ViewDiff {
40 return {

Callers 3

renderFunction · 0.90
normalizeFunction · 0.85

Calls 2

fileDiffFromPatchFunction · 0.85
fileDiffFromContentFunction · 0.85

Tested by

no test coverage detected