(settings = {})
| 1022 | } |
| 1023 | |
| 1024 | function getApplicationRetentionDays(settings = {}) { |
| 1025 | const pendingRaw = Number(settings.pendingApplicationRetentionDays); |
| 1026 | const reviewedRaw = Number(settings.reviewedApplicationRetentionDays); |
| 1027 | |
| 1028 | const pendingDays = Number.isFinite(pendingRaw) ? Math.min(Math.max(pendingRaw, 1), 3650) : 30; |
| 1029 | const reviewedDays = Number.isFinite(reviewedRaw) ? Math.min(Math.max(reviewedRaw, 1), 3650) : 14; |
| 1030 | |
| 1031 | return { pendingDays, reviewedDays }; |
| 1032 | } |
| 1033 | |
| 1034 | function isApplicationExpired(application, retentionDays, now = Date.now()) { |
| 1035 | if (!application || typeof application !== 'object') { |
no outgoing calls
no test coverage detected