refactor(ivy): re-use the ForeignFunctionResolver interface when appropriate (#27697)

This makes the types (and intentions) more explicit and clear.

PR Close #27697
This commit is contained in:
George Kalpakas
2018-12-22 13:40:13 +02:00
committed by Alex Rickabaugh
parent 19a2b783cf
commit 2fc5f002e0
3 changed files with 9 additions and 9 deletions

View File

@ -188,11 +188,12 @@ export class NgModuleDecoratorHandler implements DecoratorHandler<NgModuleAnalys
}
/**
* Given a `FunctionDeclaration` or `MethodDeclaration`, check if it is typed as a
* `ModuleWithProviders` and return an expression referencing the module if available.
* Given a `FunctionDeclaration`, `MethodDeclaration` or `FunctionExpression`, check if it is
* typed as a `ModuleWithProviders` and return an expression referencing the module if available.
*/
private _extractModuleFromModuleWithProvidersFn(node: ts.FunctionDeclaration|
ts.MethodDeclaration): ts.Expression|null {
ts.MethodDeclaration|
ts.FunctionExpression): ts.Expression|null {
const type = node.type || null;
return type &&
(this._reflectModuleFromTypeParam(type) || this._reflectModuleFromLiteralType(type));