diff --git a/debug/filesize.js b/debug/filesize.js index 8053288..7bd7188 100644 --- a/debug/filesize.js +++ b/debug/filesize.js @@ -44,7 +44,7 @@ "use strict"; var filesize = function (arg) { - var pos, short, num, sizes, size, result, regex, suffix, i, n, x, z; + var pos, short, num, sizes, size, result, regex, suffix, i, z; if (typeof arguments[2] !== "undefined") { pos = arguments[1]; diff --git a/production/filesize.js b/production/filesize.js index 263044c..f69a8fd 100644 --- a/production/filesize.js +++ b/production/filesize.js @@ -40,4 +40,4 @@ * @param {Boolean} short [Optional] Shorthand output, similar to "ls -lh", overrides pos to 1 * @return {String} Readable file size String */ -(function(a){"use strict";var b=function(a){var b,c,d,e,f,g,h,i,j,k,l,m;typeof arguments[2]!="undefined"?(b=arguments[1],c=arguments[2]):typeof arguments[1]=="boolean"?c=arguments[1]:b=arguments[1];if(isNaN(a)||typeof b!="undefined"&&isNaN(b))throw Error("Invalid arguments");c=c===!0,b=c?1:typeof b=="undefined"?2:parseInt(b),d=String(a).indexOf(".")>-1?parseFloat(a):parseInt(a),e=[["B",0],["KB",1024],["MB",1048576],["GB",1073741824],["TB",1099511627776]],j=e.length,g="",h=/\.(.*)/;while(j--){f=e[j][1],i=e[j][0];if(d>=f){g=(i==="B"?d:d/f).toFixed(b),c&&(i=i.slice(0,1),m=h.exec(g),m!==null&&typeof m[1]!="undefined"&&m[1]==="0"&&(g=parseInt(g))),g+=i;break}}return g};switch(!0){case typeof exports!="undefined":module.exports=b;break;case typeof define=="function":define(function(){return b});break;default:a.filesize=b}})(this) \ No newline at end of file +(function(a){"use strict";var b=function(a){var b,c,d,e,f,g,h,i,j,k;typeof arguments[2]!="undefined"?(b=arguments[1],c=arguments[2]):typeof arguments[1]=="boolean"?c=arguments[1]:b=arguments[1];if(isNaN(a)||typeof b!="undefined"&&isNaN(b))throw Error("Invalid arguments");c=c===!0,b=c?1:typeof b=="undefined"?2:parseInt(b),d=String(a).indexOf(".")>-1?parseFloat(a):parseInt(a),e=[["B",0],["KB",1024],["MB",1048576],["GB",1073741824],["TB",1099511627776]],j=e.length,g="",h=/\.(.*)/;while(j--){f=e[j][1],i=e[j][0];if(d>=f){g=(i==="B"?d:d/f).toFixed(b),c&&(i=i.slice(0,1),k=h.exec(g),k!==null&&typeof k[1]!="undefined"&&k[1]==="0"&&(g=parseInt(g))),g+=i;break}}return g};switch(!0){case typeof exports!="undefined":module.exports=b;break;case typeof define=="function":define(function(){return b});break;default:a.filesize=b}})(this) \ No newline at end of file