Skip to content

Function: toLabel()

toLabel(value, options?): string

Title-case a snake / kebab / camel identifier into a human-readable label: tokenize (lowercased, capitalized), then join with spaces. Falls back to the raw value when it yields no tokens (e.g. punctuation-only input). bge_large_en -> "Bge Large En", promptId -> "Prompt Id".

The single source of truth for the “humanize a column / field name” idiom - reused by the chat data-grid headers and the export renderer. Extra TokenizeOptions (e.g. camelCase: false) merge over the defaults.

string

TokenizeOptions

string