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

22 lines
800 B
JavaScript
Raw Normal View History

2019-01-09 11:25:28 +00:00
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var getEol_1 = __importDefault(require("./getEol"));
// const getEol = require("./getEol");
/**
* convert data chunk to file lines array
* @param {string} data data chunk as utf8 string
* @param {object} param Converter param object
* @return {Object} {lines:[line1,line2...],partial:String}
*/
function stringToLines(data, param) {
var eol = getEol_1.default(data, param);
var lines = data.split(eol);
var partial = lines.pop() || "";
return { lines: lines, partial: partial };
}
exports.stringToLines = stringToLines;
;
//# sourceMappingURL=fileline.js.map