From edae6f22ec35a0adcc7e1c4b525341d24fe46e8b Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Wed, 15 Aug 2012 18:30:15 -0400 Subject: [PATCH] Shouldn't have been in the commit --- lib/dist/filesize.js | 70 ---------------------------------------- lib/dist/filesize.min.js | 11 ------- 2 files changed, 81 deletions(-) delete mode 100644 lib/dist/filesize.js delete mode 100644 lib/dist/filesize.min.js diff --git a/lib/dist/filesize.js b/lib/dist/filesize.js deleted file mode 100644 index 3ecd529..0000000 --- a/lib/dist/filesize.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * filesize - * - * @author Jason Mulligan - * @copyright Jason Mulligan 2012 - * @license BSD-3 - * @link https://github.com/avoidwork/filesize.js - * @module filesize - * @version 1.6.6 - */ - -(function (global) { - "use strict"; - - /** - * filesize - * - * @param {Mixed} arg String, Int or Float to transform - * @param {Number} pos [Optional] Position to round to, defaults to 2 if short is ommitted - * @param {Boolean} short [Optional] Shorthand output, similar to "ls -lh", overrides pos to 1 - * @return {String} Readable file size String - */ - var filesize = function (arg) { - var pos, short, num, sizes, size, result, regex, suffix, i, z; - - if (typeof arguments[2] !== "undefined") { - pos = arguments[1]; - short = arguments[2]; - } - else typeof arguments[1] === "boolean" ? short = arguments[1] : pos = arguments[1]; - - if (isNaN(arg) || (typeof pos !== "undefined" && isNaN(pos))) throw Error("Invalid arguments"); - - short = (short === true); - pos = short ? 1 : (typeof pos === "undefined" ? 2 : parseInt(pos)); - num = String(arg).indexOf(".") > -1 ? parseFloat(arg) : parseInt(arg); - sizes = [["B", 0], ["KB", 1024], ["MB", 1048576], ["GB", 1073741824], ["TB", 1099511627776]]; - i = sizes.length; - result = ""; - regex = /\.(.*)/; - - while (i--) { - size = sizes[i][1]; - suffix = sizes[i][0]; - if (num >= size) { - result = (suffix === "B" ? num : (num / size)).toFixed(pos); - if (short) { - suffix = suffix.slice(0, 1); - z = regex.exec(result); - if (z !== null && typeof z[1] !== "undefined" && z[1] === "0") result = parseInt(result); - } - result += suffix; - break; - } - } - - return result; - }; - - switch (true) { - case typeof exports !== "undefined": - module.exports = filesize; - break; - case typeof define === "function": - define(function () { return filesize; }); - break; - default: - global.filesize = filesize; - } -})(this); \ No newline at end of file diff --git a/lib/dist/filesize.min.js b/lib/dist/filesize.min.js deleted file mode 100644 index 3f1fe91..0000000 --- a/lib/dist/filesize.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * filesize - * - * @author Jason Mulligan - * @copyright Jason Mulligan 2012 - * @license BSD-3 - * @link https://github.com/avoidwork/filesize.js - * @module filesize - * @version 1.6.6 - */ -(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