(html: string, fallback: number)
| 26 | * fall back to the computed timeline end. |
| 27 | */ |
| 28 | export function durationFromHtml(html: string, fallback: number): number { |
| 29 | const match = |
| 30 | html.match(/data-composition-id[^>]*data-duration=["']([\d.]+)["']/) || |
| 31 | html.match(/data-duration=["']([\d.]+)["'][^>]*data-composition-id/); |
| 32 | const value = match?.[1] ? parseFloat(match[1]) : NaN; |
| 33 | return Number.isFinite(value) ? value : fallback; |
| 34 | } |
| 35 | |
| 36 | function totalSize(dir: string): number { |
| 37 | let total = 0; |
no outgoing calls
no test coverage detected