* clears the current line the cursor is on: * -1 for left of the cursor * +1 for right of the cursor * 0 for the entire line
(stream, dir, callback)
| 93 | */ |
| 94 | |
| 95 | function clearLine(stream, dir, callback) { |
| 96 | if (callback !== undefined) { |
| 97 | validateFunction(callback, 'callback'); |
| 98 | } |
| 99 | |
| 100 | if (stream === null || stream === undefined) { |
| 101 | if (typeof callback === 'function') process.nextTick(callback, null); |
| 102 | return true; |
| 103 | } |
| 104 | |
| 105 | const type = |
| 106 | dir < 0 ? kClearToLineBeginning : dir > 0 ? kClearToLineEnd : kClearLine; |
| 107 | return stream.write(type, callback); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * clears the screen from the current position of the cursor down |
no test coverage detected
searching dependent graphs…