UNPKG

@qundus/qform

Version:

The only form library you'll ever need :)

1 lines 746 B
import{__export as e}from"../chunk-3465SI5N.mjs";var t={};e(t,{Ranges:()=>i,bytesInfo:()=>a,isFileSizeLessThan:()=>n});var r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=(e=>(e.byte="Bytes",e.kilo="KB",e.meg="MB",e.gig="GB",e.tera="TB",e.peta="PB",e.exa="EB",e.zetta="ZB",e.yotta="YB",e))(i||{});function a(e,t=2){if(!+e)return{size:0,range:"Bytes",range_idx:0,format:"0 Bytes"};const i=t<0?0:t,a=Math.floor(Math.log(e)/Math.log(1024)),n=Number.parseFloat((e/1024**a).toFixed(i)),B=r[a];return{size:n,range:B,range_idx:a,format:`${n} ${B}`}}function n(e,t,i,n=2){if(!e)return;const{size:B,range_idx:s}=a(e.size,n),o=r.indexOf(i);if(s===o){if(B<=t)return!0}else if(s<o)return!0;return!1}export{t as vFile};//# sourceMappingURL=index.mjs.map