(day: number)
| 545 | |
| 546 | /** @internal */ |
| 547 | export const dayOfWeek = (day: number): Schedule.Schedule<number> => { |
| 548 | return makeWithState<[number, number], unknown, number>( |
| 549 | [Number.MIN_SAFE_INTEGER, 0], |
| 550 | (now, _, state) => { |
| 551 | if (!Number.isInteger(day) || day < 1 || 7 < day) { |
| 552 | return core.dieSync(() => |
| 553 | new core.IllegalArgumentException( |
| 554 | `Invalid argument in: dayOfWeek(${day}). Must be in range 1 (Monday)...7 (Sunday)` |
| 555 | ) |
| 556 | ) |
| 557 | } |
| 558 | const n = state[1] |
| 559 | const initial = n === 0 |
| 560 | const day0 = nextDay(now, day, initial) |
| 561 | const start = beginningOfDay(day0) |
| 562 | const end = endOfDay(day0) |
| 563 | const interval = Interval.make(start, end) |
| 564 | return core.succeed( |
| 565 | [ |
| 566 | [end, n + 1], |
| 567 | n, |
| 568 | ScheduleDecision.continueWith(interval) |
| 569 | ] |
| 570 | ) |
| 571 | } |
| 572 | ) |
| 573 | } |
| 574 | |
| 575 | /** @internal */ |
| 576 | export const delayed = dual< |
nothing calls this directly
no test coverage detected
searching dependent graphs…