Convert formatBytes to TypeScript

pull/2197/head
Bogdan 8 months ago
parent 5cbbd060a4
commit 379071f838

@ -1,6 +1,6 @@
import { filesize } from 'filesize';
function formatBytes(input) {
function formatBytes(input: string | number) {
const size = Number(input);
if (isNaN(size)) {
@ -9,7 +9,7 @@ function formatBytes(input) {
return `${filesize(size, {
base: 2,
round: 1
round: 1,
})}`;
}
Loading…
Cancel
Save