( tokenOrFunction: Function | ProviderToken<T>, injector: Injector, )
| 64 | } |
| 65 | |
| 66 | export function getTokenOrFunctionIdentity<T>( |
| 67 | tokenOrFunction: Function | ProviderToken<T>, |
| 68 | injector: Injector, |
| 69 | ): Function | T { |
| 70 | const NOT_FOUND = Symbol(); |
| 71 | const result = injector.get<T | Symbol>(tokenOrFunction, NOT_FOUND); |
| 72 | if (result === NOT_FOUND) { |
| 73 | if (typeof tokenOrFunction === 'function' && !isInjectable(tokenOrFunction)) { |
| 74 | // We think the token is just a function so return it as-is |
| 75 | return tokenOrFunction; |
| 76 | } else { |
| 77 | // This will throw the not found error |
| 78 | return injector.get<T>(tokenOrFunction); |
| 79 | } |
| 80 | } |
| 81 | return result as T; |
| 82 | } |
| 83 | |
| 84 | function getChildRouteGuards( |
| 85 | futureNode: TreeNode<ActivatedRouteSnapshot>, |
no test coverage detected
searching dependent graphs…