feat(common): stricter types for DatePipe (#37447)
Make typing of DatePipe stricter to catch some misuses (such as passing an Observable or an array) at compile time. BREAKING CHANGE: The signature of the `date` pipe now explicitly states which types are accepted. This should only cause issues in corner cases, as any other values would result in runtime exceptions. PR Close #37447
This commit is contained in:

committed by
Alex Rickabaugh

parent
5f815c0565
commit
daf8b7f100
@ -211,7 +211,7 @@ describe('hover', () => {
|
||||
expect(textSpan).toEqual(marker);
|
||||
expect(toText(displayParts))
|
||||
.toBe(
|
||||
'(pipe) date: (value: any, format?: string | undefined, timezone?: string | undefined, locale?: string | undefined) => string | null');
|
||||
'(pipe) date: { (value: string | number | Date, format?: string | undefined, timezone?: string | undefined, locale?: string | undefined): string | null; (value: null | undefined, format?: string | undefined, timezone?: string | undefined, locale?: string | undefined): null; (value: string | ... 3 more ... | undefined, format?: st...');
|
||||
});
|
||||
|
||||
it('should work for the $any() cast function', () => {
|
||||
|
Reference in New Issue
Block a user