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

Function skipSiblingNodes

packages/core/src/hydration/i18n.ts:389–398  ·  view source on GitHub ↗

* Skip over some sibling nodes during hydration. * * Note: we use this instead of `siblingAfter` as it's expected that * sometimes we might encounter null nodes. In those cases, we want to * defer to downstream error handling to provide proper context.

(state: I18nHydrationState, skip: number)

Source from the content-addressed store, hash-verified

387 * defer to downstream error handling to provide proper context.
388 */
389function skipSiblingNodes(state: I18nHydrationState, skip: number) {
390 let currentNode = state.currentNode;
391 for (let i = 0; i < skip; i++) {
392 if (!currentNode) {
393 break;
394 }
395 currentNode = getNextSibling(currentNode);
396 }
397 return currentNode;
398}
399
400/**
401 * Fork the given state into a new state for hydrating children.

Callers 1

collectI18nNodesFromDomFunction · 0.85

Calls 1

getNextSiblingFunction · 0.90

Tested by

no test coverage detected