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

Function serializeI18nBlock

packages/core/src/hydration/i18n.ts:213–230  ·  view source on GitHub ↗
(
  lView: LView,
  serializedI18nBlock: SerializedI18nBlock,
  context: HydrationContext,
  nodes: I18nNode[],
)

Source from the content-addressed store, hash-verified

211}
212
213function serializeI18nBlock(
214 lView: LView,
215 serializedI18nBlock: SerializedI18nBlock,
216 context: HydrationContext,
217 nodes: I18nNode[],
218): Node | null {
219 let prevRNode = null;
220 for (const node of nodes) {
221 const nextRNode = serializeI18nNode(lView, serializedI18nBlock, context, node);
222 if (nextRNode) {
223 if (isDisjointNode(prevRNode, nextRNode)) {
224 serializedI18nBlock.disjointNodes.add(node.index - HEADER_OFFSET);
225 }
226 prevRNode = nextRNode;
227 }
228 }
229 return prevRNode;
230}
231
232/**
233 * Helper to determine whether the given nodes are "disjoint".

Callers 2

trySerializeI18nBlockFunction · 0.85
serializeI18nNodeFunction · 0.85

Calls 3

serializeI18nNodeFunction · 0.85
isDisjointNodeFunction · 0.85
addMethod · 0.65

Tested by

no test coverage detected