| 55 | // TOML 1.1 allows omitting seconds; `:00` is assumed |
| 56 | const withSeconds = (time: string): string => time.length === 5 ? `${time}:00` : time |
| 57 | const isValidTime = (time: string): boolean => { |
| 58 | const [, hour, minute, second] = localTimePattern.exec(time)!.map(Number) |
| 59 | return hour <= 23 && minute <= 59 && second <= 60 |
| 60 | } |
| 61 | const isValidOffset = (offset: string): boolean => { |
| 62 | const numeric = numericOffsetPattern.exec(offset) |
| 63 | return numeric === null || (Number(numeric[1]) <= 23 && Number(numeric[2]) <= 59) |