MCPcopy
hub / github.com/codeaashu/claude-code / transformLinesToObjects

Function transformLinesToObjects

src/components/StructuredDiff/Fallback.tsx:125–150  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

123 return <Box key={i}>{node}</Box>;
124}
125export function transformLinesToObjects(lines: string[]): LineObject[] {
126 return lines.map(code => {
127 if (code.startsWith('+')) {
128 return {
129 code: code.slice(1),
130 i: 0,
131 type: 'add',
132 originalCode: code.slice(1)
133 };
134 }
135 if (code.startsWith('-')) {
136 return {
137 code: code.slice(1),
138 i: 0,
139 type: 'remove',
140 originalCode: code.slice(1)
141 };
142 }
143 return {
144 code: code.slice(1),
145 i: 0,
146 type: 'nochange',
147 originalCode: code.slice(1)
148 };
149 });
150}
151
152// Group adjacent add/remove lines for word-level diffing
153export function processAdjacentLines(lineObjects: LineObject[]): LineObject[] {

Callers 1

formatDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected