* Parse a cron expression into its parts
(expr: string)
| 18 | * Parse a cron expression into its parts |
| 19 | */ |
| 20 | function parseCron(expr: string): CronParts | null { |
| 21 | const parts = expr.trim().split(/\s+/); |
| 22 | if (parts.length !== 5) return null; |
| 23 | |
| 24 | return { |
| 25 | minute: parts[0], |
| 26 | hour: parts[1], |
| 27 | dayOfMonth: parts[2], |
| 28 | month: parts[3], |
| 29 | dayOfWeek: parts[4], |
| 30 | }; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Convert a cron expression to human-readable text |
no outgoing calls
no test coverage detected