feat(sync): export formatBytes
All checks were successful
Actions / Build and Push Documentation (push) Successful in 15s

This commit is contained in:
cswimr 2025-02-12 15:15:08 -06:00
parent d78b862360
commit dbf2743409
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
2 changed files with 2 additions and 2 deletions

View file

@ -1 +1 @@
export { iteratePackwizIndex } from "./sync";
export { iteratePackwizIndex, formatBytes } from "./sync";

View file

@ -52,7 +52,7 @@ async function downloadFile(
* @param decimals - The number of decimal places to use.
* @returns Formatted string (e.g., "1.23 MB").
*/
function formatBytes(bytes: number, decimals: number = 2) {
export function formatBytes(bytes: number, decimals: number = 2) {
if (bytes === 0) return "0 Bytes";
const k = 1024; // or 1000 for decimal units
const dm = decimals < 0 ? 0 : decimals;