refactor(core): Check for ngMetadataName instead of instanceof. Wiz doesn't extend InjectionToken. (#60572)

In cases such as Wiz, we avoid using the InjectionToken class since it comes from @angular/core.

PR Close #60572
This commit is contained in:
iteriani
2025-03-26 14:40:42 -07:00
committed by Jessica Janiuk
parent b55f4de6e6
commit e9c5e46a60
+2 -1
View File
@@ -681,7 +681,8 @@ function hasOnDestroy(value: any): value is OnDestroy {
function couldBeInjectableType(value: any): value is ProviderToken<any> {
return (
typeof value === 'function' || (typeof value === 'object' && value instanceof InjectionToken)
typeof value === 'function' ||
(typeof value === 'object' && value.ngMetadataName === 'InjectionToken')
);
}