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

Function countHunkLines

src/hooks/useTurnDiffs.ts:55–68  ·  view source on GitHub ↗
(hunks: StructuredPatchHunk[])

Source from the content-addressed store, hash-verified

53}
54
55function countHunkLines(hunks: StructuredPatchHunk[]): {
56 added: number
57 removed: number
58} {
59 let added = 0
60 let removed = 0
61 for (const hunk of hunks) {
62 for (const line of hunk.lines) {
63 if (line.startsWith('+')) added++
64 else if (line.startsWith('-')) removed++
65 }
66 }
67 return { added, removed }
68}
69
70function getUserPromptPreview(message: Message): string {
71 if (message.type !== 'user') return ''

Callers 1

useTurnDiffsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected