Clip the tail of a buffer to a byte budget — engines put the "what went * wrong" line at the end of stderr.
(buf: Buffer, bytes: number)
| 292 | /** Clip the tail of a buffer to a byte budget — engines put the "what went |
| 293 | * wrong" line at the end of stderr. */ |
| 294 | function tailString(buf: Buffer, bytes: number): string { |
| 295 | if (buf.length <= bytes) return buf.toString('utf-8'); |
| 296 | return '\u2026' + buf.subarray(buf.length - bytes).toString('utf-8'); |
| 297 | } |
| 298 | |
| 299 | /** |
| 300 | * Strip high-confidence secret shapes from child stderr before it lands in |
no outgoing calls
no test coverage detected