(value: unknown, label: string)
| 95 | } |
| 96 | |
| 97 | function asFieldName(value: unknown, label: string): string { |
| 98 | if (typeof value !== 'string' || value.trim().length === 0) { |
| 99 | throw new ChartValidationError(`${label} must be a non-empty field name`) |
| 100 | } |
| 101 | return value |
| 102 | } |
| 103 | |
| 104 | function assertFieldExists(rows: Record<string, unknown>[], field: string): void { |
| 105 | if (rows.length === 0) return |
no outgoing calls
no test coverage detected