(system)
| 590 | } |
| 591 | |
| 592 | function flattenSystem(system) { |
| 593 | if (!system) { |
| 594 | return '' |
| 595 | } |
| 596 | if (typeof system === 'string') { |
| 597 | return system |
| 598 | } |
| 599 | return normalizeBlocks(system) |
| 600 | .filter(block => block.type === 'text') |
| 601 | .map(block => block.text || '') |
| 602 | .join('\n') |
| 603 | } |
| 604 | |
| 605 | function normalizeBlocks(content) { |
| 606 | if (!content) { |
no test coverage detected