1 import { Pipe, PipeTransform } from '@angular/core'
2 import { getBytes } from '@root-helpers/bytes'
4 // Thanks: https://github.com/danrevah/ngx-pipes/blob/master/src/ng-pipes/pipes/math/bytes.ts
6 @Pipe({ name: 'bytes' })
7 export class BytesPipe implements PipeTransform {
9 transform (value: number, precision?: number | undefined): string | number {
10 return getBytes(value, precision)