MCPcopy Index your code
hub / github.com/rtfpessoa/diff2html / deconstructLine

Function deconstructLine

src/render-utils.ts:126–132  ·  view source on GitHub ↗
(line: string, isCombined: boolean, escape = true)

Source from the content-addressed store, hash-verified

124 * Deconstructs diff @line by separating the content from the prefix type
125 */
126export function deconstructLine(line: string, isCombined: boolean, escape = true): DiffLineParts {
127 const indexToSplit = prefixLength(isCombined);
128 return {
129 prefix: line.substring(0, indexToSplit),
130 content: escape ? escapeForHtml(line.substring(indexToSplit)) : line.substring(indexToSplit),
131 };
132}
133
134/**
135 * Generates pretty filename diffs

Callers 1

diffHighlightFunction · 0.85

Calls 2

prefixLengthFunction · 0.85
escapeForHtmlFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…