import { Pipe, PipeTransform } from '@angular/core';
import { filesize } from "filesize";

@Pipe({
  name: 'filesize'
})
/**
 * FilesizePipe uses filesize.js to transform filesizes to human readable formats.
 */
export class FilesizePipe implements PipeTransform {

  transform(value: number): string | number | any[] | {
    value: any;
    symbol: any;
    exponent: number;
    unit: string;
} {
    return filesize(value);
  }

}
