Skip to content

parseColumnShorthand

Parse a column shorthand string into a ColumnConfig.

Supports formats:

  • 'fieldName'{ field: 'fieldName', header: 'Field Name' }
  • 'fieldName:type'{ field: 'fieldName', header: 'Field Name', type: 'type' }
parseColumnShorthand(shorthand: string): ColumnConfig<TRow>
NameTypeDescription
shorthandstringThe shorthand string (e.g., ‘name’, ‘salary:number’)

ColumnConfig<TRow> - A ColumnConfig object

parseColumnShorthand('name') → { field: 'name', header: 'Name' }
parseColumnShorthand('salary:number') → { field: 'salary', header: 'Salary', type: 'number' }
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