(time: Duration)
| 101 | } |
| 102 | |
| 103 | export function getDuration(time: Duration): number { |
| 104 | let duration = 0; |
| 105 | if (time.seconds) { |
| 106 | duration += time.seconds * 1000; |
| 107 | } |
| 108 | if (time.minutes) { |
| 109 | duration += time.minutes * 60 * 1000; |
| 110 | } |
| 111 | if (time.hours) { |
| 112 | duration += time.hours * 60 * 60 * 1000; |
| 113 | } |
| 114 | if (time.days) { |
| 115 | duration += time.days * 24 * 60 * 60 * 1000; |
| 116 | } |
| 117 | return duration; |
| 118 | } |
| 119 | |
| 120 | export function getDurationInMinutes(time: Duration): number { |
| 121 | return getDuration(time) / 1000 / 60; |
no outgoing calls
no test coverage detected