(
cache: FormatterCache = {
number: {},
dateTime: {},
pluralRules: {},
}
)
| 79 | } |
| 80 | |
| 81 | function createDefaultFormatters( |
| 82 | cache: FormatterCache = { |
| 83 | number: {}, |
| 84 | dateTime: {}, |
| 85 | pluralRules: {}, |
| 86 | } |
| 87 | ): Formatters { |
| 88 | return { |
| 89 | getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), { |
| 90 | cache: createFastMemoizeCache(cache.number), |
| 91 | strategy: strategies.variadic, |
| 92 | }), |
| 93 | getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), { |
| 94 | cache: createFastMemoizeCache(cache.dateTime), |
| 95 | strategy: strategies.variadic, |
| 96 | }), |
| 97 | getPluralRules: memoize((...args) => new Intl.PluralRules(...args), { |
| 98 | cache: createFastMemoizeCache(cache.pluralRules), |
| 99 | strategy: strategies.variadic, |
| 100 | }), |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | export class IntlMessageFormat { |
| 105 | private readonly ast: MessageFormatElement[] |
no test coverage detected