* 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)
| 740 | * |
| 741 | */ |
| 742 | function 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. |
no outgoing calls
no test coverage detected