MCPcopy Create free account
hub / github.com/angular/angular / collectI18nViews

Function collectI18nViews

packages/core/src/hydration/i18n.ts:99–120  ·  view source on GitHub ↗
(node: I18nNode)

Source from the content-addressed store, hash-verified

97 const children = new Set<number>();
98
99 function collectI18nViews(node: I18nNode) {
100 children.add(node.index);
101
102 switch (node.kind) {
103 case I18nNodeKind.ELEMENT:
104 case I18nNodeKind.PLACEHOLDER: {
105 for (const childNode of node.children) {
106 collectI18nViews(childNode);
107 }
108 break;
109 }
110
111 case I18nNodeKind.ICU: {
112 for (const caseNodes of node.cases) {
113 for (const caseNode of caseNodes) {
114 collectI18nViews(caseNode);
115 }
116 }
117 break;
118 }
119 }
120 }
121
122 // Traverse through the AST of each i18n block in the LView,
123 // and collect every instruction index.

Callers 1

collectI18nChildrenFunction · 0.85

Calls 1

addMethod · 0.65

Tested by

no test coverage detected