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

Function getLastDefinedValue

packages/common/src/i18n/locale_data_api.ts:742–752  ·  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

740 *
741 */
742function getLastDefinedValue<T>(data: T[], index: number): T {
743 for (let i = index; i > -1; i--) {
744 if (typeof data[i] !== 'undefined') {
745 return data[i];
746 }
747 }
748 throw new RuntimeError(
749 RuntimeErrorCode.LOCALE_DATA_UNDEFINED,
750 ngDevMode && 'Locale data API: locale data undefined',
751 );
752}
753
754/**
755 * 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