csv = {
const EOL = Symbol("EOL");
const EOF = Symbol("EOF");
const QUOTE = 34;
const NEWLINE = 10;
const RETURN = 13;
function dsv(DELIMITER) {
return function(text) {
const columns = [];
let N = (text = text + "").length;
let I = 0;
let n = 0;
let k = 0;
let t;
let eof = N <= 0;
let eol = false;
if (text.charCodeAt(N - 1) === NEWLINE) --N;
if (text.charCodeAt(N - 1) === RETURN) --N;
function token() {
if (eof) return EOF;
if (eol) return eol = false, EOL;
var i, j = I, c;
if (text.charCodeAt(j) === QUOTE) {
while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);
if ((i = I) >= N) eof = true;
else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;
else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }
return text.slice(j + 1, i - 1).replace(/""/g, "\"");
}
while (I < N) {
if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;
else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }
else if (c !== DELIMITER) continue;
return text.slice(j, i) || undefined;
}
return eof = true, text.slice(j, N) || undefined;
}
while ((t = token()) !== EOF) {
while (t !== EOL && t !== EOF) {
(columns[k] = (columns[k] || new Array(n)))[n] = t;
t = token();
++k;
}
k = 0;
++n;
}
return columns;
};
}
return dsv(",".charCodeAt(0));
}