Skip to content

Commit a8a60a7

Browse files
clydinhansl
authored andcommitted
refactor(@angular-devkit/build-optimizer): minor type cleanup
1 parent 95f29fb commit a8a60a7

File tree

1 file changed

+5
-8
lines changed
  • packages/angular_devkit/build_optimizer/src/transforms

1 file changed

+5
-8
lines changed

packages/angular_devkit/build_optimizer/src/transforms/wrap-enums.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ function isBlockLike(node: ts.Node): node is ts.BlockLike {
1717

1818
export function getWrapEnumsTransformer(): ts.TransformerFactory<ts.SourceFile> {
1919
return (context: ts.TransformationContext): ts.Transformer<ts.SourceFile> => {
20-
const transformer: ts.Transformer<ts.SourceFile> = (sf: ts.SourceFile) => {
21-
20+
const transformer: ts.Transformer<ts.SourceFile> = sf => {
2221
const result = visitBlockStatements(sf.statements, context);
2322

2423
return ts.updateSourceFileNode(sf, ts.setTextRange(result, sf.statements));
@@ -45,15 +44,13 @@ function visitBlockStatements(
4544
result = ts.setTextRange(result, node.statements);
4645
switch (node.kind) {
4746
case ts.SyntaxKind.Block:
48-
return ts.updateBlock(node as ts.Block, result);
47+
return ts.updateBlock(node, result);
4948
case ts.SyntaxKind.ModuleBlock:
50-
return ts.updateModuleBlock(node as ts.ModuleBlock, result);
49+
return ts.updateModuleBlock(node, result);
5150
case ts.SyntaxKind.CaseClause:
52-
const clause = node as ts.CaseClause;
53-
54-
return ts.updateCaseClause(clause, clause.expression, result);
51+
return ts.updateCaseClause(node, node.expression, result);
5552
case ts.SyntaxKind.DefaultClause:
56-
return ts.updateDefaultClause(node as ts.DefaultClause, result);
53+
return ts.updateDefaultClause(node, result);
5754
default:
5855
return node;
5956
}

0 commit comments

Comments
 (0)