MCPcopy Index your code
hub / github.com/angular/angular / trySerializeI18nBlock

Function trySerializeI18nBlock

packages/core/src/hydration/i18n.ts:178–210  ·  view source on GitHub ↗
(
  lView: LView,
  index: number,
  context: HydrationContext,
)

Source from the content-addressed store, hash-verified

176 * @returns the i18n data, or null if there is no relevant data
177 */
178export function trySerializeI18nBlock(
179 lView: LView,
180 index: number,
181 context: HydrationContext,
182): SerializedI18nBlock | null {
183 if (!context.isI18nHydrationEnabled) {
184 return null;
185 }
186
187 const tView = lView[TVIEW];
188 const tI18n = tView.data[index] as TI18n | undefined;
189 if (!tI18n || !tI18n.ast) {
190 return null;
191 }
192
193 const parentTNode = tView.data[tI18n.parentTNodeIndex] as TNode;
194 if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) {
195 return null;
196 }
197
198 const serializedI18nBlock: SerializedI18nBlock = {
199 caseQueue: [],
200 disconnectedNodes: new Set(),
201 disjointNodes: new Set(),
202 };
203 serializeI18nBlock(lView, serializedI18nBlock, context, tI18n.ast);
204
205 return serializedI18nBlock.caseQueue.length === 0 &&
206 serializedI18nBlock.disconnectedNodes.size === 0 &&
207 serializedI18nBlock.disjointNodes.size === 0
208 ? null
209 : serializedI18nBlock;
210}
211
212function serializeI18nBlock(
213 lView: LView,

Callers 1

serializeLViewFunction · 0.90

Calls 2

serializeI18nBlockFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…