MCPcopy Create free account
hub / github.com/Noumena-Network/code / calculateWordDiffs

Function calculateWordDiffs

src/components/StructuredDiff/Fallback.tsx:227–234  ·  view source on GitHub ↗
(oldText: string, newText: string)

Source from the content-addressed store, hash-verified

225
226// Calculate word-level diffs between two text strings
227export function calculateWordDiffs(oldText: string, newText: string): DiffPart[] {
228 // Use diffWordsWithSpace instead of diffWords to preserve whitespace
229 // This ensures spaces between tokens like > and { are preserved
230 const result = diffWordsWithSpace(oldText, newText, {
231 ignoreCase: false
232 });
233 return result;
234}
235
236// Process word-level diffs with manual wrapping support
237function generateWordDiffElements(item: DiffLine, width: number, maxWidth: number, dim: boolean, overrideTheme?: ThemeName): React.ReactNode[] | null {

Callers 1

generateWordDiffElementsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected