Skip to content

normalizeColumns

Normalize an array of column shorthands to ColumnConfig objects.

normalizeColumns(columns: ColumnShorthand<TRow>[]): ColumnConfig<TRow>[]
NameTypeDescription
columnsColumnShorthand<TRow>[]Array of column shorthands (strings or ColumnConfig objects)

ColumnConfig<TRow>[] - Array of ColumnConfig objects

normalizeColumns(['id:number', 'name', { field: 'email', width: 200 }])
// Returns:
// [
// { field: 'id', header: 'ID', type: 'number' },
// { field: 'name', header: 'Name' },
// { field: 'email', width: 200 }
// ]
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt