MCPcopy Index your code
hub / github.com/codeaashu/claude-code / turnDiffToDiffData

Function turnDiffToDiffData

src/components/diff/DiffDialog.tsx:30–54  ·  view source on GitHub ↗
(turn: TurnDiff)

Source from the content-addressed store, hash-verified

28 turn: TurnDiff;
29};
30function turnDiffToDiffData(turn: TurnDiff): DiffData {
31 const files = Array.from(turn.files.values()).map(f => ({
32 path: f.filePath,
33 linesAdded: f.linesAdded,
34 linesRemoved: f.linesRemoved,
35 isBinary: false,
36 isLargeFile: false,
37 isTruncated: false,
38 isNewFile: f.isNewFile
39 })).sort((a, b) => a.path.localeCompare(b.path));
40 const hunks = new Map<string, StructuredPatchHunk[]>();
41 for (const f of turn.files.values()) {
42 hunks.set(f.filePath, f.hunks);
43 }
44 return {
45 stats: {
46 filesCount: turn.stats.filesChanged,
47 linesAdded: turn.stats.linesAdded,
48 linesRemoved: turn.stats.linesRemoved
49 },
50 files,
51 hunks,
52 loading: false
53 };
54}
55export function DiffDialog(t0) {
56 const $ = _c(73);
57 const {

Callers 1

DiffDialogFunction · 0.85

Calls 2

valuesMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected