UNPKG

@codechecks/type-coverage-watcher

Version:

Track missing type coverage in TypeScript projects to ensure type safety

24 lines 872 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function formatShortDescription({ coverageDiffPerc, atLeast, headTypeCoveragePerc, newUntypedSymbols, }) { const change = renderSign(coverageDiffPerc) + perc(coverageDiffPerc); const limit = atLeast === undefined ? "" : ` (min. ${perc(atLeast)})`; const total = perc(headTypeCoveragePerc); return `Change: ${change} Total: ${total}${limit} New untyped symbols: ${newUntypedSymbols}`; } exports.formatShortDescription = formatShortDescription; function perc(n) { return n.toFixed(2) + "%"; } exports.perc = perc; function renderSign(value) { if (value > 0) { return "+"; } else { // we dont' render signs for negative (it's part of a number xD) or 0 return ""; } } exports.renderSign = renderSign; //# sourceMappingURL=formatters.js.map