(second: number)
| 1368 | |
| 1369 | /** @internal */ |
| 1370 | export const secondOfMinute = (second: number): Schedule.Schedule<number> => |
| 1371 | makeWithState<[number, number], unknown, number>( |
| 1372 | [Number.NEGATIVE_INFINITY, 0], |
| 1373 | (now, _, state) => { |
| 1374 | if (!Number.isInteger(second) || second < 0 || 59 < second) { |
| 1375 | return core.dieSync(() => |
| 1376 | new core.IllegalArgumentException( |
| 1377 | `Invalid argument in: secondOfMinute(${second}). Must be in range 0...59` |
| 1378 | ) |
| 1379 | ) |
| 1380 | } |
| 1381 | const n = state[1] |
| 1382 | const initial = n === 0 |
| 1383 | const second0 = nextSecond(now, second, initial) |
| 1384 | const start = beginningOfSecond(second0) |
| 1385 | const end = endOfSecond(second0) |
| 1386 | const interval = Interval.make(start, end) |
| 1387 | return core.succeed( |
| 1388 | [ |
| 1389 | [end, n + 1], |
| 1390 | n, |
| 1391 | ScheduleDecision.continueWith(interval) |
| 1392 | ] |
| 1393 | ) |
| 1394 | } |
| 1395 | ) |
| 1396 | |
| 1397 | /** @internal */ |
| 1398 | export const spaced = (duration: Duration.DurationInput): Schedule.Schedule<number> => addDelay(forever, () => duration) |
nothing calls this directly
no test coverage detected