(s: string | null)
| 29 | |
| 30 | // Truncate each side to UI_MAX_DIFF_BYTES, with a marker |
| 31 | const truncate = (s: string | null): string | null => { |
| 32 | if (s === null) return null; |
| 33 | if (s.length <= UI_MAX_DIFF_BYTES) return s; |
| 34 | const half = Math.floor(UI_MAX_DIFF_BYTES / 2); |
| 35 | return s.slice(0, half) + |
| 36 | `\n\n... [${(s.length - UI_MAX_DIFF_BYTES).toLocaleString()} bytes elided for display — full content will be written] ...\n\n` + |
| 37 | s.slice(-half); |
| 38 | }; |
| 39 | |
| 40 | return { |
| 41 | path, |
no outgoing calls
no test coverage detected