mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
307 B
16 lines
307 B
8 years ago
|
'use strict'
|
||
|
|
||
|
import filesize from 'filesize.js'
|
||
|
import toUpper from 'lodash/toUpper'
|
||
|
|
||
|
module.exports = {
|
||
|
/**
|
||
|
* Convert bytes to humanized form
|
||
|
* @param {number} rawSize Size in bytes
|
||
|
* @returns {string} Humanized file size
|
||
|
*/
|
||
|
filesize(rawSize) {
|
||
|
return toUpper(filesize(rawSize))
|
||
|
}
|
||
|
}
|