Skip to content

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 ParameterDescription
T extends Localizable[]Array elements, must be Localizable.

Parameters ​

ParameterTypeDescription
optionsListFormatOptionsFormatting options for the list.

Returns ​

ValueFormatter<T>

A ValueFormatter that formats a list of Localizable objects.