Socket
Socket
Sign inDemoInstall

filesize

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filesize - npm Package Compare versions

Comparing version 9.0.6 to 9.0.7

2

lib/filesize.es6.js

@@ -6,3 +6,3 @@ /**

* @license BSD-3-Clause
* @version 9.0.5
* @version 9.0.7
*/

@@ -9,0 +9,0 @@ (function (global, factory) {

/*!
2022 Jason Mulligan <jason.mulligan@avoidwork.com>
@version 9.0.5
@version 9.0.7
*/
!function(i,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(i="undefined"!=typeof globalThis?globalThis:i||self).filesize=t()}(this,(function(){"use strict";const i={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function t(t,{bits:e=!1,pad:o=!1,base:n=-1,round:b=2,locale:r="",localeOptions:l={},separator:s="",spacer:a=" ",symbols:c={},standard:f="",output:u="string",fullform:d=!1,fullforms:p=[],exponent:g=-1,roundingMethod:y="round",precision:h=0}={}){let m=g,B=Number(t),M=[],T=0,j="";-1===n&&0===f.length?(n=10,f="iec"):-1===n&&f.length>0?n="iec"===(f="iec"===f?"iec":"jedec")?10:2:f=10===(n=2===n?2:10)?"iec":"jedec";const w=10===n?1e3:1024,x=!0===d,E=B<0,N=Math[y];if(isNaN(t))throw new TypeError("Invalid number");if("function"!=typeof N)throw new TypeError("Invalid rounding method");if(E&&(B=-B),(-1===m||isNaN(m))&&(m=Math.floor(Math.log(B)/Math.log(w)),m<0&&(m=0)),m>8&&(h>0&&(h+=8-m),m=8),"exponent"===u)return m;if(0===B)M[0]=0,j=M[1]=i.symbol[f][e?"bits":"bytes"][m];else{T=B/(2===n?Math.pow(2,10*m):Math.pow(1e3,m)),e&&(T*=8,T>=w&&m<8&&(T/=w,m++));const t=Math.pow(10,m>0?b:0);M[0]=N(T*t)/t,M[0]===w&&m<8&&-1===g&&(M[0]=1,m++),j=M[1]=i.symbol[f][e?"bits":"bytes"][m]}if(E&&(M[0]=-M[0]),h>0&&(M[0]=M[0].toPrecision(h)),M[1]=c[M[1]]||M[1],!0===r?M[0]=M[0].toLocaleString():r.length>0?M[0]=M[0].toLocaleString(r,l):s.length>0&&(M[0]=M[0].toString().replace(".",s)),o&&!1===Number.isInteger(M[0])&&b>0){const i=s||".",t=M[0].toString().split(i),e=t[1]||"",o=e.length,n=b-o;M[0]=`${t[0]}${i}${e.padEnd(o+n,"0")}`}return x&&(M[1]=p[m]?p[m]:i.fullform[f][m]+(e?"bit":"byte")+(1===M[0]?"":"s")),"array"===u?M:"object"===u?{value:M[0],symbol:M[1],exponent:m,unit:j}:M.join(a)}return t.partial=i=>e=>t(e,i),t}));
//# sourceMappingURL=filesize.es6.min.js.map

@@ -6,3 +6,3 @@ /**

* @license BSD-3-Clause
* @version 9.0.5
* @version 9.0.7
*/

@@ -9,0 +9,0 @@ const strings = {

/*!
2022 Jason Mulligan <jason.mulligan@avoidwork.com>
@version 9.0.5
@version 9.0.7
*/
const i={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function t(t,{bits:e=!1,pad:o=!1,base:b=-1,round:n=2,locale:r="",localeOptions:a={},separator:l="",spacer:s=" ",symbols:c={},standard:p="",output:u="string",fullform:g=!1,fullforms:d=[],exponent:f=-1,roundingMethod:B="round",precision:h=0}={}){let y=f,m=Number(t),M=[],w=0,E="";-1===b&&0===p.length?(b=10,p="iec"):-1===b&&p.length>0?b="iec"===(p="iec"===p?"iec":"jedec")?10:2:p=10===(b=2===b?2:10)?"iec":"jedec";const j=10===b?1e3:1024,x=!0===g,N=m<0,T=Math[B];if(isNaN(t))throw new TypeError("Invalid number");if("function"!=typeof T)throw new TypeError("Invalid rounding method");if(N&&(m=-m),(-1===y||isNaN(y))&&(y=Math.floor(Math.log(m)/Math.log(j)),y<0&&(y=0)),y>8&&(h>0&&(h+=8-y),y=8),"exponent"===u)return y;if(0===m)M[0]=0,E=M[1]=i.symbol[p][e?"bits":"bytes"][y];else{w=m/(2===b?Math.pow(2,10*y):Math.pow(1e3,y)),e&&(w*=8,w>=j&&y<8&&(w/=j,y++));const t=Math.pow(10,y>0?n:0);M[0]=T(w*t)/t,M[0]===j&&y<8&&-1===f&&(M[0]=1,y++),E=M[1]=i.symbol[p][e?"bits":"bytes"][y]}if(N&&(M[0]=-M[0]),h>0&&(M[0]=M[0].toPrecision(h)),M[1]=c[M[1]]||M[1],!0===r?M[0]=M[0].toLocaleString():r.length>0?M[0]=M[0].toLocaleString(r,a):l.length>0&&(M[0]=M[0].toString().replace(".",l)),o&&!1===Number.isInteger(M[0])&&n>0){const i=l||".",t=M[0].toString().split(i),e=t[1]||"",o=e.length,b=n-o;M[0]=`${t[0]}${i}${e.padEnd(o+b,"0")}`}return x&&(M[1]=d[y]?d[y]:i.fullform[p][y]+(e?"bit":"byte")+(1===M[0]?"":"s")),"array"===u?M:"object"===u?{value:M[0],symbol:M[1],exponent:y,unit:E}:M.join(s)}t.partial=i=>e=>t(e,i);export{t as default};
//# sourceMappingURL=filesize.esm.min.js.map

@@ -6,3 +6,3 @@ /**

* @license BSD-3-Clause
* @version 9.0.5
* @version 9.0.7
*/

@@ -9,0 +9,0 @@ (function (global, factory) {

/*!
2022 Jason Mulligan <jason.mulligan@avoidwork.com>
@version 9.0.5
@version 9.0.7
*/
!function(i,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(i="undefined"!=typeof globalThis?globalThis:i||self).filesize=t()}(this,(function(){"use strict";var i={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function t(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e.bits,n=void 0!==o&&o,r=e.pad,b=void 0!==r&&r,a=e.base,d=void 0===a?-1:a,l=e.round,s=void 0===l?2:l,c=e.locale,f=void 0===c?"":c,u=e.localeOptions,p=void 0===u?{}:u,v=e.separator,g=void 0===v?"":v,h=e.spacer,y=void 0===h?" ":h,m=e.symbols,B=void 0===m?{}:m,M=e.standard,T=void 0===M?"":M,j=e.output,w=void 0===j?"string":j,x=e.fullform,E=void 0!==x&&x,N=e.fullforms,P=void 0===N?[]:N,G=e.exponent,K=void 0===G?-1:G,S=e.roundingMethod,Y=void 0===S?"round":S,Z=e.precision,z=void 0===Z?0:Z,I=K,k=Number(t),L=[],O=0,q="";-1===d&&0===T.length?(d=10,T="iec"):-1===d&&T.length>0?d="iec"===(T="iec"===T?"iec":"jedec")?10:2:T=10===(d=2===d?2:10)?"iec":"jedec";var A=10===d?1e3:1024,C=!0===E,D=k<0,F=Math[Y];if(isNaN(t))throw new TypeError("Invalid number");if("function"!=typeof F)throw new TypeError("Invalid rounding method");if(D&&(k=-k),(-1===I||isNaN(I))&&(I=Math.floor(Math.log(k)/Math.log(A)))<0&&(I=0),I>8&&(z>0&&(z+=8-I),I=8),"exponent"===w)return I;if(0===k)L[0]=0,q=L[1]=i.symbol[T][n?"bits":"bytes"][I];else{O=k/(2===d?Math.pow(2,10*I):Math.pow(1e3,I)),n&&(O*=8)>=A&&I<8&&(O/=A,I++);var H=Math.pow(10,I>0?s:0);L[0]=F(O*H)/H,L[0]===A&&I<8&&-1===K&&(L[0]=1,I++),q=L[1]=i.symbol[T][n?"bits":"bytes"][I]}if(D&&(L[0]=-L[0]),z>0&&(L[0]=L[0].toPrecision(z)),L[1]=B[L[1]]||L[1],!0===f?L[0]=L[0].toLocaleString():f.length>0?L[0]=L[0].toLocaleString(f,p):g.length>0&&(L[0]=L[0].toString().replace(".",g)),b&&!1===Number.isInteger(L[0])&&s>0){var J=g||".",Q=L[0].toString().split(J),R=Q[1]||"",U=R.length,V=s-U;L[0]="".concat(Q[0]).concat(J).concat(R.padEnd(U+V,"0"))}return C&&(L[1]=P[I]?P[I]:i.fullform[T][I]+(n?"bit":"byte")+(1===L[0]?"":"s")),"array"===w?L:"object"===w?{value:L[0],symbol:L[1],exponent:I,unit:q}:L.join(y)}return t.partial=function(i){return function(e){return t(e,i)}},t}));
//# sourceMappingURL=filesize.min.js.map
{
"name": "filesize",
"description": "JavaScript library to generate a human readable String describing the file size",
"version": "9.0.6",
"version": "9.0.7",
"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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc