(cron: string, tz?: DateTime.TimeZone | string)
| 563 | return Result.all({ |
| 564 | tz: zone, |
| 565 | seconds: parseSegment(seconds, secondOptions), |
| 566 | minutes: parseSegment(minutes, minuteOptions), |
| 567 | hours: parseSegment(hours, hourOptions), |
| 568 | days: parseSegment(days, dayOptions), |
| 569 | months: parseSegment(months, monthOptions), |
| 570 | weekdays: parseSegment(weekdays, weekdayOptions) |
| 571 | }).pipe(Result.map(({ tz, seconds, minutes, hours, days, months, weekdays }) => |
| 572 | make({ |
| 573 | tz, |
| 574 | seconds: seconds.values, |
| 575 | minutes: minutes.values, |
| 576 | hours: hours.values, |
| 577 | days: days.values, |
| 578 | months: months.values, |
| 579 | weekdays: weekdays.values, |
| 580 | and: (days.wildcard || weekdays.wildcard) && days.values.size !== 0 && weekdays.values.size !== 0 |
| 581 | }) |
| 582 | )) |
| 583 | } |
| 584 | |
| 585 | /** |
| 586 | * Parses a cron expression into a `Cron` instance, throwing on failure. |
| 587 | * |
| 588 | * **When to use** |
| 589 | * |
| 590 | * Use when you expect the input to be valid and want to avoid handling the |
| 591 | * `Result` type. |
| 592 | * |
| 593 | * **Example** (Parsing cron expressions unsafely) |
| 594 | * |
| 595 | * ```ts import.meta.vitest |
no test coverage detected
searching dependent graphs…