UNPKG

@taiga-ui/cdk

Version:

Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance

18 lines 845 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatMigrationStats = formatMigrationStats; const get_execution_time_1 = require("./get-execution-time"); function formatMigrationStats(steps, totalMs) { const fallbackTotal = steps.reduce((sum, step) => sum + step.durationMs, 0); const total = totalMs > 0 ? totalMs : fallbackTotal; return [ 'Migration timing breakdown:', ...[...steps] .sort((first, second) => second.durationMs - first.durationMs) .map((step) => { const percent = total > 0 ? (step.durationMs / total) * 100 : 0; return `- ${step.name}: ${(0, get_execution_time_1.getExecutionTime)(0, step.durationMs)} (${Math.round(percent)}%)`; }), ].join('\n'); } //# sourceMappingURL=format-migration-stats.js.map