( changePct: number, threshold = 0.05, )
| 75 | * Determine direction based on change percentage |
| 76 | */ |
| 77 | export function computeDirection( |
| 78 | changePct: number, |
| 79 | threshold = 0.05, |
| 80 | ): 'up' | 'down' | 'flat' { |
| 81 | return changePct > threshold |
| 82 | ? 'up' |
| 83 | : changePct < -threshold |
| 84 | ? 'down' |
| 85 | : 'flat'; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Get end of day timestamp (23:59:59.999) for a given date. |
no outgoing calls
no test coverage detected