()
| 8 | |
| 9 | export default class TextPrompt extends Prompt<string> { |
| 10 | get userInputWithCursor() { |
| 11 | if (this.state === 'submit') { |
| 12 | return this.userInput; |
| 13 | } |
| 14 | const userInput = this.userInput; |
| 15 | if (this.cursor >= userInput.length) { |
| 16 | return `${this.userInput}█`; |
| 17 | } |
| 18 | const s1 = userInput.slice(0, this.cursor); |
| 19 | const [s2, ...s3] = userInput.slice(this.cursor); |
| 20 | return `${s1}${styleText('inverse', s2)}${s3.join('')}`; |
| 21 | } |
| 22 | get cursor() { |
| 23 | return this._cursor; |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected