UNPKG

@lucidcms/core

Version:

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

2 lines 724 B
import e from"../../../constants/constants.mjs";import{parseEmailStorageRules as t}from"./config.mjs";const n=e=>{let n=t(e);return n.error?n:{error:void 0,data:n.data.some(({rule:e})=>e.neverStore===!0)}},r=t=>{let r=n(t.storage);if(r.error)return r;let i=t.createdAt instanceof Date?t.createdAt:t.createdAt?new Date(t.createdAt):null,a=i!==null&&!Number.isNaN(i.getTime()),o=Math.max(0,t.resendWindowDays)*e.email.storage.millisecondsInDay,s=t.now??new Date,c=a&&s.getTime()-i.getTime()<=o;return{error:void 0,data:{enabled:c&&!r.data,...c&&r.data?{reason:`unstoredData`}:{},...c?{}:{reason:`outsideResendWindow`}}}};export{r as getEmailResendState,n as hasNeverStoreEmailStorageRules}; //# sourceMappingURL=resend.mjs.map