mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-14 22:09:29 +02:00
chore: move abs below return check
This commit is contained in:
@@ -22,10 +22,10 @@ const readStats = async (path: string): Promise<Record<string, number>> => {
|
||||
};
|
||||
|
||||
const formatBytes = (bytes: number): string => {
|
||||
bytes = Math.abs(bytes);
|
||||
if (bytes == 0) {
|
||||
return '0 Bytes';
|
||||
}
|
||||
bytes = Math.abs(bytes);
|
||||
const base = 1024;
|
||||
const decimals = 2;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
Reference in New Issue
Block a user