Skip to main content

Function: inferLabel()

inferLabel(key): string

Defined in: packages/core/src/utils.ts:13

Convert a camelCase or snake_case key to a human-readable Title Case label. Strips dot-path prefixes (e.g. "address.street" → "Street") before conversion.

Parameters​

key​

string

A field key in camelCase, snake_case, or dot-notation path.

Returns​

string

A space-separated Title Case string suitable for use as a form label.

Examples​

inferLabel('firstName') → 'First Name'
inferLabel('email_address') → 'Email Address'