MCPcopy Create free account
hub / github.com/angular/dev-infra / visitNode

Function visitNode

ng-dev/ts-circular-dependencies/parser.ts:21–37  ·  view source on GitHub ↗
(node: ts.Node)

Source from the content-addressed store, hash-verified

19): string[] {
20 const references: string[] = [];
21 const visitNode = (node: ts.Node) => {
22 if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
23 // When ignoreTypeOnlyChecks are enabled, if the declaration is found to be type only, it is skipped.
24 if (
25 ignoreTypeOnlyChecks &&
26 ((ts.isImportDeclaration(node) && node.importClause?.isTypeOnly) ||
27 (ts.isExportDeclaration(node) && node.isTypeOnly))
28 ) {
29 return;
30 }
31
32 if (node.moduleSpecifier !== undefined && ts.isStringLiteral(node.moduleSpecifier)) {
33 references.push(node.moduleSpecifier.text);
34 }
35 }
36 ts.forEachChild(node, visitNode);
37 };
38
39 ts.forEachChild(initialNode, visitNode);
40

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected