(str, desiredLength)
| 141 | } |
| 142 | |
| 143 | function truncateWidth(str, desiredLength) { |
| 144 | if (str.length === strlen(str)) { |
| 145 | return str.substr(0, desiredLength); |
| 146 | } |
| 147 | |
| 148 | while (strlen(str) > desiredLength) { |
| 149 | str = str.slice(0, -1); |
| 150 | } |
| 151 | |
| 152 | return str; |
| 153 | } |
| 154 | |
| 155 | function truncateWidthWithAnsi(str, desiredLength) { |
| 156 | let code = codeRegex(true); |
no test coverage detected
searching dependent graphs…