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

Function getLastDefinedValue

packages/common/src/i18n/locale_data_api.ts:717–727  ·  view source on GitHub ↗

* Retrieves the first value that is defined in an array, going backwards from an index position. * * To avoid repeating the same data (as when the "format" and "standalone" forms are the same) * add the first value to the locale data arrays, and add other values only if they are different. * *

(data: T[], index: number)

Source from the content-addressed store, hash-verified

715 *
716 */
717function getLastDefinedValue<T>(data: T[], index: number): T {
718 for (let i = index; i > -1; i--) {
719 if (typeof data[i] !== 'undefined') {
720 return data[i];
721 }
722 }
723 throw new RuntimeError(
724 RuntimeErrorCode.LOCALE_DATA_UNDEFINED,
725 ngDevMode && 'Locale data API: locale data undefined',
726 );
727}
728
729/**
730 * Represents a time value with hours and minutes.

Callers 8

getLocaleDayPeriodsFunction · 0.85
getLocaleDayNamesFunction · 0.85
getLocaleMonthNamesFunction · 0.85
getLocaleEraNamesFunction · 0.85
getLocaleDateFormatFunction · 0.85
getLocaleTimeFormatFunction · 0.85
getLocaleDateTimeFormatFunction · 0.85
getLocaleExtraDayPeriodsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…