(duration: string)
| 11 | */ |
| 12 | |
| 13 | export function parseDuration(duration: string): Temporal.Duration { |
| 14 | if (duration.startsWith('P')) { |
| 15 | return Temporal.Duration.from(duration) |
| 16 | } |
| 17 | |
| 18 | const milliseconds = parseInteger(duration) |
| 19 | return Temporal.Duration.from({ milliseconds }) |
| 20 | } |
no test coverage detected