API reference / @localizer/format-list / listFormatter
Function: listFormatter()
listFormatter<
T
>(options
):ValueFormatter
<T
>
Defined in: listFormatter.ts:36
Creates a list formatter based on the given options.
Supports two modes:
- Uses a localized delimiter if
delimiter
is provided. - Falls back to
Intl.ListFormat
for formatting otherwise.
Type Parameters
Type Parameter | Description |
---|---|
T extends Localizable [] | Array elements, must be Localizable. |
Parameters
Parameter | Type | Description |
---|---|---|
options | ListFormatOptions | Formatting options for the list. |
Returns
A ValueFormatter that formats a list of Localizable objects.