(textarea: HTMLTextAreaElement)
| 5 | !value || value === ' ' || value === '\n'; |
| 6 | |
| 7 | const getSelectedString = (textarea: HTMLTextAreaElement) => { |
| 8 | const [start, end] = [textarea.selectionStart, textarea.selectionEnd]; |
| 9 | const last = start === end ? start + 1 : end; |
| 10 | const text = textarea.value.substring(start, last); |
| 11 | const trailing = textarea.value[start - 1]; |
| 12 | const leading = textarea.value[start - 1]; |
| 13 | |
| 14 | return [text, trailing, leading]; |
| 15 | }; |
| 16 | |
| 17 | const splitString = (value: string, [start, end]: number[]) => { |
| 18 | const left = value.substring(0, start); |
no outgoing calls
no test coverage detected