(state)
| 100 | } |
| 101 | |
| 102 | function 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 | |
| 109 | function normalizeCodeSelection(lines, selection) { |
| 110 | if (!selection || typeof selection !== "object") return null; |
no test coverage detected