(humanFileSize: string)
| 25 | } |
| 26 | |
| 27 | export function bytesFromHumanFileSize(humanFileSize: string) { |
| 28 | const [numberString, unit] = humanFileSize.split(' '); |
| 29 | const number = Number.parseFloat(numberString); |
| 30 | |
| 31 | return number * |
| 32 | (unit === 'B' ? 1 : 1024 ** (['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'].indexOf(unit) + 1)); |
| 33 | } |
| 34 | |
| 35 | export type SortColumn = 'name' | 'updated_at' | 'size_in_bytes'; |
| 36 | export type SortOrder = 'asc' | 'desc'; |
no outgoing calls
no test coverage detected