diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-18 14:35:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-18 14:35:31 +0200 |
commit | c199c427d4ae586339822320f20f512a7a19dc3f (patch) | |
tree | 9cbe8bebc25e97d2e8086c41bcd7180dd752dbac /client/src/assets/player/utils.ts | |
parent | cdf4cb9eaf5f6bc71f7c1e1963c07575f1d2593d (diff) | |
download | PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.gz PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.zst PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.zip |
Better typings
Diffstat (limited to 'client/src/assets/player/utils.ts')
-rw-r--r-- | client/src/assets/player/utils.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts index 46081c0d2..c87287482 100644 --- a/client/src/assets/player/utils.ts +++ b/client/src/assets/player/utils.ts | |||
@@ -12,7 +12,7 @@ const dictionaryBytes: Array<{max: number, type: string}> = [ | |||
12 | { max: 1073741824, type: 'MB' }, | 12 | { max: 1073741824, type: 'MB' }, |
13 | { max: 1.0995116e12, type: 'GB' } | 13 | { max: 1.0995116e12, type: 'GB' } |
14 | ] | 14 | ] |
15 | function bytes (value: any) { | 15 | function bytes (value: number) { |
16 | const format = dictionaryBytes.find(d => value < d.max) || dictionaryBytes[dictionaryBytes.length - 1] | 16 | const format = dictionaryBytes.find(d => value < d.max) || dictionaryBytes[dictionaryBytes.length - 1] |
17 | const calc = Math.floor(value / (format.max / 1024)).toString() | 17 | const calc = Math.floor(value / (format.max / 1024)).toString() |
18 | 18 | ||