mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-02 15:16:49 +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 => {
|
const formatBytes = (bytes: number): string => {
|
||||||
|
bytes = Math.abs(bytes);
|
||||||
if (bytes == 0) {
|
if (bytes == 0) {
|
||||||
return '0 Bytes';
|
return '0 Bytes';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user