MCPcopy Create free account
hub / github.com/modem-dev/hunk / serializeSpans

Function serializeSpans

src/ui/staticDiffPager.ts:72–74  ·  view source on GitHub ↗

Serialize highlighted code spans into ANSI text, preserving a row background when present.

(spans: RenderSpan[], rowBg: string)

Source from the content-addressed store, hash-verified

70
71/** Serialize highlighted code spans into ANSI text, preserving a row background when present. */
72function serializeSpans(spans: RenderSpan[], rowBg: string) {
73 return spans.map((span) => colorText(span.text, span.fg, span.bg ?? rowBg)).join("");
74}
75
76/** Serialize spans into one fixed-width pane so split rows keep both sides aligned. */
77function serializeSpansFixedWidth(spans: RenderSpan[], rowBg: string, width: number) {

Callers 1

renderStaticStackRowFunction · 0.85

Calls 1

colorTextFunction · 0.85

Tested by

no test coverage detected