MCPcopy Create free account
hub / github.com/agenticsorg/edge-agents / computeDiff

Function computeDiff

scripts/sparc2/src/diff/diffTracker.ts:41–51  ·  view source on GitHub ↗
(
  oldText: string,
  newText: string,
  mode: "file" | "function" = "file",
)

Source from the content-addressed store, hash-verified

39 * @returns A DiffResult with diff text and count of changed lines
40 */
41export function computeDiff(
42 oldText: string,
43 newText: string,
44 mode: "file" | "function" = "file",
45): DiffResult {
46 if (mode === "file") {
47 return computeFileDiff(oldText, newText);
48 } else {
49 return computeFunctionDiff(oldText, newText);
50 }
51}
52
53/**
54 * Compute a diff between two files

Callers 2

analyzeAndDiffMethod · 0.90

Calls 2

computeFileDiffFunction · 0.85
computeFunctionDiffFunction · 0.85

Tested by

no test coverage detected