The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflects the behaviour on `null` and `undefined`. Fixes #36259 BREAKING CHANGE: The case conversion pipes no longer let falsy values through. They now map both `null` and `undefined` to `null` and raise an exception on invalid input (`0`, `false`, `NaN`) just like most "common pipes". If your code required falsy values to pass through, you need to handle them explicitly. PR Close #37447
This commit is contained in:

committed by
Alex Rickabaugh

parent
323be39297
commit
c7d5555dfb
6
goldens/public-api/common/common.d.ts
vendored
6
goldens/public-api/common/common.d.ts
vendored
@ -194,6 +194,8 @@ export declare abstract class LocationStrategy {
|
||||
|
||||
export declare class LowerCasePipe implements PipeTransform {
|
||||
transform(value: string): string;
|
||||
transform(value: null | undefined): null;
|
||||
transform(value: string | null | undefined): string | null;
|
||||
}
|
||||
|
||||
export declare class NgClass implements DoCheck {
|
||||
@ -392,6 +394,8 @@ export declare type Time = {
|
||||
|
||||
export declare class TitleCasePipe implements PipeTransform {
|
||||
transform(value: string): string;
|
||||
transform(value: null | undefined): null;
|
||||
transform(value: string | null | undefined): string | null;
|
||||
}
|
||||
|
||||
export declare enum TranslationWidth {
|
||||
@ -403,6 +407,8 @@ export declare enum TranslationWidth {
|
||||
|
||||
export declare class UpperCasePipe implements PipeTransform {
|
||||
transform(value: string): string;
|
||||
transform(value: null | undefined): null;
|
||||
transform(value: string | null | undefined): string | null;
|
||||
}
|
||||
|
||||
export declare const VERSION: Version;
|
||||
|
Reference in New Issue
Block a user