MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / assertFieldExists

Function assertFieldExists

packages/core/src/chart/index.ts:104–109  ·  view source on GitHub ↗
(rows: Record<string, unknown>[], field: string)

Source from the content-addressed store, hash-verified

102}
103
104function 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
111function toLabel(value: unknown): string {
112 if (value === null || value === undefined || value === '') return '(empty)'

Callers 2

buildLineDataFunction · 0.85
buildChartPayloadFunction · 0.85

Calls 1

callMethod · 0.80

Tested by

no test coverage detected