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

Function locateI18nRNodeByIndex

packages/core/src/hydration/node_lookup_utils.ts:82–91  ·  view source on GitHub ↗
(
  hydrationInfo: DehydratedView,
  noOffsetIndex: number,
)

Source from the content-addressed store, hash-verified

80 * @returns an RNode that corresponds to the instruction index
81 */
82export function locateI18nRNodeByIndex<T extends RNode>(
83 hydrationInfo: DehydratedView,
84 noOffsetIndex: number,
85): T | null | undefined {
86 const i18nNodes = hydrationInfo.i18nNodes;
87 if (i18nNodes) {
88 return i18nNodes.get(noOffsetIndex) as T | null | undefined;
89 }
90 return undefined;
91}
92
93/**
94 * Attempt to locate an RNode by a path, if it exists.

Callers 2

locateOrCreateNodeImplFunction · 0.90
locateNextRNodeFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected