mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
fix: Handle negative numbers in formatBytes
This commit is contained in:
@@ -22,6 +22,7 @@ const readStats = async (path: string): Promise<Record<string, number>> => {
|
||||
};
|
||||
|
||||
const formatBytes = (bytes: number): string => {
|
||||
bytes = Math.abs(bytes);
|
||||
if (bytes == 0) {
|
||||
return '0 Bytes';
|
||||
}
|
||||
|
Reference in New Issue
Block a user