MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / normalizeCodeLines

Function normalizeCodeLines

scripts/hsr/widget-view.mjs:102–107  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

100}
101
102function normalizeCodeLines(state) {
103 const lines = splitCodeDraft(joinCodeLines(state?.codeLines));
104 if (lines.length > 1 || (lines[0] ?? "").length > 0) return lines;
105 const fallbackDraft = typeof state?.codeDraft === "string" ? state.codeDraft : "";
106 return splitCodeDraft(fallbackDraft);
107}
108
109function normalizeCodeSelection(lines, selection) {
110 if (!selection || typeof selection !== "object") return null;

Callers 1

renderEditorPanelFunction · 0.85

Calls 2

splitCodeDraftFunction · 0.90
joinCodeLinesFunction · 0.90

Tested by

no test coverage detected