(bytes)
| 5 | const borderX = `${Array(30).join('-')}\n`; |
| 6 | |
| 7 | const formatBytes = (bytes) => { |
| 8 | if (bytes === 0) return '0 Byte' |
| 9 | const k = 1000; |
| 10 | const dm = 3; |
| 11 | const sizes = ['Bytes', 'KB', 'MB', 'GB']; |
| 12 | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| 13 | return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i] |
| 14 | }; |
| 15 | |
| 16 | const shakenPct = (n = 0, o = 0) => { |
| 17 | const pct = Math.max((100 - ((n / o) * 100)).toFixed(2), 0); |
no outgoing calls
no test coverage detected
searching dependent graphs…