Skip to content

Commit 41901ec

Browse files
committed
Fixing AMD loading (for real)
1 parent 5c177a9 commit 41901ec

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

debug/filesize.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@
6666
}
6767

6868
return result;
69-
},
70-
fn = function () { window.filesize = filesize; };
69+
};
7170

7271
// AMD support
73-
typeof define === "function" ? define("filesize", fn) : fn();
72+
typeof define === "function" ? define("filesize", function () { return filesize; }) : window.filesize = filesize;
7473
})(window);

production/filesize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
* @author Jason Mulligan <[email protected]>
3232
* @version 1.2
3333
*/
34-
(function(a){"use strict";var b=function(a,b){var c=String(a).indexOf(".")>-1?parseFloat(a):parseInt(a),d=[{B:0},{KB:1024},{MB:1048576},{GB:1073741824},{TB:1099511627776}],e=d.length,f="",g,h,i,j;b=typeof b=="undefined"?2:parseInt(b);while(e--){j=d[e];for(i in j)if(j.hasOwnProperty(i)){g=j[i],h=i;break}if(c>=g){f=(h==="B"?c:(c/g).toFixed(b))+h;break}}return f},c=function(){a.filesize=b};typeof define=="function"?define("filesize",c):c()})(window)
34+
(function(a){"use strict";var b=function(a,b){var c=String(a).indexOf(".")>-1?parseFloat(a):parseInt(a),d=[{B:0},{KB:1024},{MB:1048576},{GB:1073741824},{TB:1099511627776}],e=d.length,f="",g,h,i,j;b=typeof b=="undefined"?2:parseInt(b);while(e--){j=d[e];for(i in j)if(j.hasOwnProperty(i)){g=j[i],h=i;break}if(c>=g){f=(h==="B"?c:(c/g).toFixed(b))+h;break}}return f};typeof define=="function"?define("filesize",function(){return b}):a.filesize=b})(window)

0 commit comments

Comments
 (0)