(rows: Record<string, unknown>[], field: string)
| 102 | } |
| 103 | |
| 104 | function assertFieldExists(rows: Record<string, unknown>[], field: string): void { |
| 105 | if (rows.length === 0) return |
| 106 | if (!Object.prototype.hasOwnProperty.call(rows[0], field)) { |
| 107 | throw new ChartValidationError(`Field "${field}" does not exist in SQL result`) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | function toLabel(value: unknown): string { |
| 112 | if (value === null || value === undefined || value === '') return '(empty)' |
no test coverage detected