(plan)
| 497 | } |
| 498 | |
| 499 | function getAutoRunTimerStatusPayload(plan) { |
| 500 | const normalizedPlan = normalizeAutoRunTimerPlan(plan); |
| 501 | if (!normalizedPlan) { |
| 502 | return null; |
| 503 | } |
| 504 | |
| 505 | const phase = getAutoRunTimerPlanPhase(normalizedPlan.kind); |
| 506 | return { |
| 507 | phase, |
| 508 | currentRun: normalizedPlan.currentRun, |
| 509 | totalRuns: normalizedPlan.totalRuns, |
| 510 | attemptRun: normalizedPlan.attemptRun, |
| 511 | scheduledAt: phase === 'scheduled' ? normalizedPlan.fireAt : null, |
| 512 | countdownAt: normalizedPlan.fireAt, |
| 513 | countdownTitle: normalizedPlan.countdownTitle, |
| 514 | countdownNote: normalizedPlan.countdownNote, |
| 515 | }; |
| 516 | } |
| 517 | |
| 518 | function normalizeEmailGenerator(value = '') { |
| 519 | const normalized = String(value || '').trim().toLowerCase(); |
no test coverage detected