This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: {{ file.size | prettyBytes }} | |
Vue.filter('prettyBytes', function (num) { | |
// jacked from: https://github.com/sindresorhus/pretty-bytes | |
if (typeof num !== 'number' || isNaN(num)) { | |
throw new TypeError('Expected a number'); | |
} | |
var exponent; | |
var unit; | |
var neg = num < 0; |