( processableData: Record<string, any>, )
| 13 | * Matches how the server-side estimate counts characters. |
| 14 | */ |
| 15 | export function countTranslatableChars( |
| 16 | processableData: Record<string, any>, |
| 17 | ): number { |
| 18 | return Object.values(processableData).reduce( |
| 19 | (sum, value) => (typeof value === "string" ? sum + value.length : sum), |
| 20 | 0, |
| 21 | ); |
| 22 | } |
| 23 | |
| 24 | const formatUsd = (value: number) => |
| 25 | value < 0.01 && value > 0 ? "<$0.01" : `$${value.toFixed(2)}`; |
no outgoing calls
no test coverage detected