refactor(ngcc): move stripParentheses to Esm5ReflectionHost for re-use (#33777)

PR Close #33777
This commit is contained in:
Pete Bacon Darwin
2019-11-13 08:33:22 +00:00
committed by Kara Erickson
parent 9f10aa0d8c
commit 1b489083bc
2 changed files with 5 additions and 7 deletions

View File

@ -12,7 +12,7 @@ import {absoluteFrom} from '../../../src/ngtsc/file_system';
import {Declaration, Import} from '../../../src/ngtsc/reflection';
import {Logger} from '../logging/logger';
import {BundleProgram} from '../packages/bundle_program';
import {Esm5ReflectionHost} from './esm5_host';
import {Esm5ReflectionHost, stripParentheses} from './esm5_host';
export class UmdReflectionHost extends Esm5ReflectionHost {
protected umdModules = new Map<ts.SourceFile, UmdModule|null>();
@ -279,7 +279,3 @@ function findNamespaceOfIdentifier(id: ts.Identifier): ts.Identifier|null {
id.parent.expression :
null;
}
export function stripParentheses(node: ts.Node): ts.Node {
return ts.isParenthesizedExpression(node) ? node.expression : node;
}