scancss
Version:
A robust CSS stylesheet statistics collector and analyzer
21 lines (16 loc) • 527 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.handleComment = handleComment;
function handleComment(comment, report) {
report.comments.total++;
const commentLength = Buffer.byteLength(comment.toString(), 'utf8');
report.comments.length.total += commentLength;
if (report.comments.length.longest < commentLength) {
report.comments.length.longest = commentLength;
}
if (report.comments.length.shortest > commentLength) {
report.comments.length.shortest = commentLength;
}
}