UNPKG

unused-assets-cli

Version:

CLI tool to list and remove unused assets in an Angular project

17 lines (16 loc) 421 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatBytes = formatBytes; /** * Convert bytes to human-readable format */ function formatBytes(bytes) { const units = ["B", "KB", "MB", "GB", "TB"]; let i = 0; let value = bytes; while (value >= 1024 && i < units.length - 1) { value /= 1024; i++; } return `${value.toFixed(2)} ${units[i]}`; }