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

Function splitCodeDraft

scripts/hsr/widget-code-editor-state.mjs:5–9  ·  view source on GitHub ↗
(draft)

Source from the content-addressed store, hash-verified

3}
4
5export function splitCodeDraft(draft) {
6 const normalized = toSafeString(draft).replace(/\r\n?/g, "\n");
7 const lines = normalized.length > 0 ? normalized.split("\n") : [""];
8 return Object.freeze(lines.map((line) => toSafeString(line)));
9}
10
11export function joinCodeLines(lines) {
12 if (!Array.isArray(lines) || lines.length === 0) return "";

Callers 6

buildViewFunction · 0.90
normalizeCodeLinesFunction · 0.90
clampCodeCursorFunction · 0.85
findBannerCursorFunction · 0.85
createCodeEditorStateFunction · 0.85

Calls 2

toSafeStringFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected