(value: number, actualDays: number, totalDays: number)
| 9 | |
| 10 | /** Proportionally scale a partial bucket to estimate the full-period value. */ |
| 11 | export function fillPartialBucket(value: number, actualDays: number, totalDays: number): number { |
| 12 | if (actualDays <= 0 || actualDays >= totalDays) return value |
| 13 | return Math.round((value * totalDays) / actualDays) |
| 14 | } |
| 15 | |
| 16 | function sortedDaily(daily: DailyRawPoint[]): DailyRawPoint[] { |
| 17 | return daily.slice().sort((a, b) => a.day.localeCompare(b.day)) |
no outgoing calls
no test coverage detected