* @param value the number to be formatted * @param pluralMap an object that mimics the ICU format, see * https://unicode-org.github.io/icu/userguide/format_parse/messages/. * @param locale a `string` defining the locale to use (uses the current LOCALE_ID by * default).
(
value: number | null | undefined,
pluralMap: {[count: string]: string},
locale?: string,
)
| 44 | * default). |
| 45 | */ |
| 46 | transform( |
| 47 | value: number | null | undefined, |
| 48 | pluralMap: {[count: string]: string}, |
| 49 | locale?: string, |
| 50 | ): string { |
| 51 | if (value == null) return ''; |
| 52 | |
| 53 | if (typeof pluralMap !== 'object' || pluralMap === null) { |
| 54 | throw invalidPipeArgumentError(I18nPluralPipe, pluralMap); |
| 55 | } |
| 56 | |
| 57 | const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale); |
| 58 | |
| 59 | return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString()); |
| 60 | } |
| 61 | } |
nothing calls this directly
no test coverage detected