(answer: string)
| 66 | * file quietly doing the model's job. |
| 67 | */ |
| 68 | export function unfence(answer: string): string { |
| 69 | const trimmed = answer.trim(); |
| 70 | if (!trimmed.startsWith('```')) { |
| 71 | return trimmed; |
| 72 | } |
| 73 | const lines = trimmed.split('\n'); |
| 74 | const body = lines.slice(1, lines[lines.length - 1].trim().startsWith('```') |
| 75 | ? lines.length - 1 |
| 76 | : lines.length); |
| 77 | return body.join('\n').trim(); |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Say exactly why a rewrite was refused. |
no outgoing calls
no test coverage detected