(input?: DurationInput, key?: string, config: DateParsingConfig = {})
| 22 | export type DurationInput = string | number | Duration | Partial<DateObject> | { from: Date; to: Date }; |
| 23 | |
| 24 | export function createDuration(input?: DurationInput, key?: string, config: DateParsingConfig = {}) { |
| 25 | const duration = convertDuration(input, key); |
| 26 | // matching against regexp is expensive, do it on demand |
| 27 | |
| 28 | return new Duration(duration, config); |
| 29 | } |
| 30 | |
| 31 | function convertDuration(input: any, key: string): Partial<DateObject> { |
| 32 | // checks for null or undefined |
no test coverage detected