parse-lcov
Version:
26 lines (21 loc) • 600 B
JavaScript
;
exports.__esModule = true;
exports.isLineType = isLineType;
exports.isEnd = isEnd;
exports.parseLine = parseLine;
var linesTypes = ["TN", "SF", "FN", "FNDA", "FNF", "FNH", "BRDA", "BRF", "BRH", "DA", "LF", "LH"];
function isLineType(string) {
return linesTypes.includes(string);
}
function isEnd(string) {
return string === "end_of_record";
}
function parseLine(line) {
var _line$split = line.split(":"),
type = _line$split[0],
data = _line$split[1];
return {
type: isLineType(type) ? type : undefined,
data: (data != null ? data : "").split(",")
};
}