MCPcopy Create free account
hub / github.com/anus-dev/ANUS / countLines

Function countLines

packages/core/src/tools/diffOptions.ts:22–35  ·  view source on GitHub ↗
(patch: Diff.ParsedDiff)

Source from the content-addressed store, hash-verified

20 userStr: string,
21): DiffStat {
22 const countLines = (patch: Diff.ParsedDiff) => {
23 let added = 0;
24 let removed = 0;
25 patch.hunks.forEach((hunk: Diff.Hunk) => {
26 hunk.lines.forEach((line: string) => {
27 if (line.startsWith('+')) {
28 added++;
29 } else if (line.startsWith('-')) {
30 removed++;
31 }
32 });
33 });
34 return { added, removed };
35 };
36
37 const patch = Diff.structuredPatch(
38 fileName,

Callers 1

getDiffStatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected