* Clears the current line the cursor is on. * @param {-1|0|1} dir Direction to clear: * -1 for left of the cursor * +1 for right of the cursor * 0 for the entire line * @returns {Readline} this
(dir)
| 91 | * @returns {Readline} this |
| 92 | */ |
| 93 | clearLine(dir) { |
| 94 | validateInteger(dir, 'dir', -1, 1); |
| 95 | |
| 96 | const data = |
| 97 | dir < 0 ? kClearToLineBeginning : |
| 98 | dir > 0 ? kClearToLineEnd : |
| 99 | kClearLine; |
| 100 | if (this.#autoCommit) process.nextTick(() => this.#stream.write(data)); |
| 101 | else ArrayPrototypePush(this.#todo, data); |
| 102 | return this; |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Clears the screen from the current position of the cursor down. |
no test coverage detected