API reference / @localizer/format-lookup / lookupFormatter
Function: lookupFormatter() preview
lookupFormatter<
T>(lut):ValueFormatter<T>
Defined in: lookupFormatter.ts:91
Creates a formatter that selects formatting logic based on the input value.
Special symbols (NoValue, UndefinedValue, NullValue, DefaultValue) handle cases like undefined, null, or fallback values.
Type Parameters
| Type Parameter | Description |
|---|---|
T | The type of values the formatter supports. |
Parameters
| Parameter | Type | Description |
|---|---|---|
lut | LookupTable<T> | Lookup table mapping values to localizable content or formatters. |
Returns
A function that formats the input value using the lookup table.
Throws
If the value is not in the lookup table and no default is specified.