let t=[{str:"B",val:1024}];["KB","MB","GB","TB","PB","EB","ZB","YB"].forEach((r,e)=>{t.push({str:r,val:1024*t[e].val})});const r=t=>"number"==typeof t,e=(e,a=2)=>{if(r(a)&&isFinite(a)&&a%1==0&&a>=0&&r(e)&&isFinite(e)){for(var n=0;n<t.length-1&&e>=t[n].val;)n++;return e/=n>0?t[n-1].val:1,s=a,Math.round(e*Math.pow(10,s))/Math.pow(10,s)+" "+t[n].str}var s;return"NaN"},a=t=>{let r;try{r=JSON.parse(t)}catch(t){return!1}return"object"==typeof r&&null!==r},n=()=>{let t,r,e=new Promise((e,a)=>{t=e,r=a});return e.resolve=t,e.reject=r,e};export{e as b,n as d,a as s}