access-sniff
Version:
A node/iojs library & CLI for HTML_Codesniffer
32 lines (24 loc) • 885 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
var CreateReportsJson = function CreateReportsJson(reports) {
var reportLogs = {};
var totalIssueCount = { error: 0, warning: 0, notice: 0 };
var AllReportsLintFree = void 0;
reports.forEach(function (report) {
var fileName = report.fileName,
lintFree = report.lintFree,
messageLog = report.messageLog,
counters = report.counters;
if (lintFree) {
AllReportsLintFree = true;
}
totalIssueCount.error += counters.error;
totalIssueCount.warning += counters.warning;
totalIssueCount.notice += counters.notice;
reportLogs[fileName] = { counters: counters, messageLog: messageLog };
});
return { reportLogs: reportLogs, totalIssueCount: totalIssueCount, AllReportsLintFree: AllReportsLintFree };
};
exports.default = CreateReportsJson;
;