fix(common): correct and simplify typing of I18nPluralPipe (#37447)

I18nPluralPipe can actually accept `null` and `undefined` (which are
convenient for composing it with the async pipe), but it is currently
typed to only accept `number`.

PR Close #37447
This commit is contained in:
Andrea Canciani
2020-03-27 11:44:00 +01:00
committed by Alex Rickabaugh
parent 7b2aac97df
commit 3b919ef10f
4 changed files with 11 additions and 5 deletions

View File

@ -110,7 +110,7 @@ export declare class HashLocationStrategy extends LocationStrategy {
export declare class I18nPluralPipe implements PipeTransform {
constructor(_localization: NgLocalization);
transform(value: number, pluralMap: {
transform(value: number | null | undefined, pluralMap: {
[count: string]: string;
}, locale?: string): string;
}