(draft)
| 3 | } |
| 4 | |
| 5 | export 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 | |
| 11 | export function joinCodeLines(lines) { |
| 12 | if (!Array.isArray(lines) || lines.length === 0) return ""; |
no test coverage detected