(content: string)
| 10 | type EditorStdio = "inherit" | "pipe" | "ignore" | number | Stream |
| 11 | |
| 12 | export function normalizePromptContent(content: string) { |
| 13 | if (content.endsWith("\r\n")) { |
| 14 | const body = content.slice(0, -2) |
| 15 | return !body.includes("\n") && !body.includes("\r") ? body : content |
| 16 | } |
| 17 | |
| 18 | if (content.endsWith("\n")) { |
| 19 | const body = content.slice(0, -1) |
| 20 | return !body.includes("\n") && !body.includes("\r") ? body : content |
| 21 | } |
| 22 | |
| 23 | return content |
| 24 | } |
| 25 | |
| 26 | export async function openEditor(input: { value: string; renderer: CliRenderer; cwd?: string; stdin?: EditorStdio }) { |
| 27 | const editor = process.env.VISUAL || process.env.EDITOR |
no outgoing calls
no test coverage detected