feat(sync): export formatBytes
All checks were successful
Actions / Build and Push Documentation (push) Successful in 15s
All checks were successful
Actions / Build and Push Documentation (push) Successful in 15s
This commit is contained in:
parent
d78b862360
commit
dbf2743409
2 changed files with 2 additions and 2 deletions
|
@ -1 +1 @@
|
|||
export { iteratePackwizIndex } from "./sync";
|
||||
export { iteratePackwizIndex, formatBytes } from "./sync";
|
||||
|
|
|
@ -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;
|
||||
|
|
Reference in a new issue