export function renderCsv(headers, rows) {
    const lines = [headers, ...rows].map((line) => line.map(escapeCell).join(','));
    return `${lines.join('\n')}\n`;
}
function escapeCell(value) {
    if (value.includes(',') || value.includes('"') || value.includes('\n')) {
        return `"${value.replaceAll('"', '""')}"`;
    }
    return value;
}
