-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(multiple): eliminate usages of any type batch #4 #32394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
93361d4 to
ee47476
Compare
|
@andrewseguin PTAL |
|
@andrewseguin apparently narrowing the |
| /** Updates the tooltip class */ | ||
| private _setTooltipClass(tooltipClass: string | string[] | Set<string> | {[key: string]: any}) { | ||
| private _setTooltipClass( | ||
| tooltipClass: string | string[] | Set<string> | {[key: string]: unknown}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the intent is to have the final type be similar to Angular's class binding where there's a map of strings to booleans. Let's use boolean instead of unknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean would not be the most accurate, as the type in the docs is Record<string, any>.
IIUC the meaning of any is that we allow for actually any type, because we'll covert it to boolean.
Nonetheless I believe unknown is a safer choice here, as it would still allow for the flexibility of passing actually anything, with the difference that our code cannot use this value with other contexts (different than unknown or any) without an explicit cast.
122137a to
b50f12c
Compare
Most important:
MatTableDataSource: RequireTto extend fromobject, so the filtering works correctly.Other changes should be harmless.