( rawDuration: number | null, fallbackDuration: number | null, maxDuration: number, )
| 103 | } |
| 104 | |
| 105 | function normalizeDurationSeconds( |
| 106 | rawDuration: number | null, |
| 107 | fallbackDuration: number | null, |
| 108 | maxDuration: number, |
| 109 | ): number { |
| 110 | const safeFallback = fallbackDuration != null && fallbackDuration > 0 ? fallbackDuration : 0; |
| 111 | const safeRaw = |
| 112 | rawDuration != null && Number.isFinite(rawDuration) && rawDuration > 0 ? rawDuration : 0; |
| 113 | if (safeRaw > 0) return Math.min(safeRaw, maxDuration); |
| 114 | if (safeFallback > 0) return Math.min(safeFallback, maxDuration); |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | function shouldIncludeTimelineNode(tag: ParsedTag, rootCompositionId: string | null): boolean { |
| 119 | const attrs = tag.attrs; |
no outgoing calls
no test coverage detected