* Writes either `data` or a `key` sequence identified by * `key` to the `output`. * @param {string} d * @param {{ * ctrl?: boolean; * meta?: boolean; * shift?: boolean; * name?: string; * }} [key] * @returns {void}
(d, key)
| 598 | * @returns {void} |
| 599 | */ |
| 600 | write(d, key) { |
| 601 | if (this.closed) { |
| 602 | throw new ERR_USE_AFTER_CLOSE('readline'); |
| 603 | } |
| 604 | if (this.paused) this.resume(); |
| 605 | if (this.terminal) { |
| 606 | this[kTtyWrite](d, key); |
| 607 | } else { |
| 608 | this[kNormalWrite](d); |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | [kNormalWrite](b) { |
| 613 | if (b === undefined) { |
no test coverage detected