MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / parseCron

Function parseCron

src/lib/cron-parser.ts:20–31  ·  view source on GitHub ↗

* Parse a cron expression into its parts

(expr: string)

Source from the content-addressed store, hash-verified

18 * Parse a cron expression into its parts
19 */
20function 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

Callers 3

cronToHumanFunction · 0.85
getNextRunsFunction · 0.85
isValidCronFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected