UNPKG

@lucidcms/core

Version:

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

2 lines 617 B
import{multiTenancyEnabled as e}from"../../utils/helpers/tenants.mjs";import t from"./get-storage-usage.mjs";import{getMediaStorageOptionName as n}from"./helpers/storage-usage-options.mjs";import r from"../options/adjust-int.mjs";const i=async(i,a)=>{let o=a.max!==void 0&&e(i.config)?a.max:void 0;if(a.max!==void 0&&a.delta>0&&!e(i.config)){let e=await t(i,{includeAllBuckets:!0});if(e.error)return e;if(e.data.total+a.delta>a.max)return{error:void 0,data:{applied:!1}}}return r(i,{name:n(a.tenantKey),delta:a.delta,max:o,min:a.min,ensure:!0})};export{i as default}; //# sourceMappingURL=adjust-storage-usage.mjs.map