(cron: Cron, options?: {
readonly includeSeconds?: boolean | undefined
})
| 641 | * @since 4.0.0 |
| 642 | */ |
| 643 | export const format = (cron: Cron, options?: { |
| 644 | readonly includeSeconds?: boolean | undefined |
| 645 | }): string => { |
| 646 | const segments = [cron.seconds, cron.minutes, cron.hours, cron.days, cron.months, cron.weekdays] |
| 647 | .map(formatSegment) |
| 648 | return ( |
| 649 | options?.includeSeconds !== true && cron.seconds.size === 1 && cron.seconds.has(0) ? segments.slice(1) : segments |
| 650 | ).join(" ") |
| 651 | } |
| 652 | |
| 653 | const formatSegment = (values: ReadonlySet<number>): string => { |
| 654 | if (values.size === 0) { |
no test coverage detected