MCPcopy
hub / github.com/angular/angular-cli / getSourceNodes

Function getSourceNodes

packages/schematics/angular/utility/ast-utils.ts:190–200  ·  view source on GitHub ↗
(sourceFile: ts.SourceFile)

Source from the content-addressed store, hash-verified

188 * @returns {Array<ts.Node>} An array of all the nodes in the source.
189 */
190export function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[] {
191 const nodes: ts.Node[] = [sourceFile];
192
193 // NOTE: nodes.length changes inside of the loop but we only append to the end
194 for (let i = 0; i < nodes.length; i++) {
195 const node = nodes[i];
196 nodes.push(...node.getChildren(sourceFile));
197 }
198
199 return nodes;
200}
201
202export function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null {
203 if (node.kind === kind && node.getText() === text) {

Callers 6

findBootstrapModuleCallFunction · 0.90
findBootstrapModulePathFunction · 0.90
getServerModulePathFunction · 0.90
getDecoratorMetadataFunction · 0.85
isImportedFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected