* Returns the accumulated string, with truncation marker if truncated
()
| 179 | * Returns the accumulated string, with truncation marker if truncated |
| 180 | */ |
| 181 | toString(): string { |
| 182 | if (!this.isTruncated) { |
| 183 | return this.content |
| 184 | } |
| 185 | |
| 186 | const truncatedBytes = this.totalBytesReceived - this.maxSize |
| 187 | const truncatedKB = Math.round(truncatedBytes / 1024) |
| 188 | return this.content + `\n... [output truncated - ${truncatedKB}KB removed]` |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Clears all accumulated data |