INNER CODE UNIT · JavaScript
parse
adaltas/node-csv · packages/csv-parse/lib/index.js:79
const parse = function () {
let data, options, callback;
for (const i in arguments) {
const argument = arguments[i];
const type = typeof argument;
if (
data === undefined &&
(typeof argument === "string" || Buffer.isBuffer(argument))
) {
data = argument;
} else if (options === undefined && is_object(argument)) {
options = argument;
} else if (callback === undefined && type === "function") {
callback = argument;
} else {
throw new CsvError(
"CSV_INVALID_ARGUMENT",
["Invalid argument:", `got ${JSON.stringify(argument)} at index ${i}`],