Skip to content

Commit 87db956

Browse files
clydinKeen Yee Liau
authored and
Keen Yee Liau
committed
refactor(@angular-devkit/build-optimizer): remove unused helper function
1 parent 74bc8e8 commit 87db956

File tree

1 file changed

+0
-21
lines changed
  • packages/angular_devkit/build_optimizer/src/helpers

1 file changed

+0
-21
lines changed

packages/angular_devkit/build_optimizer/src/helpers/ast-utils.ts

-21
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,3 @@ export function collectDeepNodes<T extends ts.Node>(node: ts.Node, kind: ts.Synt
2020

2121
return nodes;
2222
}
23-
24-
export function drilldownNodes<T extends ts.Node>(
25-
startingNode: T,
26-
path: { prop: keyof T, kind: ts.SyntaxKind }[],
27-
): T | null {
28-
let currentNode: T = startingNode;
29-
for (const segment of path) {
30-
if (segment.prop) {
31-
// ts.Node has no index signature, so we need to cast it as any.
32-
const tempNode = currentNode[segment.prop];
33-
if (!tempNode || typeof tempNode != 'object' || currentNode.kind !== segment.kind) {
34-
return null;
35-
}
36-
37-
// tslint:disable-next-line:no-any
38-
currentNode = tempNode as any as T;
39-
}
40-
}
41-
42-
return currentNode;
43-
}

0 commit comments

Comments
 (0)