varias alteracoes
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-06 14:50:12 +02:00
parent 4f35313d06
commit e65cb26901
333 changed files with 54656 additions and 2058 deletions
+20
View File
@@ -0,0 +1,20 @@
function serializeCell(value, delimiter) {
const raw = String(value ?? '');
const formulaLike = /^[\u0000-\u0020\uFEFF]*[=+\-@]/.test(raw);
const numeric = /^-?\d+(?:\.\d+)?$/.test(raw);
const text = formulaLike && !numeric ? `'${raw}` : raw;
return /[",\r\n]/.test(text) || text.includes(delimiter)
? `"${text.replaceAll('"', '""')}"`
: text;
}
/** Serializes a comma-separated cell and neutralizes spreadsheet formulas. */
export function csvCell(value) {
return serializeCell(value, ',');
}
/** Serializes a cell for a locale-specific delimited export. */
export function csvCellWithDelimiter(value, delimiter) {
return serializeCell(value, delimiter);
}