UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 566 B
import{copy as e}from"../../../libs/i18n/copy.mjs";import t from"../../media/get-storage-usage.mjs";const n=async(n,r)=>{let i=n.config.media.limits.uploadBytes,a=n.config.media.limits.storageBytes;if(r.size>i)return{error:void 0,data:{proposedSize:0}};let o=await t(n,{tenantKey:r.tenantKey??null});if(o.error)return o;let s=o.data.total+r.size;return a!==!1&&s>a?{error:{type:`basic`,message:e(`server:core.processed.images.size.limit.exceeded`)},data:void 0}:{error:void 0,data:{proposedSize:s}}};export{n as default}; //# sourceMappingURL=check-can-store.mjs.map