WME/aufgabe5/node_modules/csvtojson/v2/getEol.js

27 lines
771 B
JavaScript
Raw Normal View History

2019-01-09 11:25:28 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//return first eol found from a data chunk.
function default_1(data, param) {
if (!param.eol && data) {
for (var i = 0, len = data.length; i < len; i++) {
if (data[i] === "\r") {
if (data[i + 1] === "\n") {
param.eol = "\r\n";
break;
}
else if (data[i + 1]) {
param.eol = "\r";
break;
}
}
else if (data[i] === "\n") {
param.eol = "\n";
break;
}
}
}
return param.eol || "\n";
}
exports.default = default_1;
;
//# sourceMappingURL=getEol.js.map