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

Function getTIcu

packages/core/src/render3/i18n/i18n_util.ts:39–57  ·  view source on GitHub ↗
(tView: TView, index: number)

Source from the content-addressed store, hash-verified

37 * @param index Index where the value should be read from.
38 */
39export function getTIcu(tView: TView, index: number): TIcu | null {
40 const value = tView.data[index] as null | TIcu | TIcuContainerNode | string;
41 if (value === null || typeof value === 'string') return null;
42 if (
43 ngDevMode &&
44 !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))
45 ) {
46 throwError("We expect to get 'null'|'TIcu'|'TIcuContainer', but got: " + value);
47 }
48 // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be
49 // either TIcu or TIcuContainerNode. This is not ideal, but we still think it is OK because it
50 // will be just two cases which fits into the browser inline cache (inline cache can take up to
51 // 4)
52 const tIcu = value.hasOwnProperty('currentCaseLViewIndex')
53 ? (value as TIcu)
54 : (value as TIcuContainerNode).value;
55 ngDevMode && assertTIcu(tIcu);
56 return tIcu;
57}
58
59/**
60 * Store `TIcu` at a give `index`.

Callers 5

i18n_parse_spec.tsFile · 0.90
i18n_spec.tsFile · 0.90
applyMutableOpCodesFunction · 0.90
applyUpdateOpCodesFunction · 0.90
applyIcuSwitchCaseRemoveFunction · 0.90

Calls 2

throwErrorFunction · 0.90
assertTIcuFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…