MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / asFieldName

Function asFieldName

packages/core/src/chart/index.ts:97–102  ·  view source on GitHub ↗
(value: unknown, label: string)

Source from the content-addressed store, hash-verified

95}
96
97function 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
104function assertFieldExists(rows: Record<string, unknown>[], field: string): void {
105 if (rows.length === 0) return

Callers 1

normalizeChartSpecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected