@@ -1,6 +1,12 @@
|
||||
function serializeCell(value, delimiter) {
|
||||
const raw = String(value ?? '');
|
||||
const formulaLike = /^[\u0000-\u0020\uFEFF]*[=+\-@]/.test(raw);
|
||||
let prefix = 0;
|
||||
while (
|
||||
prefix < raw.length &&
|
||||
(raw.charCodeAt(prefix) <= 32 || raw.charCodeAt(prefix) === 0xfeff)
|
||||
)
|
||||
prefix++;
|
||||
const formulaLike = /^[=+\-@]/.test(raw.slice(prefix));
|
||||
const numeric = /^-?\d+(?:\.\d+)?$/.test(raw);
|
||||
const text = formulaLike && !numeric ? `'${raw}` : raw;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user