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

Function locateI18nRNodeByIndex

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

Source from the content-addressed store, hash-verified

79 * @returns an RNode that corresponds to the instruction index
80 */
81export function locateI18nRNodeByIndex<T extends RNode>(
82 hydrationInfo: DehydratedView,
83 noOffsetIndex: number,
84): T | null | undefined {
85 const i18nNodes = hydrationInfo.i18nNodes;
86 if (i18nNodes) {
87 return i18nNodes.get(noOffsetIndex) as T | null | undefined;
88 }
89 return undefined;
90}
91
92/**
93 * 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