(prompt: string, perLine: number)
| 235 | } |
| 236 | |
| 237 | export function clear(prompt: string, perLine: number) { |
| 238 | if (!perLine) return erase.line + cursor.to(0); |
| 239 | let rows = 0; |
| 240 | let lines = prompt.split(/\r?\n/); |
| 241 | for (let line of lines) { |
| 242 | rows += 1 + Math.floor(Math.max(strip(line).length - 1, 0) / perLine); |
| 243 | } |
| 244 | |
| 245 | return erase.lines(rows); |
| 246 | } |
| 247 | |
| 248 | export function lines(msg: string, perLine: number) { |
| 249 | let lines = String(strip(msg) || "").split(/\r?\n/); |