filesize
Advanced tools
Comparing version 6.2.3 to 6.2.4
@@ -7,5 +7,22 @@ ### Changelog | ||
#### [6.2.4](https://github.com//avoidwork/filesize.js.git/compare/6.2.4...6.2.4) | ||
#### [6.2.4](https://github.com//avoidwork/filesize.js.git/compare/6.2.3...6.2.4) | ||
> 15 April 2021 | ||
- Fixing late application of `pad` [`6c1d2cb`](https://github.com//avoidwork/filesize.js.git/commit/6c1d2cbea5fa52e2392fae22140864927c7f0bf2) | ||
- Updating travis-ci.org [`8878747`](https://github.com//avoidwork/filesize.js.git/commit/8878747305b7117356bd2a8b72b1deb5cf28f61f) | ||
#### [6.2.3](https://github.com//avoidwork/filesize.js.git/compare/6.2.2...6.2.3) | ||
> 15 April 2021 | ||
- Updating dependencies, updating `bannerShort` in `rollup.config.js` [`86b4374`](https://github.com//avoidwork/filesize.js.git/commit/86b43745e55db1539759745c7e80c61aa22911fd) | ||
- Updating CHANGELOG.md [`493e759`](https://github.com//avoidwork/filesize.js.git/commit/493e7594cf8f8e22d548f5f2acc5fe117a55be7f) | ||
- Fixing README.md [`f6667c8`](https://github.com//avoidwork/filesize.js.git/commit/f6667c83e27ddc122d39e0004a9968102ae7c735) | ||
#### [6.2.2](https://github.com//avoidwork/filesize.js.git/compare/6.2.1...6.2.2) | ||
> 14 April 2021 | ||
> 13 April 2021 | ||
@@ -38,3 +55,3 @@ - Small package cleanup [`#130`](https://github.com//avoidwork/filesize.js.git/pull/130) | ||
> 22 February 2020 | ||
> 21 February 2020 | ||
@@ -58,10 +75,9 @@ - Adding `exponent` to `object` output, fixes #112 [`#113`](https://github.com//avoidwork/filesize.js.git/pull/113) | ||
> 31 October 2019 | ||
> 30 October 2019 | ||
- This reverts commit 1263ce4990ea3219c4b14aa2a8e941869dd808fc, reversing [`#104`](https://github.com//avoidwork/filesize.js.git/pull/104) | ||
- This reverts commit 3a088db57570ff352eb9a33ccdcb9d07c9fcb04d, reversing [`#106`](https://github.com//avoidwork/filesize.js.git/pull/106) | ||
- Create FUNDING.yml [`#106`](https://github.com//avoidwork/filesize.js.git/pull/106) | ||
- Revert "Fixing the hackish type definition, fixes #105" [`#105`](https://github.com//avoidwork/filesize.js.git/issues/105) | ||
- Revert "Merge pull request #104 from avoidwork/modernize" [`3909b04`](https://github.com//avoidwork/filesize.js.git/commit/3909b04d72b7a8129d94a03612898feedf4d39b3) | ||
- Reverting modern build as it's too problematic at this time, major version bump to roll forward [`71a9ead`](https://github.com//avoidwork/filesize.js.git/commit/71a9ead9ed03e0701728cdf1007271502c442808) | ||
- Updating `CHANGELOG` [`5b88732`](https://github.com//avoidwork/filesize.js.git/commit/5b88732fa45242413fc96dc14afdde8938251d54) | ||
- Revert "Merge pull request #106 from avoidwork/avoidwork-patch-1" [`ec99f00`](https://github.com//avoidwork/filesize.js.git/commit/ec99f0041e432f13ce61df6856fbc112c8f6538d) | ||
@@ -85,3 +101,3 @@ #### [5.0.3](https://github.com//avoidwork/filesize.js.git/compare/5.0.2...5.0.3) | ||
> 1 October 2019 | ||
> 30 September 2019 | ||
@@ -92,3 +108,3 @@ - Fixing the hackish type definition, fixes #105 [`#105`](https://github.com//avoidwork/filesize.js.git/issues/105) | ||
> 1 October 2019 | ||
> 30 September 2019 | ||
@@ -131,3 +147,3 @@ - Modernizing build & outputs [`#104`](https://github.com//avoidwork/filesize.js.git/pull/104) | ||
> 13 February 2019 | ||
> 14 February 2019 | ||
@@ -191,3 +207,3 @@ - Adding `locale` option which overrides `separator`, fixes #96 [`#96`](https://github.com//avoidwork/filesize.js.git/issues/96) | ||
> 7 March 2017 | ||
> 6 March 2017 | ||
@@ -206,3 +222,3 @@ - Building missing files, updating README [`77db546`](https://github.com//avoidwork/filesize.js.git/commit/77db5467b33a5ae44d1dec83bcbbbd58732cd815) | ||
> 25 January 2017 | ||
> 24 January 2017 | ||
@@ -213,3 +229,3 @@ - Adding `fullforms` for overriding full form [`727db07`](https://github.com//avoidwork/filesize.js.git/commit/727db07732c8803e89c874743cd3d5a6ba7f7d8e) | ||
> 25 January 2017 | ||
> 24 January 2017 | ||
@@ -220,3 +236,3 @@ - Fixing `0 bytes` [`d957df3`](https://github.com//avoidwork/filesize.js.git/commit/d957df3e3484b28470b008da45f1a34d54b85c0d) | ||
> 25 January 2017 | ||
> 24 January 2017 | ||
@@ -251,3 +267,3 @@ - Updating README [`7bc227e`](https://github.com//avoidwork/filesize.js.git/commit/7bc227ec811ade1a7e2c58e01546893a2ee42b4c) | ||
> 20 January 2017 | ||
> 19 January 2017 | ||
@@ -320,3 +336,3 @@ - Changing a statement to be a little easier to read, updating build status graphic to be SVG for better rendering on various devices [`de2e388`](https://github.com//avoidwork/filesize.js.git/commit/de2e38839d7e450b7492ecfb9ca5228c1bdbe0e9) | ||
> 28 February 2015 | ||
> 27 February 2015 | ||
@@ -369,3 +385,3 @@ - Removing unneeded nesting of conditionals [`a4448cd`](https://github.com//avoidwork/filesize.js.git/commit/a4448cdb63d1828c07ae3d2f8e1385d31f693135) | ||
> 1 March 2014 | ||
> 28 February 2014 | ||
@@ -377,3 +393,3 @@ - Minor change [`#53`](https://github.com//avoidwork/filesize.js.git/pull/53) | ||
> 1 March 2014 | ||
> 28 February 2014 | ||
@@ -387,3 +403,3 @@ - Removing a file [`#52`](https://github.com//avoidwork/filesize.js.git/pull/52) | ||
> 25 February 2014 | ||
> 24 February 2014 | ||
@@ -401,3 +417,3 @@ - Adding language overriding via optional `suffixes` dictionary [`#49`](https://github.com//avoidwork/filesize.js.git/pull/49) | ||
#### [1.10.0](https://github.com//avoidwork/filesize.js.git/compare/1.9.6...1.10.0) | ||
#### [1.10.0](https://github.com//avoidwork/filesize.js.git/compare/1.9.7...1.10.0) | ||
@@ -412,2 +428,8 @@ > 19 July 2013 | ||
#### [1.9.7](https://github.com//avoidwork/filesize.js.git/compare/1.9.6...1.9.7) | ||
> 8 July 2013 | ||
- Fixing scientific notation (google!), fixes #39 [`#39`](https://github.com//avoidwork/filesize.js.git/issues/39) | ||
#### [1.9.6](https://github.com//avoidwork/filesize.js.git/compare/1.9.5...1.9.6) | ||
@@ -529,3 +551,3 @@ | ||
> 3 November 2012 | ||
> 2 November 2012 | ||
@@ -537,3 +559,3 @@ - Minor changes [`#11`](https://github.com//avoidwork/filesize.js.git/pull/11) | ||
> 3 November 2012 | ||
> 2 November 2012 | ||
@@ -540,0 +562,0 @@ - Minor changes [`#10`](https://github.com//avoidwork/filesize.js.git/pull/10) |
@@ -6,3 +6,3 @@ /** | ||
* @license BSD-3-Clause | ||
* @version 6.2.3 | ||
* @version 6.2.4 | ||
*/ | ||
@@ -145,11 +145,2 @@ (function (global, factory) { | ||
// Returning Array, Object, or String (default) | ||
if (output === "array") { | ||
return result; | ||
} | ||
if (output === "object") { | ||
return {value: result[0], symbol: result[1], exponent: e, unit: u}; | ||
} | ||
if (pad && Number.isInteger(result[0]) === false && round > 0) { | ||
@@ -165,2 +156,11 @@ const x = separator || ".", | ||
// Returning Array, Object, or String (default) | ||
if (output === "array") { | ||
return result; | ||
} | ||
if (output === "object") { | ||
return {value: result[0], symbol: result[1], exponent: e, unit: u}; | ||
} | ||
return result.join(spacer); | ||
@@ -167,0 +167,0 @@ } |
/*! | ||
2020 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
@version 6.2.3 | ||
@version 6.2.4 | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).filesize=t()}(this,(function(){"use strict";const e=/^(b|B)$/,t={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},i={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function o(o,n={}){let b,r,a,s,l,d,f,p,u,c,B,g,y,h,m,x,M,v,j,N=[],T=0;if(isNaN(o))throw new TypeError("Invalid number");if(a=!0===n.bits,m=!0===n.unix,g=!0===n.pad,r=n.base||2,y=void 0!==n.round?n.round:m?1:2,f=void 0!==n.locale?n.locale:"",p=n.localeOptions||{},x=void 0!==n.separator?n.separator:"",M=void 0!==n.spacer?n.spacer:m?"":" ",j=n.symbols||{},v=2===r&&n.standard||"jedec",B=n.output||"string",l=!0===n.fullform,d=n.fullforms instanceof Array?n.fullforms:[],b=void 0!==n.exponent?n.exponent:-1,c=Number(o),u=c<0,s=r>2?1e3:1024,u&&(c=-c),(-1===b||isNaN(b))&&(b=Math.floor(Math.log(c)/Math.log(s)),b<0&&(b=0)),b>8&&(b=8),"exponent"===B)return b;if(0===c?(N[0]=0,N[1]=m?"":t[v][a?"bits":"bytes"][b]):(T=c/(2===r?Math.pow(2,10*b):Math.pow(1e3,b)),a&&(T*=8,T>=s&&b<8&&(T/=s,b++)),N[0]=Number(T.toFixed(b>0?y:0)),N[0]===s&&b<8&&void 0===n.exponent&&(N[0]=1,b++),h=N[1]=10===r&&1===b?a?"kb":"kB":t[v][a?"bits":"bytes"][b],m&&(N[1]="jedec"===v?N[1].charAt(0):b>0?N[1].replace(/B$/,""):N[1],e.test(N[1])&&(N[0]=Math.floor(N[0]),N[1]=""))),u&&(N[0]=-N[0]),N[1]=j[N[1]]||N[1],!0===f?N[0]=N[0].toLocaleString():f.length>0?N[0]=N[0].toLocaleString(f,p):x.length>0&&(N[0]=N[0].toString().replace(".",x)),l&&(N[1]=d[b]?d[b]:i[v][b]+(a?"bit":"byte")+(1===N[0]?"":"s")),"array"===B)return N;if("object"===B)return{value:N[0],symbol:N[1],exponent:b,unit:h};if(g&&!1===Number.isInteger(N[0])&&y>0){const e=x||".",t=N[0].toString().split(e),i=t[1]||"",o=i.length,n=y-o;N[0]=`${t[0]}${e}${i.padEnd(o+n,"0")}`}return N.join(M)}return o.partial=e=>t=>o(t,e),o})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).filesize=t()}(this,(function(){"use strict";const e=/^(b|B)$/,t={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},i={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function o(o,n={}){let b,r,a,s,l,d,p,f,c,u,B,g,y,h,m,x,M,v,j,N=[],T=0;if(isNaN(o))throw new TypeError("Invalid number");if(a=!0===n.bits,m=!0===n.unix,g=!0===n.pad,r=n.base||2,y=void 0!==n.round?n.round:m?1:2,p=void 0!==n.locale?n.locale:"",f=n.localeOptions||{},x=void 0!==n.separator?n.separator:"",M=void 0!==n.spacer?n.spacer:m?"":" ",j=n.symbols||{},v=2===r&&n.standard||"jedec",B=n.output||"string",l=!0===n.fullform,d=n.fullforms instanceof Array?n.fullforms:[],b=void 0!==n.exponent?n.exponent:-1,u=Number(o),c=u<0,s=r>2?1e3:1024,c&&(u=-u),(-1===b||isNaN(b))&&(b=Math.floor(Math.log(u)/Math.log(s)),b<0&&(b=0)),b>8&&(b=8),"exponent"===B)return b;if(0===u?(N[0]=0,N[1]=m?"":t[v][a?"bits":"bytes"][b]):(T=u/(2===r?Math.pow(2,10*b):Math.pow(1e3,b)),a&&(T*=8,T>=s&&b<8&&(T/=s,b++)),N[0]=Number(T.toFixed(b>0?y:0)),N[0]===s&&b<8&&void 0===n.exponent&&(N[0]=1,b++),h=N[1]=10===r&&1===b?a?"kb":"kB":t[v][a?"bits":"bytes"][b],m&&(N[1]="jedec"===v?N[1].charAt(0):b>0?N[1].replace(/B$/,""):N[1],e.test(N[1])&&(N[0]=Math.floor(N[0]),N[1]=""))),c&&(N[0]=-N[0]),N[1]=j[N[1]]||N[1],!0===p?N[0]=N[0].toLocaleString():p.length>0?N[0]=N[0].toLocaleString(p,f):x.length>0&&(N[0]=N[0].toString().replace(".",x)),l&&(N[1]=d[b]?d[b]:i[v][b]+(a?"bit":"byte")+(1===N[0]?"":"s")),g&&!1===Number.isInteger(N[0])&&y>0){const e=x||".",t=N[0].toString().split(e),i=t[1]||"",o=i.length,n=y-o;N[0]=`${t[0]}${e}${i.padEnd(o+n,"0")}`}return"array"===B?N:"object"===B?{value:N[0],symbol:N[1],exponent:b,unit:h}:N.join(M)}return o.partial=e=>t=>o(t,e),o})); | ||
//# sourceMappingURL=filesize.es6.min.js.map |
@@ -6,3 +6,3 @@ /** | ||
* @license BSD-3-Clause | ||
* @version 6.2.3 | ||
* @version 6.2.4 | ||
*/ | ||
@@ -161,2 +161,11 @@ (function (global, factory) { | ||
result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s"); | ||
} | ||
if (pad && Number.isInteger(result[0]) === false && round > 0) { | ||
var x = separator || ".", | ||
tmp = result[0].toString().split(x), | ||
s = tmp[1] || "", | ||
l = s.length, | ||
n = round - l; | ||
result[0] = "".concat(tmp[0]).concat(x).concat(s.padEnd(l + n, "0")); | ||
} // Returning Array, Object, or String (default) | ||
@@ -178,11 +187,2 @@ | ||
if (pad && Number.isInteger(result[0]) === false && round > 0) { | ||
var x = separator || ".", | ||
tmp = result[0].toString().split(x), | ||
s = tmp[1] || "", | ||
l = s.length, | ||
n = round - l; | ||
result[0] = "".concat(tmp[0]).concat(x).concat(s.padEnd(l + n, "0")); | ||
} | ||
return result.join(spacer); | ||
@@ -189,0 +189,0 @@ } // Partial application for functional programming |
/*! | ||
2020 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
@version 6.2.3 | ||
@version 6.2.4 | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).filesize=t()}(this,(function(){"use strict";var e=/^(b|B)$/,t={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},i={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function o(o){var n,r,a,b,l,s,c,u,f,d,p,B,g,y,h,m,v,x,M,j=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},N=[],T=0;if(isNaN(o))throw new TypeError("Invalid number");if(a=!0===j.bits,h=!0===j.unix,B=!0===j.pad,r=j.base||2,g=void 0!==j.round?j.round:h?1:2,c=void 0!==j.locale?j.locale:"",u=j.localeOptions||{},m=void 0!==j.separator?j.separator:"",v=void 0!==j.spacer?j.spacer:h?"":" ",M=j.symbols||{},x=2===r&&j.standard||"jedec",p=j.output||"string",l=!0===j.fullform,s=j.fullforms instanceof Array?j.fullforms:[],n=void 0!==j.exponent?j.exponent:-1,b=r>2?1e3:1024,(f=(d=Number(o))<0)&&(d=-d),(-1===n||isNaN(n))&&(n=Math.floor(Math.log(d)/Math.log(b)))<0&&(n=0),n>8&&(n=8),"exponent"===p)return n;if(0===d?(N[0]=0,N[1]=h?"":t[x][a?"bits":"bytes"][n]):(T=d/(2===r?Math.pow(2,10*n):Math.pow(1e3,n)),a&&(T*=8)>=b&&n<8&&(T/=b,n++),N[0]=Number(T.toFixed(n>0?g:0)),N[0]===b&&n<8&&void 0===j.exponent&&(N[0]=1,n++),y=N[1]=10===r&&1===n?a?"kb":"kB":t[x][a?"bits":"bytes"][n],h&&(N[1]="jedec"===x?N[1].charAt(0):n>0?N[1].replace(/B$/,""):N[1],e.test(N[1])&&(N[0]=Math.floor(N[0]),N[1]=""))),f&&(N[0]=-N[0]),N[1]=M[N[1]]||N[1],!0===c?N[0]=N[0].toLocaleString():c.length>0?N[0]=N[0].toLocaleString(c,u):m.length>0&&(N[0]=N[0].toString().replace(".",m)),l&&(N[1]=s[n]?s[n]:i[x][n]+(a?"bit":"byte")+(1===N[0]?"":"s")),"array"===p)return N;if("object"===p)return{value:N[0],symbol:N[1],exponent:n,unit:y};if(B&&!1===Number.isInteger(N[0])&&g>0){var E=m||".",k=N[0].toString().split(E),w=k[1]||"",G=w.length,K=g-G;N[0]="".concat(k[0]).concat(E).concat(w.padEnd(G+K,"0"))}return N.join(v)}return o.partial=function(e){return function(t){return o(t,e)}},o})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).filesize=t()}(this,(function(){"use strict";var e=/^(b|B)$/,t={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},i={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function o(o){var n,r,a,b,l,s,c,d,u,f,p,B,g,y,h,m,v,x,M,j=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},N=[],T=0;if(isNaN(o))throw new TypeError("Invalid number");if(a=!0===j.bits,h=!0===j.unix,B=!0===j.pad,r=j.base||2,g=void 0!==j.round?j.round:h?1:2,c=void 0!==j.locale?j.locale:"",d=j.localeOptions||{},m=void 0!==j.separator?j.separator:"",v=void 0!==j.spacer?j.spacer:h?"":" ",M=j.symbols||{},x=2===r&&j.standard||"jedec",p=j.output||"string",l=!0===j.fullform,s=j.fullforms instanceof Array?j.fullforms:[],n=void 0!==j.exponent?j.exponent:-1,b=r>2?1e3:1024,(u=(f=Number(o))<0)&&(f=-f),(-1===n||isNaN(n))&&(n=Math.floor(Math.log(f)/Math.log(b)))<0&&(n=0),n>8&&(n=8),"exponent"===p)return n;if(0===f?(N[0]=0,N[1]=h?"":t[x][a?"bits":"bytes"][n]):(T=f/(2===r?Math.pow(2,10*n):Math.pow(1e3,n)),a&&(T*=8)>=b&&n<8&&(T/=b,n++),N[0]=Number(T.toFixed(n>0?g:0)),N[0]===b&&n<8&&void 0===j.exponent&&(N[0]=1,n++),y=N[1]=10===r&&1===n?a?"kb":"kB":t[x][a?"bits":"bytes"][n],h&&(N[1]="jedec"===x?N[1].charAt(0):n>0?N[1].replace(/B$/,""):N[1],e.test(N[1])&&(N[0]=Math.floor(N[0]),N[1]=""))),u&&(N[0]=-N[0]),N[1]=M[N[1]]||N[1],!0===c?N[0]=N[0].toLocaleString():c.length>0?N[0]=N[0].toLocaleString(c,d):m.length>0&&(N[0]=N[0].toString().replace(".",m)),l&&(N[1]=s[n]?s[n]:i[x][n]+(a?"bit":"byte")+(1===N[0]?"":"s")),B&&!1===Number.isInteger(N[0])&&g>0){var E=m||".",k=N[0].toString().split(E),w=k[1]||"",G=w.length,K=g-G;N[0]="".concat(k[0]).concat(E).concat(w.padEnd(G+K,"0"))}return"array"===p?N:"object"===p?{value:N[0],symbol:N[1],exponent:n,unit:y}:N.join(v)}return o.partial=function(e){return function(t){return o(t,e)}},o})); | ||
//# sourceMappingURL=filesize.min.js.map |
{ | ||
"name": "filesize", | ||
"description": "JavaScript library to generate a human readable String describing the file size", | ||
"version": "6.2.3", | ||
"version": "6.2.4", | ||
"homepage": "https://filesizejs.com", | ||
@@ -6,0 +6,0 @@ "author": "Jason Mulligan <jason.mulligan@avoidwork.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
77436